Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 29CFBB5DBF4 for ; Wed, 8 Jun 2011 16:53:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 93155-06 for ; Wed, 8 Jun 2011 19:53:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id AC7C9B5D832 for ; Wed, 8 Jun 2011 16:53:36 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Wed, 08 Jun 2011 14:53:33 -0500 Message-Id: <4DEF8CEC020000250003E38D@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Wed, 08 Jun 2011 14:53:32 -0500 From: "Kevin Grittner" To: "Samuel Gendler" , Subject: Re: poor performance when recreating constraints on large tables References: <12692.1307392671@sss.pgh.pa.us> In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/85 X-Sequence-Number: 44018 Samuel Gendler wrote: > The planner knows how many rows are expected for each step of the > query plan, so it would be theoretically possible to compute how > far along it is in processing a query based on those estimates, > wouldn't it? And it is sometimes off by orders of magnitude. How much remaining time do you report when the number of rows actually processed so far is five times the estimated rows that the step would process? How about after it chugs on from there to 20 time she estimated row count? Of course, on your next query it might finish after processing only 5% of the estimated rows.... -Kevin