Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 02D76DE314D for ; Tue, 3 Apr 2012 12:35:51 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SF5lt-0002C2-Ju for pgsql-performance@postgresql.org; Tue, 03 Apr 2012 15:35:51 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q33FZYYf007811; Tue, 3 Apr 2012 11:35:34 -0400 (EDT) To: Robert Haas cc: Claus Stadler , pgsql-performance@postgresql.org Subject: Re: ...WHERE TRUE" condition in union results in bad query pla In-reply-to: References: <4F529E85.8010506@informatik.uni-leipzig.de> <1857.1330830209@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Tue, 03 Apr 2012 10:57:43 -0400" Date: Tue, 03 Apr 2012 11:35:34 -0400 Message-ID: <7810.1333467334@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201204/22 X-Sequence-Number: 46668 Robert Haas writes: > On Sat, Mar 3, 2012 at 10:03 PM, Tom Lane wrote: >> Sooner or later I'd like to relax the restriction that appendrel members >> can't have extra WHERE clauses, but don't hold your breath waiting... > Does this comment need updating? > * Note: the data structure assumes that append-rel members are single > * baserels. This is OK for inheritance, but it prevents us from pulling > * up a UNION ALL member subquery if it contains a join. While that could > * be fixed with a more complex data structure, at present there's not much > * point because no improvement in the plan could result. No, that's a different restriction. regards, tom lane