Re: Avoid extra Sort nodes between WindowAggs when sorting can be reused

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: Alexander Kuzmenkov <a(dot)kuzmenkov(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Avoid extra Sort nodes between WindowAggs when sorting can be reused
Date: 2018-07-02 21:19:16
Message-ID: AC8E7898-F5FD-431B-B1DF-5FBD0B9538E3@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 2 Jul 2018, at 14:01, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:

> Thank you for updating the patch! There are two review comments.

Thanks for reviewing!

> The current select_active_windows() function compares the all fields
> of WindowClause for the sorting but with this patch we compare only
> tleSortGroupRef, sortop and the number of uniqueOrder. I think this
> leads a degradation as follows.

You are right, that was an oversight. The attached patch takes a stab at
fixing this.

> s/readibility/readability/

Fixed.

cheers ./daniel

Attachment Content-Type Size
window_prefix_sort-v4.patch application/octet-stream 10.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-07-02 21:25:54 Re: Unexpected behavior of DROP VIEW/TABLE IF EXISTS
Previous Message Andrew Gierth 2018-07-02 21:05:27 Re: Should contrib modules install .h files?