Re: Index Scans become Seq Scans after VACUUM ANALYSE

From: Andrew Sullivan <andrew(at)libertyrms(dot)info>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Index Scans become Seq Scans after VACUUM ANALYSE
Date: 2002-04-17 18:08:58
Message-ID: 20020417140858.M3933@mail.libertyrms.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 17, 2002 at 12:35:13PM -0400, mlw wrote:

> about a 10 vs 8 second difference. I have seen many instances of when
> PostgreSQL refuses to use an index because the data distribution is uneven.
> Making it more difficult for the planer to ignore an index would solve
> practically all the problems I have seen, and I bet the range of instances
> where it would incorrectly use an index would not impact performance as badly
> as those instances where it doesn't.

You bet, eh? Numbers, please.

The best evidence that anyone has been able to generate is _already_
the basis for the choices the planner makes. If you can come up with
other cases where it consistently makes the wrong choice, good:
that's data to work with. Maybe it'll expose whatever it is that's
wrong. But it is not a general case, anyway, so you can't draw any
conclusion at all about other cases from your case. And Tom Lane is
right: the repair is _not_ to use some rule of thumb that an index is
probably there for a reason.

Given the apparent infrequency of docs-consultation, I am
considerably less sanguine than you are about the correctness of the
choices many DBAs make. Poking at the planner to make it use an
index more often strikes me as at least as likely to cause worse
performance.

> I don't think you can solve this with statistics. It is a far more
> complex problem than that.

Aw, you just need to take more stats courses ;)

A
--
----
Andrew Sullivan 87 Mowat Avenue
Liberty RMS Toronto, Ontario Canada
<andrew(at)libertyrms(dot)info> M6K 3E3
+1 416 646 3304 x110

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Meskes 2002-04-17 18:26:56 Bison grammer
Previous Message mlw 2002-04-17 17:49:16 Re: Index Scans become Seq Scans after VACUUM ANALYSE