X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4BAF08B9E1E for ; Thu, 3 Feb 2005 06:55:49 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 95190-02 for ; Thu, 3 Feb 2005 06:55:40 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 471688B9E02 for ; Thu, 3 Feb 2005 06:55:40 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j136tSOQ012897; Thu, 3 Feb 2005 01:55:28 -0500 (EST) To: Josh Berkus Cc: Klint Gore , Gaetano Mendola , pgsql-performance@postgresql.org Subject: Re: horizontal partition In-reply-to: <200502022241.57799.josh@agliodbs.com> References: <200502021209.06878.josh@agliodbs.com> <42019B1735F.1271KG@129.180.47.120> <200502022241.57799.josh@agliodbs.com> Comments: In-reply-to Josh Berkus message dated "Wed, 02 Feb 2005 22:41:57 -0800" Date: Thu, 03 Feb 2005 01:55:28 -0500 Message-ID: <12896.1107413728@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/52 X-Sequence-Number: 10381 Josh Berkus writes: > The issue here is that the planner is capable of "pushing down" the WHERE > criteria into the first view, but not into the second, "nested" view, and so > postgres materializes the UNIONed data set before perfoming the join. > Thing is, I seem to recall that this particular issue was something Tom fixed > a while ago. Which is why I wanted to know what version Gaetano is using. It's still true that we can't generate a nestloop-with-inner-indexscan join plan if the inner side is anything more complex than a single table scan. Since that's the only plan that gives you any chance of not scanning the whole partitioned table, it's rather a hindrance :-( It might be possible to fix this by treating the nestloop's join conditions as "push down-able" criteria, instead of the present rather ad hoc method for generating nestloop/indexscan plans. It'd be quite a deal of work though, and I'm concerned about how slow the planner might run if we did do it like that. regards, tom lane