Re: Should we optimize the `ORDER BY random() LIMIT x` case? - Mailing list pgsql-hackers

From Nico Williams
Subject Re: Should we optimize the `ORDER BY random() LIMIT x` case?
Date
Msg-id aCtQa0CzPtHWolXH@ubby
Whole thread Raw
In response to Re: Should we optimize the `ORDER BY random() LIMIT x` case?  (Aleksander Alekseev <aleksander@timescale.com>)
List pgsql-hackers
On Mon, May 19, 2025 at 01:25:00PM +0300, Aleksander Alekseev wrote:
> I agree this would be most convenient for the user. Unfortunately this
> will require us to check every SELECT query: "oh, isn't it by any
> chance ORDER BY random() LIMIT x?". I don't think we can't afford such
> a performance degradation, even a small one, for an arguably rare
> case.

Can the detection of such queries be done by the yacc/bison parser
grammar?

Nico
-- 



pgsql-hackers by date:

Previous
From: Florents Tselai
Date:
Subject: Re: Proposal: Make cfbot fail on patches not created by "git format-patch"
Next
From: Jose Luis Tallon
Date:
Subject: Re: Violation of principle that plan trees are read-only