From: Ivan Sergio Borgonovo <mail@webthatworks.it>
To: pgsql-sql@postgresql.org
Subject: Re: Obtaining a limited number of records from a long query
Date: Mon, 25 May 2009 16:56:17 +0200
Message-ID: <20090525165617.02d1658a@dawn.webthatworks.it> (raw)
In-Reply-To: <027f01c9dd44$054655e0$ec5a3d0a@marktestcr.marktest.pt>
References: <020201c9dd3d$372c3f40$ec5a3d0a@marktestcr.marktest.pt>
<4A1AA0FA.1070507@networkmail.eu>
<025501c9dd40$86155440$ec5a3d0a@marktestcr.marktest.pt>
<20090525161347.166789ac@dawn.webthatworks.it>
<027f01c9dd44$054655e0$ec5a3d0a@marktestcr.marktest.pt>
On Mon, 25 May 2009 15:20:57 +0100
"Oliveiros Cristina" <oliveiros.cristina@marktest.pt> wrote:
> Thank you for pointing it out, Ivan.
> The query I am trying to restrict output for happens to be an
> ORDER BY query.
> Actually I wasn't aware of this detail.
> I'll leave a mental note for myself that results might be
> unexpected for not ORDER BY queries
a bit more about "unexpected":
- if people insert other rows... and by chance they happen to fall
before the ones you already retrieved... no matter of the ORDER
BY, you may "miss" them in the "paginated result".
- without an order by there is no "granted" order. This is not a
deficiency of PostgreSQL, it is not mandated by sql standard and
it offers chances for optimisation
The fact that without an order by clause they may return in the same
order... is implementation dependent and Postgresql don't behave
that way or it happens just by chance.
--
Ivan Sergio Borgonovo
http://www.webthatworks.it
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: mail@webthatworks.it
Subject: Re: Obtaining a limited number of records from a long query
In-Reply-To: <20090525165617.02d1658a@dawn.webthatworks.it>
* 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