Re: How do query optimizers affect window functions

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Tianyin Xu <tixu(at)cs(dot)ucsd(dot)edu>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How do query optimizers affect window functions
Date: 2012-11-14 19:59:29
Message-ID: CAMkU=1xe8waKiFLv-8VSKYvzCF3oY4WkBvaxY1v1GyY+s_Zg9w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Nov 14, 2012 at 12:12 AM, Tianyin Xu <tixu(at)cs(dot)ucsd(dot)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.

Cheers,

Jeff

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrus 2012-11-14 21:02:33 Finding first free time from reservations table
Previous Message Steve Crawford 2012-11-14 19:52:53 Re: Using Postgresql 9.2 on windows 7 and windows vista