pgsql: Teach planner about more monotonic window functions

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Teach planner about more monotonic window functions
Date: 2023-01-27 03:09:14
Message-ID: E1pLF72-0007Dl-O6@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Teach planner about more monotonic window functions

9d9c02ccd introduced runConditions for window functions to allow
monotonic window function evaluation to be made more efficient when the
window function value went beyond some value that it would never go back
from due to its monotonic nature. That commit added prosupport functions
to inform the planner that row_number(), rank(), dense_rank() and some
forms of count(*) were monotonic. Here we add support for ntile(),
cume_dist() and percent_rank().

Reviewed-by: Melanie Plageman
Discussion: https://postgr.es/m/CAApHDvqR+VqB8s+xR-24bzJbU8xyFrBszJ17qKgECf7cWxLCaA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/456fa635a909ee36f73ca84d340521bd730f265f

Modified Files
--------------
src/backend/utils/adt/windowfuncs.c | 30 ++++++++++++++++++++++++++++++
src/test/regress/expected/window.out | 26 ++++++++++++++------------
src/test/regress/sql/window.sql | 10 ++++++----
3 files changed, 50 insertions(+), 16 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2023-01-27 03:18:19 Re: pgsql: Adjust interaction of CREATEROLE with role properties.
Previous Message Michael Paquier 2023-01-27 03:06:02 Re: pgsql: Adjust interaction of CREATEROLE with role properties.