Re: [GENERAL] Combining count() and row_number() as window functions - Mailing list pgsql-general

From Tom Lane
Subject Re: [GENERAL] Combining count() and row_number() as window functions
Date
Msg-id 16982.1484835633@sss.pgh.pa.us
Whole thread Raw
In response to [GENERAL] Combining count() and row_number() as window functions  (Thomas Kellerer <spam_eater@gmx.net>)
Responses Re: [GENERAL] Combining count() and row_number() as window functions  (Stephen Frost <sfrost@snowman.net>)
List pgsql-general
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


pgsql-general by date:

Previous
From: Kenneth Marshall
Date:
Subject: Re: [GENERAL] migrate Sql Server database to PostgreSql
Next
From: Merlin Moncure
Date:
Subject: Re: [GENERAL] Queries are taking way longer in 9.6 than 9.5