New Window Function: ROW_NUMBER_DESC() OVER() ? - Mailing list pgsql-hackers

From David G. Johnston
Subject New Window Function: ROW_NUMBER_DESC() OVER() ?
Date
Msg-id CAKFQuwbciBQz-duy2q2Rxfi45zdEk+7A6V8748wyZ+5p-DU6Qw@mail.gmail.com
Whole thread Raw
In response to RE: New Window Function: ROW_NUMBER_DESC() OVER() ?  (Maiquel Grassi <grassi@hotmail.com.br>)
Responses RE: New Window Function: ROW_NUMBER_DESC() OVER() ?
List pgsql-hackers
On Tuesday, January 16, 2024, Maiquel Grassi <grassi@hotmail.com.br> wrote:
Hi,

Count() over() - row_number() over()
  
   But if my dataset is significantly large? Wouldn't calling two window functions instead of one be much slower?
   Is count() over() - row_number() over() faster than row_number_desc() over()?


I doubt it is materially different, you need that count regardless so the effort is expended no matter if you put it in an SQL expression or build it into the window function.  But as you are the one arguing for the new feature demonstrating that the status quo is deficient is your job.

David J.

pgsql-hackers by date:

Previous
From: Maiquel Grassi
Date:
Subject: RE: New Window Function: ROW_NUMBER_DESC() OVER() ?
Next
From: Alexander Lakhin
Date:
Subject: Re: Build-farm - intermittent error in 031_column_list.pl