Re: Reproducing incorrect order with order by in a subquery

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: Ruslan Zakirov <ruslan(dot)zakirov(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Reproducing incorrect order with order by in a subquery
Date: 2023-06-15 18:15:46
Message-ID: ZItVUvAFtq75Ts7o@hermes.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Am Thu, Jun 15, 2023 at 12:58:55AM +0300 schrieb Ruslan Zakirov:

e.g.

> https://mariadb.com/kb/en/why-is-order-by-in-a-from-subquery-ignored/

...

> My goal was to find a small dataset that demonstrates this ordering
> mismatch.

I attempted to think it through whether it is even *possible*
to find a dataset (of any size) which *reliably* demonstrates
the ordering mismatch.

To my understanding -- since the outer query *can* (per
happenstance) return rows in the order of the subquery's
ORDER BY it is not possible to reliably demonstrate that it
won't, is it ?

Karsten
--
GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brainmue 2023-06-16 09:40:34 Question: Multiple pg clusters on one server can be reached with the standard port.
Previous Message Ruslan Zakirov 2023-06-14 23:00:12 Re: Helping planner to chose sequential scan when it improves performance