Re: how to make this database / query faster

Поиск
Список
Период
Сортировка
От mark
Тема Re: how to make this database / query faster
Дата
Msg-id 82fa9e310803151641v64903e11o8c724368ee5bf831@mail.gmail.com
обсуждение исходный текст
Ответ на Re: how to make this database / query faster  ("Richard Broersma" <richard.broersma@gmail.com>)
Ответы Re: how to make this database / query faster
Список pgsql-general
On Sat, Mar 15, 2008 at 4:37 PM, Richard Broersma <richard.broersma@gmail.com> wrote:
On Sat, Mar 15, 2008 at 4:21 PM, mark <markkicks@gmail.com> wrote:
 
select * from users where session_key is not Null order by id offset OFFSET limit 300

One solution is to retain the last ID from the previous scan:
 
SELECT *
  FROM Users
 WHERE session_key IS NOT NULL
    AND id > your_last_id
  LIMIT 300;

will this ensure that no row is repeated when i itereate over the table? what are the rows ordered by?
thanks

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

Предыдущее
От: "Richard Broersma"
Дата:
Сообщение: Re: how to make this database / query faster
Следующее
От: "Richard Broersma"
Дата:
Сообщение: Re: how to make this database / query faster