Re: [SQL] OFFSET impact on Performance???

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: [SQL] OFFSET impact on Performance???
Дата
Msg-id 6EE64EF3AB31D5448D0007DD34EEB3412A75C8@Herge.rcsinc.local
обсуждение исходный текст
Список pgsql-performance
> this will only work unchanged if the index is unique. imagine , for
> example if you have more than 50 rows with the same value of col.
>
> one way to fix this is to use ORDER BY col,oid

nope!  oid is
1. deprecated
2. not guaranteed to be unique even inside a (large) table.

Use a sequence instead.

create view a_b as
    select nextval('some_sequnce')::k, a.*, b.* from a, b [...]


select * from a_b where k > k1 order by k limit 1000
*or*
execute fetch_a_b(k1, 1000) <-- pass limit into prepared statement for extra flexibility.


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

Предыдущее
От: Darcy Buskermolen
Дата:
Сообщение: Re: PostgreSQL clustering VS MySQL clustering
Следующее
От: Steve Wampler
Дата:
Сообщение: Re: PostgreSQL clustering VS MySQL clustering