X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 0F5C4D1B47A for ; Fri, 5 Dec 2003 08:40:37 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 14504-02 for ; Fri, 5 Dec 2003 04:40:07 -0400 (AST) Received: from smtp-send.myrealbox.com (smtp-send.myrealbox.com [192.108.102.143]) by svr1.postgresql.org (Postfix) with ESMTP id D8495D1B475 for ; Fri, 5 Dec 2003 04:40:04 -0400 (AST) Received: from myrealbox.com shridhar_daithankar@smtp-send.myrealbox.com [202.54.11.72] by smtp-send.myrealbox.com with NetMail SMTP Agent $Revision: 3.45 $ on Novell NetWare via secured & encrypted transport (TLS); Fri, 05 Dec 2003 01:40:07 -0700 Message-ID: <3FD04457.6000504@myrealbox.com> Date: Fri, 05 Dec 2003 14:09:51 +0530 From: Shridhar Daithankar User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrei Bintintan Cc: Stephan Szabo , pgsql-performance@postgresql.org Subject: Re: [ADMIN] Index not used. WHY? References: <014901c3ba76$ffd65650$0b00a8c0@andy> <20031204071432.R66123@megazone.bigpanda.com> <00c901c3bb07$592bbe30$0b00a8c0@andy> In-Reply-To: <00c901c3bb07$592bbe30$0b00a8c0@andy> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/118 X-Sequence-Number: 4978 Andrei Bintintan wrote: > There are around 700 rows in this table. > If I set enable_seqscan=off then the index is used and I also used Vacuum > Analyze recently. For 700 rows I think seq. would work best. > > I find it strange because the number of values of id_user and id_modull are > somehow in the same distribution and when I search the table the id_user > index is used but the id_modull index is not used. > > Does somehow postgre know that a seq scan runs faster in this case as a > index scan? Should I erase this index? > I have to say that the data's in this table are not changed offen, but there > are a LOT of joins made with this table. If table is cached then it does not matter. Unless it grows substantially, say to around hundred thousand rows(Note your table is small), idex wouldn't be that useful. Shridhar