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

Daniel Gustafsson <daniel@yesql.se>

From: Daniel Gustafsson <daniel@yesql.se>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Masahiko Sawada <sawada.mshk@gmail.com>, Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2018-09-14T11:34:22Z
Lists: pgsql-hackers
> On 13 Sep 2018, at 19:50, Andrew Gierth <andrew@tao11.riddles.org.uk> wrote:
> 
> Here's what I have queued up to push.

LGTM, thanks!

> +	 * framing clauses differ), then all peer rows must be presented in the
> +	 * same order in all of them. If we allowed multiple sort nodes for such

Should probably be capitalized as "Sort nodes” to match the rest of the comment.

cheers ./daniel

Commits

  1. Order active window clauses for greater reuse of Sort nodes.