Re: Query palns and tug-of-war with enable_sort

Поиск
Список
Период
Сортировка
От Glyn Astill
Тема Re: Query palns and tug-of-war with enable_sort
Дата
Msg-id 236173.51954.qm@web23607.mail.ird.yahoo.com
обсуждение исходный текст
Ответ на Re: Query palns and tug-of-war with enable_sort  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Query palns and tug-of-war with enable_sort  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
>
> No, those aren't the same plans.  In particular
> what's bothering me is
> the lack of any sort in the first plan you showed (the one
> with
> HashAggregate at the top).  That shouldn't be possible
> because of the
> ORDER BY --- a hash aggregate will deliver unsorted output
> so there
> should be a sort step above it.

Ah, retracing my steps forget that; there's no sort because it's not the same query at all.

explain Select
   mult_ord.mult_ref
 From
   credit Inner Join
   mult_ord On mult_ord.transno = credit.transno
 Where
   (credit.show = 450000 Or
     credit.show = 450001) And
   credit."date" >= '2009-02-16' And
   credit."date" <= '2009-02-16' And
   credit.cancelled = ' ' group by mult_ref;


Lets just say it's been a long day.

Going back to my original point though, is there any way to get the planner to choose a better plan for the original
distinctquery? Or is it just a simple no because I set enable_sort to off? 




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

Предыдущее
От: Mike Christensen
Дата:
Сообщение: Re: Postgres service fails to start on Windows 2003
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Postgres service fails to start on Windows 2003