Re: Changed to: how to solve the get next 100 records problem

Поиск
Список
Период
Сортировка
От PFC
Тема Re: Changed to: how to solve the get next 100 records problem
Дата
Msg-id op.sqzfxct8th1vuj@localhost
обсуждение исходный текст
Ответ на Re: Does Postgresql have a similar pseudo-column "ROWNUM" as Oracle?  (Andrew Sullivan <ajs@crankycanuck.ca>)
Список pgsql-sql

> The only strange thing is that without the 3rd order by, the order is  
> wrong. I didn't expect it because each select is created ordered. Is it  
> expected that UNION mixes it all up? (using postgre 7.4.1)
That's because UNION removes duplicates, which it will probably doing  
using a hash (EXPLAIN ANALYZE is your friend).Use UNION ALL because your WHERE condition allows no duplicates anyway.

UNION ALL preserves the order.So you can get the LIMIT out of the subqueries and put it around the  
UNION ALL.


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Peter Bense"
Дата:
Сообщение: Help with views/rules...
Следующее
От: Ragnar Hafstað
Дата:
Сообщение: Re: Changed to: how to solve the get next 100 records problem