Re: Improve "3.5. Window Functions" tutorial - Mailing list pgsql-docs

From Matemática A3K
Subject Re: Improve "3.5. Window Functions" tutorial
Date
Msg-id CA+FDnhJZRxdSEsJV1OpbCGAnJFYzLHy9HXvdbTWSv=3zuYH8tw@mail.gmail.com
Whole thread
In response to Re: Improve "3.5. Window Functions" tutorial  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-docs

On Fri, Oct 2, 2026 at 3:40 AM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Wednesday, September 30, 2026, PG Doc comments form <noreply@postgresql.org> wrote:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/18/tutorial-window.html
Description:

Hi! I would like to propose improvements on the "3.5. Window Functions"
tutorial.

Wording may be improved ("scoped"), I think the added paragraph links the
existing ones providing more meaning.

I’m in agreement with this page being in need of improvement.  I’m not all that comfortable with this particular proposal.  It adds some of its own concerns and doesn’t remove some existing ones.

OK
 
As an aside - recent comments about the undesirability were made - and while I’m accepting of their usage generally this one seems like a good candidate for removal if we do update this page.
 
My biggest qualm is the wording that makes it sound like a window frame is an option in lieu of looking at the partition when there is always some default frame in place.

"Window functions perform calculations on a subset of rows of a query for each row of it, That subset is called the window frame, and it is constructed on a per-row basis. The query rows are first partitioned with a provided criteria and may be refined further if the function supports it. After the determination of the subset (the window frame), calculations are performed on them and the result is provided for the row."

Do you think that is an accurate definition of window function? If so (or after the construction of it), the article should be adjusted to be built on that.

I find the article fuzzy about it. It goes with something like "After you define a partition, if you supply ORDER_BY, then the window is narrowed and can be controlled with... BUT this only works if function supports it" and after reading, I find it difficult to produce a precise idea of it.
 

David J.



On Fri, Oct 2, 2026 at 3:40 AM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Wednesday, September 30, 2026, PG Doc comments form <noreply@postgresql.org> wrote:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/18/tutorial-window.html
Description:

Hi! I would like to propose improvements on the "3.5. Window Functions"
tutorial.

Wording may be improved ("scoped"), I think the added paragraph links the
existing ones providing more meaning.

I’m in agreement with this page being in need of improvement.  I’m not all that comfortable with this particular proposal.  It adds some of its own concerns and doesn’t remove some existing ones.

As an aside - recent comments about the undesirability were made - and while I’m accepting of their usage generally this one seems like a good candidate for removal if we do update this page.

My biggest qualm is the wording that makes it sound like a window frame is an option in lieu of looking at the partition when there is always some default frame in place.

David J.

pgsql-docs by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Improve "3.6. Inheritance" tutorial
Next
From: Matemática A3K
Date:
Subject: Re: Improve "3.6. Inheritance" tutorial