Re: BTREE index: field ordering - Mailing list pgsql-general

From David G. Johnston
Subject Re: BTREE index: field ordering
Date
Msg-id CAKFQuwZwwoODiq5ZW7EvCotrfk7jK-wKVnzx=s_NCT7TgM7DmA@mail.gmail.com
Whole thread Raw
In response to Re: BTREE index: field ordering  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
On Fri, Mar 28, 2025 at 10:02 AM David G. Johnston <david.g.johnston@gmail.com> wrote:
Selectivity is evaluating cardinality with an eye on the frequency of the values you are actually going to be filtering on.  So low cardinality booleans can be highly selective in usage if you are looking for the rare false in a sea of trues but low selectivity if looking through those trues.

And to accommodate the highly-selective case a partial index is much better than indexing the low cardinality boolean column values.

David J.

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BTREE index: field ordering
Next
From: Sasa Vilic
Date:
Subject: Concurrent delete and insert on same key, potentially a bug