Robert Haas wrote:
Currently, use of window functions always forces sorting, ...
That's not strictly true, actually. No sort is done if the input happens
to be sorted already, as in:
postgres=# CREATE TABLE foo (id integer PRIMARY KEY);
NOTICE: CREATE TABLE / PRIMARY KEY will create implici
Section 7.2.4 of the docs, third paragraph, currently reads:
> Currently, use of window functions always forces sorting, and so the query
> output will be ordered according to one or another of the window functions'
> PARTITION BY/ORDER
> BY clauses. It is not recommendable to rely on this, howe