Re: checking for a NULL date in a partitioned table kills performance - Mailing list pgsql-admin

From David G. Johnston
Subject Re: checking for a NULL date in a partitioned table kills performance
Date
Msg-id CAKFQuwZKTiS5b_Loe21p9rFBzR5XriHODPeocP40QAECTHEMkA@mail.gmail.com
Whole thread Raw
In response to Re: checking for a NULL date in a partitioned table kills performance  (Sbob <sbob@quadratum-braccas.com>)
List pgsql-admin
On Thu, Aug 22, 2024 at 4:32 PM Sbob <sbob@quadratum-braccas.com> wrote:

29 million of the 32 million rows in the table have NULL for contract_date


Your expectation that this query should use an index is flawed.  Indexes are for highly selective queries.  Finding nulls on that table is not selective.

David J.

pgsql-admin by date:

Previous
From: Sbob
Date:
Subject: Re: checking for a NULL date in a partitioned table kills performance
Next
From: Rui DeSousa
Date:
Subject: Re: checking for a NULL date in a partitioned table kills performance