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

Поиск
Список
Период
Сортировка
От shammat@gmx.net
Тема Re: checking for a NULL date in a partitioned table kills performance
Дата
Msg-id 10668bf5-55a7-4c4a-ade4-c1d93c08eeff@gmx.net
обсуждение исходный текст
Ответ на checking for a NULL date in a partitioned table kills performance  (Sbob <sbob@quadratum-braccas.com>)
Список pgsql-admin
Sbob schrieb am 22.08.2024 um 23:44:
> 
> I am selecting a number of columns and specifying this where clause:
> 
> WHERE (
>                     (contract_date IS NULL)
>                     OR
>                     (contract_date > '2022-01-01'::date)
>              )
> 

It's not the check for NULL, it's the OR that makes this perform so badly. 

I typically never set columns used for range queries to NULL. 

Would using infinity instead of NULL be a viable option here? 

Then you can remove the OR condition entirely. 



В списке pgsql-admin по дате отправления: