Re: Query planner problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ryan VanMiddlesworth <ryan(at)vanmiddlesworth(dot)org>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query planner problem
Date: 2004-10-02 23:21:16
Message-ID: 26954.1096759276@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Ryan VanMiddlesworth <ryan(at)vanmiddlesworth(dot)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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2004-10-02 23:44:21 Re: inconsistent/weird index usage
Previous Message Hannu Krosing 2004-10-02 23:20:41 Re: inconsistent/weird index usage