pgsql: Order active window clauses for greater reuse of Sort nodes.

From: Andrew Gierth <rhodiumtoad(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Order active window clauses for greater reuse of Sort nodes.
Date: 2018-09-14 16:36:19
Message-ID: E1g0r4t-0005Ox-Hu@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Order active window clauses for greater reuse of Sort nodes.

By sorting the active window list lexicographically by the sort clause
list but putting longer clauses before shorter prefixes, we generate
more chances to elide Sort nodes when building the path.

Author: Daniel Gustafsson (with some editorialization by me)
Reviewed-by: Alexander Kuzmenkov, Masahiko Sawada, Tom Lane
Discussion: https://postgr.es/m/124A7F69-84CD-435B-BA0E-2695BE21E5C2%40yesql.se

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/728202b63cdcd7fb73fdba114903ed235eb02f3a

Modified Files
--------------
src/backend/nodes/list.c | 7 +-
src/backend/optimizer/plan/planner.c | 154 +++++++++++++++++++++++++----------
src/test/regress/expected/window.out | 60 +++++++++++---
src/test/regress/sql/window.sql | 16 ++++
4 files changed, 177 insertions(+), 60 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2018-09-14 17:25:38 pgsql: Fix ALTER/TYPE on columns referenced by FKs in partitioned table
Previous Message Alvaro Herrera 2018-09-14 15:35:54 Re: pgsql: Improve autovacuum logging for aggressive and anti-wraparound ru