Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id E7F382E2762 for ; Sun, 13 Jan 2008 14:47:09 -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 31639-09 for ; Sun, 13 Jan 2008 14:47:04 -0400 (AST) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 0D3AE2E026F for ; Sun, 13 Jan 2008 14:47:05 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id m0DIkh3X007213; Sun, 13 Jan 2008 13:46:44 -0500 (EST) To: "Julian Scarfe" cc: pgsql-performance@postgresql.org Subject: Re: Inheritance, unique keys and performance In-reply-to: <01b601c855c4$8ed20a60$0600a8c0@Wilbur> References: <01a301c85552$24ab6270$0600a8c0@Wilbur> <21684.1200170118@sss.pgh.pa.us> <01b601c855c4$8ed20a60$0600a8c0@Wilbur> Comments: In-reply-to "Julian Scarfe" message dated "Sun, 13 Jan 2008 09:13:21 +0000" Date: Sun, 13 Jan 2008 13:46:43 -0500 Message-ID: <7212.1200250003@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/108 X-Sequence-Number: 28347 "Julian Scarfe" writes: >> Without the EXPLAIN ANALYZE output, nobody can say whether you have >> interpreted your performance problem correctly or not. > Fair enough, Tom. Okay, so the "expensive function" isn't as expensive as all that --- it seems to be adding only a few msec to the total runtime. 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. regards, tom lane