Re: checking for a NULL date in a partitioned table kills performance

2024-08-24 Thread Rui DeSousa
> On Aug 22, 2024, at 8:05 PM, Tom Lane wrote: > > Sbob writes: >> 29 million of the 32 million rows in the table have NULL for contract_date > > [ blink... ] So your query is selecting at least 29/32nds of the > table, plus however much matches the contract_date > '2022-01-01' > alternative

Re: checking for a NULL date in a partitioned table kills performance

2024-08-22 Thread Tom Lane
Sbob writes: > 29 million of the 32 million rows in the table have NULL for contract_date [ blink... ] So your query is selecting at least 29/32nds of the table, plus however much matches the contract_date > '2022-01-01' alternative. I'm not sure how you expect that to be significantly cheaper

Re: checking for a NULL date in a partitioned table kills performance (accidentally sent to the admin list before)

2024-08-22 Thread Vitalii Tymchyshyn
Can you put the whole thing into the index where clause? (contract_date IS NULL) OR (contract_date > '2022-01-01'::date) Best regards, Vitalii Tymchyshyn чт, 22 серп. 2024 р. о 14:48 Sbob пише: > All; > > I am running a select from a partitioned table. The table (and all t