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 EE944D1B18A for ; Wed, 9 Jun 2004 22:38:37 -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 37966-07 for ; Thu, 10 Jun 2004 01:38:40 +0000 (GMT) Received: from houston.familyhealth.com.au (fhnet.arach.net.au [203.22.197.21]) by svr1.postgresql.org (Postfix) with ESMTP id ED783D1B1CE for ; Wed, 9 Jun 2004 22:38:34 -0300 (ADT) Received: from [192.168.0.40] (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9p1/8.12.9) with ESMTP id i5A1cYWL037397; Thu, 10 Jun 2004 09:38:35 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <40C7BD2A.70604@familyhealth.com.au> Date: Thu, 10 Jun 2004 09:45:14 +0800 From: Christopher Kings-Lynne User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: ken Cc: Postgresql Performance Subject: Re: Index oddity References: <1086809460.32077.246.camel@pesky> <1086811930.2539.90.camel@jester> <1086814209.32077.252.camel@pesky> <1086814597.2539.92.camel@jester> <1086814928.32077.259.camel@pesky> <1086816543.2539.98.camel@jester> <1086822662.32077.278.camel@pesky> In-Reply-To: <1086822662.32077.278.camel@pesky> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/107 X-Sequence-Number: 7165 > If I take away the diagonalSize condition in my query I find that there > are 225 rows that satisfy the other conditions. 155 of these have a > diagonalSize value of exactly 50.000, while the remaining 70 rows all > have values larger than 50. Thus there is a big discrete jump in the > number of rows at a diagonalSize of 50. However, the statistics are off > by two orders of magnitude in guessing how many rows there are going to > be in this case and thus is not using my index. How can I fix that? Maybe you should drop your random_page_cost to something less than 4, eg. 3 or even 2... Chris