Thomas Kellerer <spam_eater@gmx.net> writes:
> I assumed that the count() wouldn't increase the runtime of the query as the result of the row_number() can be used
tocalculate that.
No such knowledge exists in Postgres. Given our general approach in which
functions (including window functions) are black boxes, it's hard to see
how it could be done in a way that wasn't a ugly kluge.
regards, tom lane