Re: [ADMIN] Index not used. WHY?

From: Shridhar Daithankar <shridhar_daithankar(at)myrealbox(dot)com>
To: Andrei Bintintan <klodoma(at)ar-sd(dot)net>
Cc: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: [ADMIN] Index not used. WHY?
Date: 2003-12-05 08:39:51
Message-ID: 3FD04457.6000504@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-performance

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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Alan Graham 2003-12-05 09:47:30 Re: Trigger to call an external program
Previous Message Andrei Bintintan 2003-12-05 08:11:11 Re: [ADMIN] Index not used. WHY?

Browse pgsql-performance by date

  From Date Subject
Next Message Thierry Missimilly 2003-12-05 09:13:09 Re: tuning questions
Previous Message Andrei Bintintan 2003-12-05 08:11:11 Re: [ADMIN] Index not used. WHY?