Re: [PERFORM] Query planner problem

2004-10-03 Thread Greg Stark
Russell Smith [EMAIL PROTECTED] writes: The Index does not store NULL values This is false. Though the fact that NULL values are indexed in postgres doesn't help with this poster's actual problem. -- greg ---(end of broadcast)--- TIP 2: you

[PERFORM] Query planner problem

2004-10-02 Thread Ryan VanMiddlesworth
Okay, I've got two queries that I think the planner should reduce to be logically equivalent but it's not happening. The example queries below have been simplified as much as possible while still producing the problem. What I'm trying to do is create a single prepared statement that can handle

Re: [PERFORM] Query planner problem

2004-10-02 Thread Russell Smith
On Sat, 2 Oct 2004 08:06 am, Ryan VanMiddlesworth wrote: [snip] Here is the query and EXPLAIN that runs quickly: SELECT case_id FROM case_data WHERE case_filed_date '2004-09-16' AND case_filed_date '2004-09-20' QUERY PLAN

Re: [PERFORM] Query planner problem

2004-10-02 Thread Tom Lane
Ryan VanMiddlesworth [EMAIL PROTECTED] 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