X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id D73B64763B6 for ; Thu, 8 May 2003 07:20:17 -0400 (EDT) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by postgresql.org (Postfix) with ESMTP id 2446F475A80 for ; Thu, 8 May 2003 07:20:17 -0400 (EDT) Received: from [10.1.2.130] (helo=dba2) by mail.libertyrms.com with esmtp (Exim 3.22 #3 (Debian)) id 19DjRk-0008Rb-00 for ; Thu, 08 May 2003 07:20:20 -0400 Received: by dba2 (Postfix, from userid 1019) id 17714CF78; Thu, 8 May 2003 07:20:20 -0400 (EDT) Date: Thu, 8 May 2003 07:20:20 -0400 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: An unresolved performance problem. Message-ID: <20030508112020.GB3728@libertyrms.info> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.3i X-Spam-Status: No, hits=-34.8 required=5.0 tests=BAYES_10,EMAIL_ATTRIBUTION,IN_REP_TO,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_MUTT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/102 X-Sequence-Number: 1881 On Thu, May 08, 2003 at 10:48:52AM -0200, Achilleus Mantzios wrote: > That is, we have a marginal decrease of the total cost > for the index scan when random_page_cost = 1.9, > whereas the "real cost" in the means of total runtime > ranges from 218 msecs (seq scan) to 19 msecs (index scan). > (is it sane?) You're right that the problem is the poor estimate of the cost of that selection. I recall you mentioning that you'd expanded the statistics on the field, but I don't recall to what. I know that under some circumstances, you _really_ have to increase the stats to get a meaningful sample. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110