Re: [SQL] PG 8.2beta reordering working for this case?

2006-10-08 Thread Tom Lane
Kyle Bateman <[EMAIL PROTECTED]> writes: > Is there a way to make the optimizer do this? Sorry, that's not happening for 8.2. Consider using a union all (not union) across the subledg_N tables directly and then joining to that. That boils down to being a partitioning case and I think probably wil

[SQL] optimal insert

2006-10-08 Thread Dirk Jagdmann
Hello experts, I have a database that contains three tables: create table a ( id serial primary key, ... -- some more fields not relevant for my question ); create table b ( id serial primary key, ... -- some more fields not relevant for my question ); create table a_b ( a int not null refe

Re: [SQL] optimal insert

2006-10-08 Thread Bruno Wolff III
On Sun, Oct 08, 2006 at 23:04:02 +0200, Dirk Jagdmann <[EMAIL PROTECTED]> wrote: > > insert into a_b(a,b) values(1,100); > insert into a_b(a,b) values(1,200); > insert into a_b(a,b) values(1,54); > insert into a_b(a,b) values(1,4577); > > So for a batch of inserts the value of a stays the same,

Re: [SQL] PG 8.2beta reordering working for this case?

2006-10-08 Thread Kyle Bateman
Tom Lane wrote: Kyle Bateman <[EMAIL PROTECTED]> writes: Is there a way to make the optimizer do this? Sorry, that's not happening for 8.2. Consider using a union all (not union) across the subledg_N tables directly and then joining to that. That boils down to being a partitioning ca