Re: Index of a table is not used (in any case)

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: mlw <markw(at)mohawksoft(dot)com>
Cc: Zeugswetter Andreas SB SD <ZeugswetterA(at)spardat(dot)at>, Doug McNaught <doug(at)wireboard(dot)com>, Reiner Dassing <dassing(at)wettzell(dot)ifag(dot)de>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Index of a table is not used (in any case)
Date: 2001-10-24 21:55:42
Message-ID: Pine.LNX.4.30.0110242342330.647-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

mlw writes:

> The "not using index" was very frustrating to understand. The stock answer,
> "did you vacuum?" just isn't enough. There has to be some explanation (in the
> FAQ or something) about the indexed key distribution in your data.

Most "not using index" questions seem to be related to a misunderstanding
of users to the effect that "if there is an index it must be used, not
matter what the query", which is of course far from reality. Add to that
the (related) category of inquiries from people that think the index ought
to be used but don't have any actual timings to show, you have a lot of
people that just need to be educated.

Of course the question "did you vacuum" (better, did you analyze) is
annoying, just as the requirement to analyze is annoying in the first
place, but unless someone designs a better query planner it will have to
do. The reason why we always ask that question first is that people
invariantly have not analyzed. A seasoned developer can often tell from
the EXPLAIN output whether ANALYZE has been done, but users cannot.
Perhaps something can be done in this area, but I'm not exactly sure what.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2001-10-24 21:56:01 Re: [HACKERS] CREATE OR REPLACE VIEW/TRIGGER
Previous Message Peter Eisentraut 2001-10-24 21:54:33 Re: Compiling on Solaris with Sun compiler