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 C61C08B9B8F for ; Wed, 16 Feb 2005 21:09:44 +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 52454-07 for ; Wed, 16 Feb 2005 21:09:33 +0000 (GMT) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by svr1.postgresql.org (Postfix) with ESMTP id E50D88B9B48 for ; Wed, 16 Feb 2005 21:09:33 +0000 (GMT) Received: from sysexperts.com (c-24-6-183-218.client.comcast.net[24.6.183.218]) by comcast.net (sccrmhc12) with ESMTP id <2005021621093001200f9s2de>; Wed, 16 Feb 2005 21:09:30 +0000 Received: from localhost (localhost [127.0.0.1]) (uid 1000) by filer with local; Wed, 16 Feb 2005 13:09:28 -0800 id 0010A967.4213B688.00006744 Date: Wed, 16 Feb 2005 13:09:28 -0800 From: Kevin Brown To: "Pgsql-Performance (E-mail)" Subject: Re: How to interpret this explain analyse? Message-ID: <20050216210928.GB31014@filer> Mail-Followup-To: Kevin Brown , "Pgsql-Performance (E-mail)" References: <13008.1108150825@sss.pgh.pa.us> <20050215001011.GA31014@filer> <877jla47he.fsf@stark.xeocode.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline In-Reply-To: <877jla47he.fsf@stark.xeocode.com> Organization: Frobozzco International User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200502/248 X-Sequence-Number: 10577 Greg Stark wrote: > > Kevin Brown writes: > > Also, one has to ask what the consequences are of assuming a value too > > low versus too high. Which ends up being worse? > > This is one of the things the planner really cannot know. Ultimately it's the > kind of thing for which hints really are necessary. Oracle distinguishes > between the "minimize total time" versus "minimize startup time" with > /*+ ALL_ROWS */ and /*+ FIRST_ROWS */ hints, for example. Well, the planner *can* know the actual value to use in this case, or at least a close approximation, but the system would have to gather some information about cursors during fetches. At the very least, it will know how many rows were actually fetched by the cursor in question, and it will also hopefully know how many rows were returned by the query being executed. Store the ratio of the two in a list, then store the list itself into a table (or something) at backend exit time. -- Kevin Brown kevin@sysexperts.com