Re: selects with large offset really slow

Поиск
Список
Период
Сортировка
От Jean-Luc Lachance
Тема Re: selects with large offset really slow
Дата
Msg-id 3E4929BA.DEA46449@nsd.ca
обсуждение исходный текст
Ответ на Re: selects with large offset really slow  (John Smith <john_smith_45678@yahoo.com>)
Список pgsql-general
John,

CREATE TEMP TABLE results (
  ndx SERIAL,
  { plus all the fields you get from your query}
  );

INSERT INTO results( {all your fields except ndx})
  SELECT ...
  ;

then

select ... from results where dnx >= start limit 100;

JLL




John Smith wrote:

> how?
>
>  Jean-Luc Lachance <jllachan@nsd.ca> wrote:
>
>      Why don't you use a temp table with a serial field and use is instead of
>      offset?

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

Предыдущее
От: Phil Howard
Дата:
Сообщение: Re: starting out
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Is Hash Agg being used? 7.4 seems to handle this query worse than 7.3