Re: Order by (for 15 rows) adds 30 seconds to query time

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Order by (for 15 rows) adds 30 seconds to query time
Дата
Msg-id 4B1522CE020000250002CEB1@gw.wicourts.gov
обсуждение исходный текст
Ответ на Order by (for 15 rows) adds 30 seconds to query time  (Richard Neill <rn214@cam.ac.uk>)
Список pgsql-performance
Richard Neill <rn214@cam.ac.uk> wrote:

> I'd expect the ORDER BY to be the last thing that runs

>   Nested Loop Left Join  (cost=0.00..727737158.77
> rows=806903677108 width=195) (actual time=31739.052..32862.322
> rows=15 loops=1)

It probably would if it knew there were going to be 15 rows to sort.
It is estimating that there will be 806,903,677,108 rows, in which
case it thinks that using the index will be faster.  The question is
why it's 10 or 11 orders of magnitude off on the estimate of result
rows.  Could you show us the table definitions underlying that view?

-Kevin

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

Предыдущее
От: Richard Neill
Дата:
Сообщение: Order by (for 15 rows) adds 30 seconds to query time
Следующее
От: Jean-Michel Pouré
Дата:
Сообщение: Re: Order by (for 15 rows) adds 30 seconds to query time