Re: [HACKERS] Sort of a planner regression 8.3->8.4 (due to EXISTS inlining) and related stuff

2010-05-16 Thread Andres Freund
On Monday 17 May 2010 04:10:46 Tom Lane wrote: > Robert Haas writes: > > I believe this is a result of a limitation we've discussed > > previously, namely, that the planner presently uses a limited, > > special-case kludge to consider partial index scans, and the executor > > uses another kludge

Re: [HACKERS] Sort of a planner regression 8.3->8.4 (due to EXISTS inlining) and related stuff

2010-05-16 Thread Tom Lane
Robert Haas writes: > I believe this is a result of a limitation we've discussed > previously, namely, that the planner presently uses a limited, > special-case kludge to consider partial index scans, and the executor > uses another kludge to execute them. Yeah. To restore this case to somethin

Re: [HACKERS] Sort of a planner regression 8.3->8.4 (due to EXISTS inlining) and related stuff

2010-05-16 Thread Robert Haas
On Sun, May 16, 2010 at 7:07 PM, Andres Freund wrote: > Reducing the (large and ugly, automatically generated queries) to a > reproducible testcase I ended up with the following pattern: > > explain SELECT 1 > FROM >    c > WHERE >    EXISTS ( >        SELECT * >        FROM a >            JOIN b

Re: [HACKERS] Sort of a planner regression 8.3->8.4 (due to EXISTS inlining) and related stuff

2010-05-16 Thread Andres Freund
Testschema: ROLLBACK; BEGIN; CREATE TABLE a ( a_id serial PRIMARY KEY NOT NULL, b_id integer ); CREATE INDEX a__b_id ON a USING btree (b_id); CREATE TABLE b ( b_id serial NOT NULL, c_id integer ); CREATE INDEX b__c_id ON b USING btree (c_id); CREATE TABLE c ( c_id serial P

[HACKERS] Sort of a planner regression 8.3->8.4 (due to EXISTS inlining) and related stuff

2010-05-16 Thread Andres Freund
Hi all, After having received several reports of worse plans on 8.4 compared to 8.3 and recently once more one from 'vaxerdec' on IRC I tried to investigate the difference. Reducing the (large and ugly, automatically generated queries) to a reproducible testcase I ended up with the following pa