Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C42AF4769D9 for ; Wed, 2 Oct 2002 18:48:50 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 3170C4769AB for ; Wed, 2 Oct 2002 18:48:49 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.5/8.12.5) with ESMTP id g92MmnhR029476; Wed, 2 Oct 2002 18:48:49 -0400 (EDT) To: Manfred Koizar Cc: pgsql-hackers@postgresql.org Subject: Re: Correlation in cost_index() In-reply-to: References: Comments: In-reply-to Manfred Koizar message dated "Wed, 02 Oct 2002 21:52:46 +0200" Date: Wed, 02 Oct 2002 18:48:49 -0400 Message-ID: <29475.1033598929@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/82 X-Sequence-Number: 29851 Manfred Koizar writes: > AFAICS (part of) the real problem is in costsize.c:cost_index() where > IO_cost is calculated from min_IO_cost, pages_fetched, > random_page_cost, and indexCorrelation. The current implementation > uses indexCorrelation^2 to interpolate between min_IO_cost and > max_IO_cost, which IMHO gives results that are too close to > max_IO_cost. The indexCorrelation^2 algorithm was only a quick hack with no theory behind it :-(. I've wanted to find some better method to put in there, but have not had any time to research the problem. > As nobody knows how each of these proposals performs in real life > under different conditions, I suggest to leave the current > implementation in, add all three algorithms, and supply a GUC variable > to select a cost function. I don't think it's really a good idea to expect users to pick among multiple cost functions that *all* have no guiding theory behind them. I'd prefer to see us find a better cost function and use it. Has anyone trawled the database literature on the subject? regards, tom lane