From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Ron Johnson <ronljohnsonjr(at)gmail(dot)com> |
Cc: | PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: BTREE index: field ordering |
Date: | 2025-03-28 17:02:29 |
Message-ID: | CAKFQuwZKD=6PQyuC-_Krw8qOESYNhOC+ZNDQYYgqC5402kY0nA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Fri, Mar 28, 2025 at 9:24 AM Ron Johnson <ronljohnsonjr(at)gmail(dot)com> wrote:
>
> "at least for WHERE conditions that are selective" confuses me. Aren't
> _all_ WHERE clauses selective?
>
>
From earlier in the email, selectivity is a scale, the wording here implies
"has a meaningful selectivity".
"Fundamentally yes, but you also have to consider how selective the
conditions are." - Laurenz
where true - selectivity 0
where not(is_deleted) - selectivity < .01 ish in many cases
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.
David J.
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2025-03-28 17:04:24 | Re: BTREE index: field ordering |
Previous Message | Evgeny Morozov | 2025-03-28 17:00:20 | Re: Querying one partition in a function takes locks on all partitions |