Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 9ECB69FA5BF for ; Tue, 3 Oct 2006 21:10:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 05539-07 for ; Wed, 4 Oct 2006 00:10:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (news.pyrenet.fr [194.116.145.2]) by postgresql.org (Postfix) with ESMTP id A9E649FB248 for ; Tue, 3 Oct 2006 21:10:04 -0300 (ADT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 1533230E1A; Wed, 4 Oct 2006 02:10:03 +0200 (MET DST) From: Ron Mayer X-Newsgroups: pgsql.performance Subject: Re: Forcing the use of particular execution plans Date: Tue, 03 Oct 2006 17:10:04 -0700 Organization: Hub.Org Networking Services Lines: 17 Message-ID: <4522FBDC.3030706@cheapcomplexdevices.com> References: <000501c6e1ff$c80022c0$0340050a@sdg> <007b01c6e24c$ccfc8190$8300a8c0@tridecap.com> <20060927201350.GS19827@nasby.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org To: "Jim C. Nasby" User-Agent: Thunderbird 1.5.0.5 (X11/20060728) In-Reply-To: <20060927201350.GS19827@nasby.net> X-Enigmail-Version: 0.94.0.0 To: pgsql-performance@postgresql.org X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200610/68 X-Sequence-Number: 21197 Jim C. Nasby wrote: > > Index scans are also pretty picky about correlation. If you have really > low correlation you don't want to index scan, I'm still don't think "correlation" is the right metric at all for making this decision. If you have a list of addresses clustered by "zip" the "correlation" of State, City, County, etc will all be zero (since the zip codes don't match the alphabetical order of state or city names) but index scans are still big wins because the data for any given state or city will be packed on the same few pages - and in fact the pages could be read mostly sequentially. > but I think our current > estimates make it too eager to switch to a seqscan.