X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6067B533F2 for ; Sat, 14 May 2005 10:37:31 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76403-06 for ; Sat, 14 May 2005 13:37:22 +0000 (GMT) Received: from flake.decibel.org (flake.decibel.org [67.100.216.10]) by svr1.postgresql.org (Postfix) with ESMTP id C91825373D for ; Sat, 14 May 2005 10:37:21 -0300 (ADT) Received: by flake.decibel.org (Postfix, from userid 1001) id D7F3F15493; Sat, 14 May 2005 08:37:22 -0500 (CDT) Date: Sat, 14 May 2005 08:37:22 -0500 From: "Jim C. Nasby" To: Manfred Koizar Cc: Tom Lane , Dave Held , pgsql-performance@postgresql.org Subject: Re: Sort and index Message-ID: <20050514133722.GO49630@decibel.org> References: <19631.1113966086@sss.pgh.pa.us> <20050420034041.GC58835@decibel.org> <20050423015404.GV58835@decibel.org> <4269.1114222086@sss.pgh.pa.us> <20050423030002.GY58835@decibel.org> <6536.1114232440@sss.pgh.pa.us> <20050424220146.GN58835@decibel.org> <20050511211516.GX31103@decibel.org> <45678156iqld6sd5n63baovuvqj73palmr@email.aon.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45678156iqld6sd5n63baovuvqj73palmr@email.aon.at> X-Operating-System: FreeBSD 4.11-RELEASE i386 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.8i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/280 X-Sequence-Number: 12444 On Thu, May 12, 2005 at 08:54:48PM +0200, Manfred Koizar wrote: > On Wed, 11 May 2005 16:15:16 -0500, "Jim C. Nasby" > wrote: > >> This is divided by the number of index columns, so the index correlation > >> is estimated to be 0.219. > > > >That seems like a pretty bad assumption to make. > > Any assumption we make without looking at entire index tuples has to be > bad. A new GUC variable secondary_correlation introduced by my patch at > least gives you a chance to manually control the effects of additional > index columns. It seems it would be much better to gather statistics on any multi-column indexes, but I know that's probably beyond what's reasonable for your patch. Also, my data (http://stats.distributed.net/~decibel) indicates that max_io isn't high enough. Look specifically at timing2.log compared to timing.log. Thouggh, it is possibile that this is because of having random_page_cost set to 1.1 (if I set it much higher I can't force the index scan because the index estimate actually exceeds the cost of the seqscan with the disable cost added in). > >It depends on the patches, since this is a production machine. Currently > >it's running 7.4.*mumble*, > > The patch referenced in > http://archives.postgresql.org/pgsql-hackers/2003-08/msg00931.php is > still available. It doesn't touch too many places and should be easy to > review. I'm using it and its predecessors in production for more than > two years. Let me know, if the 74b1 version does not apply cleanly to > your source tree. Looks reasonable; I'll give it a shot on 8.0 once I have replication happening. -- Jim C. Nasby, Database Consultant decibel@decibel.org Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming, or what?"