public inbox for [email protected]  
help / color / mirror / Atom feed
From: David G. Johnston <[email protected]>
To: Ron Johnson <[email protected]>
Cc: PostgreSQL mailing lists <[email protected]>
Subject: Re: BTREE index: field ordering
Date: Fri, 28 Mar 2025 10:04:24 -0700
Message-ID: <CAKFQuwZwwoODiq5ZW7EvCotrfk7jK-wKVnzx=s_NCT7TgM7DmA@mail.gmail.com> (raw)
In-Reply-To: <CAKFQuwZKD=6PQyuC-_Krw8qOESYNhOC+ZNDQYYgqC5402kY0nA@mail.gmail.com>
References: <[email protected]>
	<[email protected]>
	<CANzqJaA17=QxTjNHMmy3xBUcaT5o5ZwxDu74d9tatb8Lwka=2w@mail.gmail.com>
	<CAKFQuwZKD=6PQyuC-_Krw8qOESYNhOC+ZNDQYYgqC5402kY0nA@mail.gmail.com>

On Fri, Mar 28, 2025 at 10:02 AM David G. Johnston <
[email protected]> 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.


view thread (3+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: BTREE index: field ordering
  In-Reply-To: <CAKFQuwZwwoODiq5ZW7EvCotrfk7jK-wKVnzx=s_NCT7TgM7DmA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox