Re: Trying to understand why a query is filtering when there is a composite index

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: "Stephen Samuel (Sam)" <sam(at)sksamuel(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Trying to understand why a query is filtering when there is a composite index
Date: 2024-08-19 01:59:10
Message-ID: CAH2-WznVMvKQaT92HgxQ4T_SUOmGezSiFFCdwM3PL90g+5xCbA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Sun, Aug 18, 2024 at 9:56 PM Stephen Samuel (Sam) <sam(at)sksamuel(dot)com> wrote:
> My question is, why isn't it using the index for column b? Is this expected? And why is it doing heap lookups for every row,.

This has been fixed for Postgres 17:

https://pganalyze.com/blog/5mins-postgres-17-faster-btree-index-scans

--
Peter Geoghegan

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Stephen Samuel (Sam) 2024-08-19 02:01:16 Re: Trying to understand why a query is filtering when there is a composite index
Previous Message Stephen Samuel (Sam) 2024-08-19 01:55:50 Trying to understand why a query is filtering when there is a composite index