Re: Planner picks the wrong plan?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Planner picks the wrong plan?
Дата
Msg-id 20687.1097033396@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Planner picks the wrong plan?  (Nichlas Löfdahl <crotalus@acc.umu.se>)
Список pgsql-performance
Nichlas =?iso-8859-1?Q?L=F6fdahl?= <crotalus@acc.umu.se> writes:
> My question is, why doesn't the planner pick the same plan for Q1 & Q3?

I think it's mostly that after you've added and ANALYZEd the "age"
column, the planner has a pretty good idea of how many rows will pass
the "age > 17 AND age < 20" condition.  It can't do very much with the
equivalent condition in the original form, though, and in fact ends up
drastically underestimating the number of matching rows (86 vs reality
of 3021).  That leads directly to a bad plan choice :-(

            regards, tom lane

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

Предыдущее
От: Max Baker
Дата:
Сообщение: test post
Следующее
От: Alan Stange
Дата:
Сообщение: Re: Excessive context switching on SMP Xeons