Re: Takes too long to fetch the data from database

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Takes too long to fetch the data from database
Дата
Msg-id b42b73150604200905h56a0d387xec8c80b4c8d3e901@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Takes too long to fetch the data from database  ("soni de" <soni.de@gmail.com>)
Ответы Re: Takes too long to fetch the data from database  ("soni de" <soni.de@gmail.com>)
Список pgsql-performance
> SELECT * FROM wan ORDER BY stime LIMIT 50 OFFSET 81900;

you need to try and solve the problem without using 'offset'.  you could do:
BEGIN;
DECLARE crs cursor FOR SELECT * FROM wan ORDER BY stime;
FETCH ABSOLUTE 81900 in crs;
FETCH 49 in crs;
CLOSE crs;
COMMIT;

this may be a bit faster but will not solve the fundamental problem.

the more interesting question is why you want to query exactly 81900
rows into a set.  This type of thinking will always get you into
trouble, absolute positioning will not really work in a true sql
sense.  if you are browsing a table sequentially, there are much
better methods.

merlin

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Performance decrease
Следующее
От: "Radovan Antloga"
Дата:
Сообщение: Re: Performance decrease