Re: selects with large offset really slow

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: selects with large offset really slow
Дата
Msg-id 20030207161931.S62539-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на selects with large offset really slow  (John Smith <john_smith_45678@yahoo.com>)
Ответы Re: selects with large offset really slow
Список pgsql-general
On Thu, 6 Feb 2003, John Smith wrote:

>
> There are 90K-100K records in each of two tables. This simple join is
> really slow and the larger the offset, the longer it takes. Anything I
> can do to speed it up (a lot)? I've double-checked and there are
> indexes on everything used for joins and ordering.

>
> ############################
>
> explain analyze select l.id, l.url
> from links l
> inner join stats s
> on l.id = s.link_id
>  and s.referrer_id = 1
> order by l.url
> limit 100
> offset 90000;

Hmm, do you have an index on the combination of (url, id)?  I don't know
if that'd result in a better plan or not, but it may be able to use that
to help.


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: corruption bug in 7.2.3-RH
Следующее
От: John Smith
Дата:
Сообщение: Re: selects with large offset really slow