Re: [PERFORM] inconsistent/weird index usage

2004-10-02 Thread Tom Lane
Hannu Krosing <[EMAIL PROTECTED]> writes: >> No. It's not fixed as of CVS tip either, although there was some talk >> of doing something in time for 8.0. > That's weird - my 7.4.2 databases did not consider (now()-'15 > min'::interval) to be a constant whereas 7.4.5 does (i.e. it does use > index

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

Re: [PERFORM] inconsistent/weird index usage

2004-10-02 Thread Hannu Krosing
On R, 2004-10-01 at 19:34, Tom Lane wrote: > Josh Berkus <[EMAIL PROTECTED]> writes: > >> Most of the problem here comes from the fact that "current_date - 7" > >> isn't reducible to a constant and so the planner is making bad guesses > >> about how much of each table will be scanned. > > > I th

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] Caching of Queries

2004-10-02 Thread Josh Berkus
William, > Just my 2 cents on this whole issue. I would lean towards having result > caching in pgpool versus the main backend. I want every ounce of memory > on a database server devoted to the database. Caching results would > double the effect of cache flushing ... ie, now both the results and

[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] Caching of Queries

2004-10-02 Thread William Yu
Josh Berkus wrote: 1) Query caching is not a single problem, but rather several different problems requiring several different solutions. 2) Of these several different solutions, any particular query result caching implementation (but particularly MySQL's) is rather limited in its applicabilit

Re: [PERFORM] Caching of Queries

2004-10-02 Thread Josh Berkus
Aaron, > I'm not sure I understand your req fully. I'm not surprised.I got wrapped up in an overly involved example and completely left off the points I was illustrating. So here's the points, in brief: 1) Query caching is not a single problem, but rather several different problems req