X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id BFCE4D1CCC5 for ; Fri, 9 Apr 2004 00:28:41 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 29961-04 for ; Fri, 9 Apr 2004 00:28:39 -0300 (ADT) Received: from secure.icanx.com (secure.icanx.com [64.246.58.55]) by svr1.postgresql.org (Postfix) with ESMTP id 113E7D1CCC2 for ; Fri, 9 Apr 2004 00:28:40 -0300 (ADT) Received: from 63-229-201-197.mpls.qwest.net ([63.229.201.197] helo=[192.168.2.102]) by secure.icanx.com with esmtp (Exim 4.24) id 1BBmhU-0004nz-FQ; Thu, 08 Apr 2004 23:29:04 -0400 Mime-Version: 1.0 (Apple Message framework v613) In-Reply-To: <200404081633.40388.josh@agliodbs.com> References: <200404081633.40388.josh@agliodbs.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Mark Lubratt Subject: Re: tsearch query plan Date: Thu, 8 Apr 2004 22:28:37 -0500 To: pgsql-performance@postgresql.org, josh@agliodbs.com X-Mailer: Apple Mail (2.613) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - secure.icanx.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - indeq.com X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/116 X-Sequence-Number: 6416 On Apr 8, 2004, at 6:33 PM, Josh Berkus wrote: > Mark, > >> I've got one question about query planning. Is it understandable to >> have the query plan estimation be off by a couple of orders of >> magnitude? Or, is it the fact that the cost estimation is small to >> begin with that the error between the actual and the estimated is >> "normal"? > > Well, your example is not "a couple orders of magnitude". 6 vs. 32 is > actually pretty good accuracy. > > Now, 6 vs 192 would potentially be a problem, let alone 32 vs 13,471. > I guess I was looking more at the cost estimate and not so much at the rows estimate. I agree that the row estimate wasn't too bad. But the cost estimate seems way out of line. I'm somewhat new to examining explain analyze output and I'm looking at this as more of an education, since the speed is certainly good anyway. I just expected the cost estimate to be more in line especially immediately after an analyze. -Mark