Re: Query planner problem

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query planner problem
Дата
Msg-id 26954.1096759276@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Query planner problem  (Ryan VanMiddlesworth <ryan@vanmiddlesworth.org>)
Список pgsql-performance
Ryan VanMiddlesworth <ryan@vanmiddlesworth.org> writes:
> And here is the query and EXPLAIN from the version that I believe the planner
> should reduce to be logically equivalent:
>  SELECT case_id FROM case_data
>  WHERE (('2004-09-16' IS NULL) OR (case_filed_date > '2004-09-16'))
>    AND (('2004-09-20' IS NULL) OR (case_filed_date < '2004-09-20'))

> I was hoping that the null comparisons would get folded out by the planner
> relatively cheaply.

You could teach eval_const_expressions about simplifying NullTest nodes
if you think it's important enough.

            regards, tom lane

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

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: inconsistent/weird index usage
Следующее
От: Tom Lane
Дата:
Сообщение: Re: inconsistent/weird index usage