From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Teach planner about more monotonic window functions
Date: Fri, 27 Jan 2023 03:09:14 +0000
Message-ID: <E1pLF72-0007Dl-O6@gemulon.postgresql.org> (raw)
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(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: drowley@postgresql.org
Subject: Re: pgsql: Teach planner about more monotonic window functions
In-Reply-To: <E1pLF72-0007Dl-O6@gemulon.postgresql.org>
References: <E1pLF72-0007Dl-O6@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox