Search Postgresql Archives

Re: limit-offset different result sets with same query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Emanuel Calvo Franco wrote:
>
> Executing 'select * from datos limit 1 offset 150000' two times i have different
> result sets.
> When  i execute 'explain analyze verbose <query>' i see that (as
> expected) the seq scan
> is occurring.
>
>
> That's correct? Is logical that if the scan is sequential in the
> physical table returns differents
> data?
>
> I test it on 8.4 beta1 and 8.3.5 and 8.3.7 with the same results.
>
> Thanks in advance.
>


Emanuel,
LIMIT and OFFSET are stable only when you have "ORDER BY" on unique
values.  Without that, the database is free to return the rows in
whatever order it deems best, which gives unpredictable results when
combined with LIMIT/OFFSET.

Adam


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux