X-Original-To: pgsql-performance@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 9F27C475EC9 for ; Fri, 9 May 2003 03:55:33 -0400 (EDT) Received: from matrix.gatewaynet.com (unknown [217.19.69.50]) by postgresql.org (Postfix) with ESMTP id 52BF0475A80 for ; Fri, 9 May 2003 03:55:25 -0400 (EDT) Received: from matrix.gatewaynet.com (localhost [127.0.0.1]) by matrix.gatewaynet.com (8.12.5/8.12.5) with ESMTP id h49D0V1s006330; Fri, 9 May 2003 11:00:31 -0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.5/8.12.5/Submit) with ESMTP id h49D0V9w006326; Fri, 9 May 2003 11:00:31 -0200 Date: Fri, 9 May 2003 11:00:30 -0200 (GMT+2) From: Achilleus Mantzios To: Tom Lane Cc: pgsql-performance@postgresql.org Subject: Re: An unresolved performance problem. In-Reply-To: <20336.1052404975@sss.pgh.pa.us> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-38.6 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, QUOTE_TWICE_1,REPLY_WITH_QUOTES,SIGNATURE_LONG_DENSE, USER_AGENT_PINE 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/110 X-Sequence-Number: 1889 On Thu, 8 May 2003, Tom Lane wrote: > 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... Please correct me if i am wrong. (i think i probably am) The correlation value in pg_statistc for a column refers to the correlation between the ordering of a table's tuples and the ordering of that column. (So it plays some role in determining the execution plan if an index exists on that column. Also CLUSTERing a single-column index on the table makes reordering of the table according to that index, that is the ordering of that column). Is that correct?? If so, how can one find the correlation between the ordering of a table and a multicolumn index? > > regards, tom lane > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org > -- ================================================================== Achilleus Mantzios S/W Engineer IT dept Dynacom Tankers Mngmt Nikis 4, Glyfada Athens 16610 Greece tel: +30-210-8981112 fax: +30-210-8981877 email: achill@matrix.gatewaynet.com mantzios@softlab.ece.ntua.gr