Thomas Kellerer <spam_eater@xxxxxxx> writes: > I assumed that the count() wouldn't increase the runtime of the query as the result of the row_number() can be used to calculate 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 -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general