Re: Obtaining a limited number of records from a long query - Mailing list pgsql-sql

From Ivan Sergio Borgonovo
Subject Re: Obtaining a limited number of records from a long query
Date
Msg-id 20090525165617.02d1658a@dawn.webthatworks.it
Whole thread Raw
In response to Re: Obtaining a limited number of records from a long query  ("Oliveiros Cristina" <oliveiros.cristina@marktest.pt>)
List pgsql-sql
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
ofthe 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
standardand 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



pgsql-sql by date:

Previous
From: "Oliveiros Cristina"
Date:
Subject: Re: Obtaining a limited number of records from a long query
Next
From: John Dizaro
Date:
Subject: Pgadmin hotkeys?