pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Karsten Hilbert <Karsten.Hilbert@gmx.net>
To: Ruslan Zakirov <ruslan.zakirov@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Reproducing incorrect order with order by in a subquery
Date: Thu, 15 Jun 2023 20:15:46 +0200
Message-ID: <ZItVUvAFtq75Ts7o@hermes.hilbert.loc> (raw)
In-Reply-To: <CAMOxC8sx85u5=oA+U6VSDd0MR1o8sxMsv6gfHgyoraZkV+9BMA@mail.gmail.com>
References: <CAMOxC8tBBR8DK3c73zUWSWRzTPP2FHv5+sLFqL2ZWWwLqGmzhw@mail.gmail.com>
	<dd2f192c-2b90-2bb7-27b4-004af7e7e26a@gmx.net>
	<CAMOxC8tvSx1Dduu5CvBTZ3eZdNMyE9=S2PSiypWKafVaF=-9nQ@mail.gmail.com>
	<1635592.1686668813@sss.pgh.pa.us>
	<CAMOxC8s98-YJE=C2Rurvs_1Y_Uu8GQA+uAv02c+HvHXpv4WY6Q@mail.gmail.com>
	<CAMOxC8tXRR+LRkxWiiiXve9gKD16MjaAGNJDy6uB5henA7Wx-A@mail.gmail.com>
	<ZIm3g4yCK3nMCQYB@hermes.hilbert.loc>
	<CAMOxC8sx85u5=oA+U6VSDd0MR1o8sxMsv6gfHgyoraZkV+9BMA@mail.gmail.com>

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





view thread (11+ messages)

Message-ID: <ZItVUvAFtq75Ts7o@hermes.hilbert.loc>
Permalink:  ../ZItVUvAFtq75Ts7o@hermes.hilbert.loc/
Also on:    postgresql.org/message-id/ZItVUvAFtq75Ts7o@hermes.hilbert.loc

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: Karsten.Hilbert@gmx.net, ruslan.zakirov@gmail.com
  Subject: Re: Reproducing incorrect order with order by in a subquery
  In-Reply-To: <ZItVUvAFtq75Ts7o@hermes.hilbert.loc>
  References: <CAMOxC8tBBR8DK3c73zUWSWRzTPP2FHv5+sLFqL2ZWWwLqGmzhw@mail.gmail.com> <dd2f192c-2b90-2bb7-27b4-004af7e7e26a@gmx.net> <CAMOxC8tvSx1Dduu5CvBTZ3eZdNMyE9=S2PSiypWKafVaF=-9nQ@mail.gmail.com> <1635592.1686668813@sss.pgh.pa.us> <CAMOxC8s98-YJE=C2Rurvs_1Y_Uu8GQA+uAv02c+HvHXpv4WY6Q@mail.gmail.com> <CAMOxC8tXRR+LRkxWiiiXve9gKD16MjaAGNJDy6uB5henA7Wx-A@mail.gmail.com> <ZIm3g4yCK3nMCQYB@hermes.hilbert.loc> <CAMOxC8sx85u5=oA+U6VSDd0MR1o8sxMsv6gfHgyoraZkV+9BMA@mail.gmail.com> <ZItVUvAFtq75Ts7o@hermes.hilbert.loc>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox