pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Venkatesan, Sekhar <sekhar.venkatesan@emc.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: Question on PostgreSQL DB behavior w.r.t JOIN and sort order.
Date: Tue, 9 Feb 2016 05:48:32 +0000
Message-ID: <F84DE43FDACD4C45AA84E2DA016FAE2F1C65BF07@MX105CL01.corp.emc.com> (raw)
In-Reply-To: <CAKFQuwbye-t24D59BUR05YyUtuaiFgCQWHMVq6qcz0axsKrT=A@mail.gmail.com>
References: <F84DE43FDACD4C45AA84E2DA016FAE2F1C65BE54@MX105CL01.corp.emc.com>
	<21082.1454994009@sss.pgh.pa.us>
	<F84DE43FDACD4C45AA84E2DA016FAE2F1C65BEC8@MX105CL01.corp.emc.com>
	<CAKFQuwbye-t24D59BUR05YyUtuaiFgCQWHMVq6qcz0axsKrT=A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

Is there a way to tell the optimizer to retain the sort order if that is possible please?

From: David G. Johnston [mailto:david.g.johnston@gmail.com]
Sent: Tuesday, February 09, 2016 11:17 AM
To: Venkatesan, Sekhar
Cc: Tom Lane; pgsql-sql@postgresql.org
Subject: Re: [SQL] Question on PostgreSQL DB behavior w.r.t JOIN and sort order.

On Monday, February 8, 2016, Venkatesan, Sekhar <sekhar.venkatesan@emc.com<mailto:sekhar.venkatesan@emc.com>> wrote:

So from what I understand, you say in postgres, if the sort order is not specified, postgres returns results in any order. Am I right?
Yes.  It will optimize for speed without any regard for maintaining any kind of ordering.  You may get the desired order for various reasons but without ORDER BY you cannot be guaranteed.

David J.


view thread (17+ messages)  latest in thread

Message-ID: <F84DE43FDACD4C45AA84E2DA016FAE2F1C65BF07@MX105CL01.corp.emc.com>
Permalink:  ../F84DE43FDACD4C45AA84E2DA016FAE2F1C65BF07@MX105CL01.corp.emc.com/
Also on:    postgresql.org/message-id/F84DE43FDACD4C45AA84E2DA016FAE2F1C65BF07@MX105CL01.corp.emc.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sekhar.venkatesan@emc.com, david.g.johnston@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: Question on PostgreSQL DB behavior w.r.t JOIN and sort order.
  In-Reply-To: <F84DE43FDACD4C45AA84E2DA016FAE2F1C65BF07@MX105CL01.corp.emc.com>

* 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