Re: A performance issue in ROW_NUMBER() OVER(ORDER BY NULL) [27 times slow than OVER()] V14.5 - Mailing list pgsql-general

From Tom Lane
Subject Re: A performance issue in ROW_NUMBER() OVER(ORDER BY NULL) [27 times slow than OVER()] V14.5
Date
Msg-id 3330162.1676841487@sss.pgh.pa.us
Whole thread Raw
In response to A performance issue in ROW_NUMBER() OVER(ORDER BY NULL) [27 times slow than OVER()] V14.5  (Kirk Wolak <wolakk@gmail.com>)
Responses Re: A performance issue in ROW_NUMBER() OVER(ORDER BY NULL) [27 times slow than OVER()] V14.5  (David Rowley <dgrowleyml@gmail.com>)
Re: A performance issue in ROW_NUMBER() OVER(ORDER BY NULL) [27 times slow than OVER()] V14.5  (Kirk Wolak <wolakk@gmail.com>)
List pgsql-general
Kirk Wolak <wolakk@gmail.com> writes:
>   I have some converted code that uses this syntax.

Seems kinda dumb, but ...

>   The solution is to remove the ORDER BY NULL.  [since that is not
> sortable, should it be ignored?]
>   This does NOT SHOW UP with 1 million rows.

I don't see it at all.  Comparing your two test queries on released
branches, I see maybe 2x penalty for the ORDER BY NULL, not 30x.
(In HEAD there's only about 13% penalty.)  I wonder what PG version
you are testing.

            regards, tom lane



pgsql-general by date:

Previous
From: Kirk Wolak
Date:
Subject: A performance issue in ROW_NUMBER() OVER(ORDER BY NULL) [27 times slow than OVER()] V14.5
Next
From: David Rowley
Date:
Subject: Re: A performance issue in ROW_NUMBER() OVER(ORDER BY NULL) [27 times slow than OVER()] V14.5