Re: Query planner unaware of possibly best plan

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: Query planner unaware of possibly best plan
Дата
Msg-id 1190396973.4202.116.camel@ebony.site
обсуждение исходный текст
Ответ на Query planner unaware of possibly best plan  (Denes Daniel <panther-d@freemail.hu>)
Ответы Re: Query planner unaware of possibly best plan
Список pgsql-performance
On Fri, 2007-09-21 at 17:36 +0200, Denes Daniel wrote:

> Even though I forced the nested loop plan using both indexes (that
> returns the rows in the correct order), there is a needless sort step on
> the top, consuming half of the time even on such small tables.
> Now it's clear why the planner did not choose this plan, why I had to
> force it: because it isn't the best if the sort is still there.

Ordering by parent, child is fairly common but the variation you've got
here isn't that common. You'd need to make a case considering all the
alternatives; nobody will agree without a balanced case that includes
what is best for everyone.

Your EXPLAIN looks edited. Have you also edited the sort costs? They
look slightly higher than we might expect. Please provide the full
normal EXPLAIN output.

--
  Simon Riggs
  2ndQuadrant  http://www.2ndQuadrant.com


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Searching for the cause of a bad plan
Следующее
От: brauagustin-susc@yahoo.com.ar
Дата:
Сообщение: Re: Low CPU Usage