Re: Index Scans become Seq Scans after VACUUM ANALYSE

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Index Scans become Seq Scans after VACUUM ANALYSE
Дата
Msg-id 200204181338.g3IDcgP27859@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Index Scans become Seq Scans after VACUUM ANALYSE  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Index Scans become Seq Scans after VACUUM ANALYSE
Следующее
От: Tom Lane
Дата:
Сообщение: Re: new food for the contrib/ directory