Re: Index Scans become Seq Scans after VACUUM ANALYSE

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: mlw <markw(at)mohawksoft(dot)com>
Cc: Andrew Sullivan <andrew(at)libertyrms(dot)info>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Index Scans become Seq Scans after VACUUM ANALYSE
Date: 2002-04-17 22:04:09
Message-ID: 200204172204.g3HM49n08760@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

mlw wrote:
> Bruce Momjian wrote:
>
> >
> > OK, yes, sequential scan _can_ be as slow as index scan, but sometimes
> > it is faster. Can you provide reasoning why index scan should be
> > preferred, other than the admin created it, which I already addressed?
>
> If you have a choice between two or more sub-plans, similar in cost, say within
> 20% of one another. Choosing a plan which uses an index has a chance of
> improved performance if the estimates are wrong where as choosing the
> sequential scan will always have the full cost.

And the chance of reduced performance if the estimate was too low.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-04-17 22:05:54 Re: Index Scans become Seq Scans after VACUUM ANALYSE
Previous Message Dann Corbit 2002-04-17 22:03:25 Re: Index Scans become Seq Scans after VACUUM ANALYSE