X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 93580476351 for ; Sun, 20 Apr 2003 11:22:04 -0400 (EDT) Received: from minos.iwerx.gr (unknown [194.158.4.35]) by postgresql.org (Postfix) with ESMTP id 8CDE447634E for ; Sun, 20 Apr 2003 11:21:59 -0400 (EDT) Received: from pobox.gr (minos.iwerx.gr [194.158.4.35]) by minos.iwerx.gr (8.12.8/8.12.8) with ESMTP id h3KGJ635003090; Sun, 20 Apr 2003 18:19:06 +0200 Message-ID: <3EA2BA17.6060106@pobox.gr> Date: Sun, 20 Apr 2003 17:17:43 +0200 From: kp User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en MIME-Version: 1.0 To: Tom Lane Cc: pgsql-admin@postgresql.org Subject: Re: Sequence scans on indexed row References: <3EA231D2.2040305@pobox.gr> <26876.1050850718@sss.pgh.pa.us> In-Reply-To: <26876.1050850718@sss.pgh.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-38.8 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,USER_AGENT_MOZILLA_UA autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/283 X-Sequence-Number: 8438 Tom Lane wrote: > The only way it's wrong is if the particular value being searched for is > much less than 1/14th of the table. IIRC Postgres 7.1 does not have > statistics about anything beyond the most common value of the column, > and so it's easily misled by nonuniform data distributions. If that's > your situation then an update to 7.2.* or 7.3.* seems called for. And this is exactly the case... This is the data distribution for the column with the 14 distinct values: code | record_count ----------+-------------- | 186802 aa | 432 bb | 31557 cc | 5599 dd | 15511 ee | 8364 ff | 769796 gg | 328 hh | 4911 ii | 1904 jj | 9145 kk | 576944 ll | 2296 OK. I will upgrade my installation and see what happens. Thanks very much for the advice. Best regards... kp