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

From Tom Lane
Subject Re: Should we optimize the `ORDER BY random() LIMIT x` case?
Date
Msg-id 17107.1747400510@sss.pgh.pa.us
Whole thread Raw
In response to Should we optimize the `ORDER BY random() LIMIT x` case?  (Aleksander Alekseev <aleksander@timescale.com>)
Responses Re: Should we optimize the `ORDER BY random() LIMIT x` case?
Re: Should we optimize the `ORDER BY random() LIMIT x` case?
List pgsql-hackers
Aleksander Alekseev <aleksander@timescale.com> writes:
> If I'm right about the limitations of aggregate functions and SRFs
> this leaves us the following options:

> 1. Changing the constraints of aggregate functions or SRFs. However I
> don't think we want to do it for such a single niche scenario.
> 2. Custom syntax and a custom node.
> 3. To give up

Seems to me the obvious answer is to extend TABLESAMPLE (or at least, some
of the tablesample methods) to allow it to work on a subquery.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Conflict detection for update_deleted in logical replication
Next
From: Daniel Gustafsson
Date:
Subject: Align wording on copyright organization