Re: From Simple to Complex

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: From Simple to Complex
Дата
Msg-id CAOR=d=3x8o1k+7-jKs_F20RR8FiUk=pdFZU7cg+CM=PJUwEJFg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: From Simple to Complex  (Alessandro Gagliardi <alessandro@path.com>)
Список pgsql-performance
On Wed, Feb 1, 2012 at 11:48 AM, Alessandro Gagliardi
<alessandro@path.com> wrote:
> LIMIT 65536; Total query runtime: 14846 ms.
> - http://explain.depesz.com/s/I3E
> LIMIT 69632: Total query runtime: 80141 ms.
> - http://explain.depesz.com/s/9hp
>
> So it looks like when the limit crosses a certain threshold (somewhere north
> of 2^16), Postgres decides to do a Seq Scan instead of an Index Scan.
> I've already lowered random_page_cost to 2. Maybe I should lower it to 1.5?
> Actually 60K should be plenty for my purposes anyway.

It's important to set random_page_cost according to more than just one
query, but yeah, at this point it's likely a good idea to set it
closer to 1.0.  You're on heroku right?  Something closer to 1.0 is
likely called for if so.  1.2 to 1.4 or so.

If you've got other queries you can test the change on all the better.

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

Предыдущее
От: Alessandro Gagliardi
Дата:
Сообщение: Re: From Simple to Complex
Следующее
От: Bob Lunney
Дата:
Сообщение: Re: From Simple to Complex