Re: How do query optimizers affect window functions

Поиск
Список
Период
Сортировка
От Tianyin Xu
Тема Re: How do query optimizers affect window functions
Дата
Msg-id CABBDWwehiNbVwSDpYA4b4U-eKVXxoqUfGSVUW3MRm-O6WdZzCw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How do query optimizers affect window functions  (Jeff Janes <jeff.janes@gmail.com>)
Ответы Re: How do query optimizers affect window functions  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-general
Thanks a lot, Jeff!


On Wed, Nov 14, 2012 at 11:59 AM, Jeff Janes <jeff.janes@gmail.com> wrote:
On Wed, Nov 14, 2012 at 12:12 AM, Tianyin Xu <tixu@cs.ucsd.edu> wrote:
> Hi, Postgresql,
>
> I want to understand how the query optimizers affect the output of the
> window functions.

Use "EXPLAIN".

One is an index scan, one is a bitmap scan.  They return rows in a
different order.

..

> I don't understand why the results are different. Intuitively, the queries
> show return the same results no matter what plan the optimizer choose.

My intuition is that the query should refuse to run at all, because
the results are order dependent and you haven't specified an ordering.


What do you mean by "refused to run"? You mean we have to specify the order when using the window functions? Could you explain more?

Thanks!
 
Cheers,

Jeff



--
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/

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

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: High SYS CPU - need advise
Следующее
От: VB N
Дата:
Сообщение: Re: FATAL: index contains unexpected zero page at block