Re: Should we optimize the `ORDER BY random() LIMIT x` case?
От | Vik Fearing |
---|---|
Тема | Re: Should we optimize the `ORDER BY random() LIMIT x` case? |
Дата | |
Msg-id | 254d4733-29b6-4152-bd06-c292ee002790@postgresfriends.org обсуждение исходный текст |
Ответ на | Re: Should we optimize the `ORDER BY random() LIMIT x` case? (Aleksander Alekseev <aleksander@timescale.com>) |
Список | pgsql-hackers |
On 19/05/2025 12:25, Aleksander Alekseev wrote: > Tom, Nico, Vik, > >> TABLESAMPLE is hitched to a <table primary> which can be basically >> anything resembling a relation. So it appears the standard already >> allows this and we just need to implement it. > Vik, many thanks for sharing this. I don't have a strong opinion on > `FETCH SAMPLE FIRST 10 ROWS ONLY` but since TABLESAMPLE should / may > work for subqueries anyway we could focus on it for now. Yeah, putting this into <fetch first clause> was a dumb idea on my part, and Tom correctly corrected me. I do not yet have the required number of years in the sql standards studies to know the whole thing by heart. I think we (as a community) should work on expanding our <sample clause> to work with any <table primary> and not just a base table. Especially since we already have two existing extensions by Petr to the standard for that clause. We can easily make more, which might even make their way back into the standard. -- Vik Fearing
В списке pgsql-hackers по дате отправления: