Re: [PERFORM] issue with query optimizer when joining two partitioned tables

2011-07-10 Thread Jeremy Harris
On 2011-07-09 18:43, Tom Lane wrote: Heikki Linnakangas writes: On 09.07.2011 00:36, Anish Kejariwal wrote: My guess as to what happened: -because the icecream parent table has zero records, the query optimizer chooses the incorrect execution plan -when I do select * from icecream, the optimiz

Re: [PERFORM] issue with query optimizer when joining two partitioned tables

2011-07-10 Thread Anish Kejariwal
Thanks Tom and Heikki! I really appreciate your help. I went ahead and loaded all the data. In the icream table, I now have ~175 partitions, each with 4041866 records. The data finished loading 12 hours ago, and I then ran the same query I gave you guys, and it took 25 seconds since it used the

Re: [PERFORM] issue with query optimizer when joining two partitioned tables

2011-07-09 Thread Tom Lane
Heikki Linnakangas writes: > On 09.07.2011 00:36, Anish Kejariwal wrote: >> My guess as to what happened: >> -because the icecream parent table has zero records, the query optimizer >> chooses the incorrect execution plan >> -when I do select * from icecream, the optimizer now knows how many recor

Re: [PERFORM] issue with query optimizer when joining two partitioned tables

2011-07-09 Thread Heikki Linnakangas
On 09.07.2011 00:36, Anish Kejariwal wrote: My guess as to what happened: -because the icecream parent table has zero records, the query optimizer chooses the incorrect execution plan -when I do select * from icecream, the optimizer now knows how many records are really in the icecream table, by

[PERFORM] issue with query optimizer when joining two partitioned tables

2011-07-08 Thread Anish Kejariwal
I have run into issue where the query optimizer is choosing the wrong execution plan when I'm trying to join two large tables that have been partitioned. I would really appreciate it if someone could help me out this. I don't know whether I've found a bug in the optimizer, or whether there is som