X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id DC9D14763C2 for ; Thu, 8 May 2003 10:42:51 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 9BC1E474E4F for ; Thu, 8 May 2003 10:42:50 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h48EgtU6020337 for ; Thu, 8 May 2003 10:42:55 -0400 (EDT) To: pgsql-performance@postgresql.org Subject: Re: An unresolved performance problem. In-reply-to: <20030508112020.GB3728@libertyrms.info> References: <20030508112020.GB3728@libertyrms.info> Comments: In-reply-to Andrew Sullivan message dated "Thu, 08 May 2003 07:20:20 -0400" Date: Thu, 08 May 2003 10:42:55 -0400 Message-ID: <20336.1052404975@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-32.3 required=5.0 tests=BAYES_00,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES 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/103 X-Sequence-Number: 1882 Andrew Sullivan writes: > 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. Are the table and index orders the same? Oliver Elphick pointed out awhile ago that we're doing a bad job of index order correlation estimation for multi-column indexes --- the correlation is taken to be much lower than it should be. But if the correlation is near zero anyway then this wouldn't explain Achilleus' problem... regards, tom lane