Re: [PERFORM] Bad query plans for queries on partitioned table

2007-12-05 Thread Julian Mehnle
Gregory, thanks for all the insight! It is much appreciated. Julian. signature.asc Description: This is a digitally signed message part.

Re: [PERFORM] Bad query plans for queries on partitioned table

2007-12-04 Thread Julian Mehnle
Gregory Stark wrote: > "Julian Mehnle" <[EMAIL PROTECTED]> writes: > > I actually do have constraints on all the partitions, e.g. for week > > 34: [...] > > > > Shouldn't this be enough to give the query planner a clue that it > > only has to

Re: [PERFORM] Bad query plans for queries on partitioned table

2007-12-04 Thread Julian Mehnle
Gregory Stark wrote: > There are a few things going on here. > > 1) The optimizer can't build a plan which ignores those partitions > because the statistics are just approximations. You could insert into > one of them at any time and the statistics won't update immediately. If > you have a partitio

Re: [PERFORM] Bad query plans for queries on partitioned table

2007-12-04 Thread Julian Mehnle
Julian Mehnle wrote: > I have a large database with e-mail meta-data (no bodies) for over 100 > million messages. I am running PostgreSQL 8.2.4 on a server with 2GB > of RAM (shared_buffers = 240MB, temp_buffers = 128MB, work_mem = 256MB, > maintenance_work_mem = 256MB). I have the d

[PERFORM] Bad query plans for queries on partitioned table

2007-12-04 Thread Julian Mehnle
Hi all, I have a large database with e-mail meta-data (no bodies) for over 100 million messages. I am running PostgreSQL 8.2.4 on a server with 2GB of RAM (shared_buffers = 240MB, temp_buffers = 128MB, work_mem = 256MB, maintenance_work_mem = 256MB). I have the data split in two separate tables,