Search Postgresql Archives

Re: BTREE index: field ordering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 28, 2025 at 9:24 AM Ron Johnson <ronljohnsonjr@xxxxxxxxx> 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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux