Re: [SQL] Partitioned Tables

2012-06-12 Thread Craig Ringer
On 06/13/2012 08:05 AM, Wayne Cuddy wrote: I'm using partitioned tables where a child table is chosen based on a time stamp. One child table exists for each month. I move records from a temp table to the partitioned table via something like this: INSERT INTO parent_table SELECT * FROM temp_tabl

[SQL] Partitioned Tables

2012-06-12 Thread Wayne Cuddy
I'm using partitioned tables where a child table is chosen based on a time stamp. One child table exists for each month. I move records from a temp table to the partitioned table via something like this: INSERT INTO parent_table SELECT * FROM temp_table; All works well but with when inserting to

Re: [SQL] Partitioned tables not using index for min and max 8.2.7?

2009-07-02 Thread Tim Haak
Cool thanks then not something I'm doing wrong :). Is this going to be changed or is changed in a latter version of postgres. (Do I need to do and upgrade or write a work around :) ) Tom Lane wrote: Tim Haak writes: I am running the following query again a partitioned table in 8.2.7. It d

Re: [SQL] Partitioned tables not using index for min and max 8.2.7?

2009-07-01 Thread Tom Lane
Tim Haak writes: > I am running the following query again a partitioned table in 8.2.7. It > does index scans which is unexpected as there are indexes for the > log_date column. The index min/max optimization only works on single tables at the moment. Sorry. regards, t

[SQL] Partitioned tables not using index for min and max 8.2.7?

2009-07-01 Thread Tim Haak
Hi I am running the following query again a partitioned table in 8.2.7. It does index scans which is unexpected as there are indexes for the log_date column. min(log_date) from data.table "Aggregate (cost=739932.02..739932.02 rows=1 width=8)" " -> Append (cost=0.00..685106.21 rows=219303