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] 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] inconsistent/weird index usage

2004-10-01 Thread Tom Lane
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 thought this was fixed in 7.4. No? No. It's not fixed

Re: [PERFORM] inconsistent/weird index usage

2004-10-01 Thread Josh Berkus
Tom, > 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 thought this was fixed in 7.4. No? -- Josh Berkus Aglio Database Solutions San Francisco ---

Re: [PERFORM] inconsistent/weird index usage

2004-10-01 Thread Richard Huxton
Dustin Sallings wrote: The following view creates the illusion of the old ``single-table'' model: create view samples as select * from samples_1999 union select * from samples_2000 union select * from samples_2001 union select * from samples_2002 union select * from samples_2003

Re: [PERFORM] inconsistent/weird index usage

2004-10-01 Thread Tom Lane
Dustin Sallings <[EMAIL PROTECTED]> writes: > The following view creates the illusion of the old ``single-table'' > model: > create view samples as > select * from samples_1999 > union select * from samples_2000 > union select * from samples_2001 > union select * from samples_

Re: [PERFORM] inconsistent/weird index usage

2004-10-01 Thread John Meinel
Dustin Sallings wrote: [...] OK, now that that's over with, I have this one particular query that I attempt to run for a report from my phone that no longer works because it tries to do a table scan on *some* of the tables. Why it chooses this table scan, I can't imagine. The query is as

[PERFORM] inconsistent/weird index usage

2004-10-01 Thread Dustin Sallings
To save some time, let me start by saying PostgreSQL 7.4.3 on powerpc-apple-darwin7.4.0, compiled by GCC gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1640) OK, now on to details... I'm trying to implement oracle style ``partitions'' in postgres. I've run into my first snag on