Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id F19172E3648 for ; Sun, 13 Jan 2008 15:28:26 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 41148-07 for ; Sun, 13 Jan 2008 15:28:20 -0400 (AST) Received: from mtaout03-winn.ispmail.ntl.com (mtaout03-winn.ispmail.ntl.com [81.103.221.49]) by postgresql.org (Postfix) with ESMTP id DD3B92E3646 for ; Sun, 13 Jan 2008 15:28:22 -0400 (AST) Received: from aamtaout04-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com with ESMTP id <20080113192952.RFWE20647.mtaout03-winn.ispmail.ntl.com@aamtaout04-winn.ispmail.ntl.com>; Sun, 13 Jan 2008 19:29:52 +0000 Received: from Wilbur ([81.102.134.219]) by aamtaout04-winn.ispmail.ntl.com with SMTP id <20080113192822.MGKW29112.aamtaout04-winn.ispmail.ntl.com@Wilbur>; Sun, 13 Jan 2008 19:28:22 +0000 Message-ID: <01fb01c8561a$76d6b4a0$0600a8c0@Wilbur> From: "Julian Scarfe" To: "Tom Lane" Cc: References: <01a301c85552$24ab6270$0600a8c0@Wilbur> <21684.1200170118@sss.pgh.pa.us> <01b601c855c4$8ed20a60$0600a8c0@Wilbur> <7212.1200250003@sss.pgh.pa.us> Subject: Re: Inheritance, unique keys and performance Date: Sun, 13 Jan 2008 19:28:18 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 x-mimeole: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.909 tagged_above=0 required=5 tests=AWL=-0.116, BAYES_05=-1.11, STOX_REPLY_TYPE=0.001, TVD_FINGER_02=2.134 X-Spam-Level: X-Archive-Number: 200801/109 X-Sequence-Number: 28348 From: "Tom Lane" > The > problem you've got is that you need a nestloop-with-inner-indexscan > plan type, where the inner side is an Append group (that is, an > inheritance tree) --- and 8.1 doesn't know how to create such a plan. > If you can update to 8.2 or later it should get better. Isn't test 3 (scalar subqueries) also a nestloop-with-inner-indexscan with an inner Append? Julian