Re: PostgreSQL index usage discussion.

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: mlw <markw(at)mohawksoft(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL index usage discussion.
Date: 2002-04-25 07:39:12
Message-ID: 1019720352.6205.28.camel@taru.tm.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2002-04-25 at 00:46, mlw wrote:
> We have had several threads about index usage, specifically when PostgreSQL has
> the choice of using one or not.
>
> There seems to be a few points of view:
>
> (1) The planner and statistics need to improve, so that erroneously using an
> index (or not) happens less frequently or not at all.
>
> (2) Use programmatic hints which allow coders specify which indexes are used
> during a query. (ala Oracle)
>
> (3) It is pretty much OK as-is, just use enable_seqscan=false in the query.
>
> My point of view is about this subject is one from personal experience. I had a
> database on which PostgreSQL would always (erroneously) choose not to use an
> index. Are my experiences typical? Probably not, but are experiences like it
> very common?

I have currently 2 databases that run with enable_seqscan=false to avoid
choosing plans that take forever.

> I don't know, but we see a number "Why won't PostgreSQL use my
> index" messages to at least conclude that it happens every now and then. In my
> experience, when it happens, it is very frustrating.
>
> I think statement (1) is a good idea, but I think it is optimistic to expect
> that a statistical analysis of a table will contain enough information for all
> possible cases.

Perhaps we can come up with some special rules to avoid grossly pessimal
plans.

--------------------
Hannu

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Francois Suter 2002-04-25 07:47:49 pid gets overwritten in OSX
Previous Message Curt Sampson 2002-04-25 07:28:51 Re: Sequential Scan Read-Ahead