On Thu, Mar 27, 2025 at 12:37 PM Robert Haas <robertmh...@gmail.com> wrote: > It's not a problem if UNION ALL is used within the initial_query and > it's not a problem if UNION ALL is used within the iterated_query. But > you can't apply ORDER BY to the result of the UNION, because the UNION > is kind of fake -- we're not running the UNION as a single query, > we're running the two halves separately, the first once and the second > as many times as needed.
Oops. The two UNION ALL references in the first part of this paragraph should have said ORDER BY. -- Robert Haas EDB: http://www.enterprisedb.com