Re: Planner hints in Postgresql

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: Planner hints in Postgresql
Дата
Msg-id 53277369.3060405@nasby.net
обсуждение исходный текст
Ответ на Re: Planner hints in Postgresql  (Claudio Freire <klaussfreire@gmail.com>)
Ответы Re: Planner hints in Postgresql  (Claudio Freire <klaussfreire@gmail.com>)
Список pgsql-hackers
On 3/17/14, 5:07 PM, Claudio Freire wrote:
>
> On Mon, Mar 17, 2014 at 7:01 PM, Jim Nasby <jim@nasby.net <mailto:jim@nasby.net>> wrote:
>
>     Even better would be if the planner could estimate how bad a plan will become if we made assumptions that turn
outto be wrong.
 
>
>
> That's precisely what risk estimation was about.
>
> Something like
>
> SELECT * FROM wherever WHEN id > something LIMIT COST 10000;
>
> Would forbid a sequential scan *if* the table is big enough to suspect the plan might take that much, or a nested
loop*if* the planner cannot *prove* it will be faster than that.
 
>
> I don't believe the limit unit is obscure at all (page fetches being a nice measuring stick), but what is, is what do
youdo when no plan fits the limits.
 

I don't think that's the same thing... what you're describing is a way to not begin a query if a low-enough cost plan
can'tbe found.
 

What I'm talking about is when the planner picks one low-cost plan over another and it turns out the estimate of the
onethat was picked was WAY off. I've actually seen cases where plan estimates that were off by just 100 units produce
wildlydifferent results.
 

In that scenario, LIMIT COST won't help at all.
-- 
Jim C. Nasby, Data Architect                       jim@nasby.net
512.569.9461 (cell)                         http://jim.nasby.net



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

Предыдущее
От: Claudio Freire
Дата:
Сообщение: Re: Planner hints in Postgresql
Следующее
От: Jim Nasby
Дата:
Сообщение: Re: Planner hints in Postgresql