Re: Index Scans become Seq Scans after VACUUM ANALYSE - Mailing list pgsql-hackers

From Andrew Sullivan
Subject Re: Index Scans become Seq Scans after VACUUM ANALYSE
Date
Msg-id 20020417140858.M3933@mail.libertyrms.com
Whole thread Raw
In response to Re: Index Scans become Seq Scans after VACUUM ANALYSE  (mlw <markw@mohawksoft.com>)
List 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@libertyrms.info>                              M6K 3E3                                        +1 416 646 3304
x110



pgsql-hackers by date:

Previous
From: mlw
Date:
Subject: Re: Index Scans become Seq Scans after VACUUM ANALYSE
Next
From: Peter Eisentraut
Date:
Subject: Re: Index Scans become Seq Scans after VACUUM ANALYSE