Re: Index Scans become Seq Scans after VACUUM ANALYSE

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

Tom Lane wrote:
> 2. The tag approach presumes that the query programmer is smarter
> than the planner. This might be true under ideal circumstances,
> but I have a hard time crediting that the planner looking at today's
> stats is dumber than the junior programmer who left two years ago,
> and no one's updated his query since then. The planner may not be
> very bright, but it doesn't get bored, tired, or sick, nor move on
> to the next opportunity. It will pick the best plan it can on the
> basis of current statistics and the specific values appearing in
> the given query. Every time. A tag-forced query plan doesn't
> have that adaptability.

Add to this that hand tuning would happem mostly queries where the two
cost estimates are fairly close, and add the variability of a multi-user
environment, a hard-coded plan may turn out to be faster only some of
the time, and could change very quickly into something longer if the
table changes.

My point is that very close cases are the ones most likely to change
over time.

--
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 mlw 2002-04-18 14:06:30 Re: Index Scans become Seq Scans after VACUUM ANALYSE
Previous Message Bruce Momjian 2002-04-18 13:35:15 Re: Index Scans become Seq Scans after VACUUM ANALYSE