Re: Forcing postgresql to use an index

Поиск
Список
Период
Сортировка
От Eugene Morozov
Тема Re: Forcing postgresql to use an index
Дата
Msg-id 87iqfsadg2.fsf@eugenemorozov.name
обсуждение исходный текст
Ответ на Forcing postgresql to use an index  (Eugene Morozov <eugene@cactus-mouse.com>)
Список pgsql-performance
Scott Marlowe <scott.marlowe@gmail.com> writes:

> On Tue, Sep 8, 2009 at 8:12 AM, Eugene Morozov<eugene@cactus-mouse.com> wrote:
> OK, you need to look a little deeper at what's happening here.  The
> pgsql query planner looks at a lot of things to decide if to use seq
> scan or and index.  If you look at your row estimates versus actual
> rows returned, you'll see they're off, sometimes by quite a bit.
> Particularly the ones near the top of your query plans. There are a
> few things you can do to help out here.  Increase default stats target
> and re-analyse, increase effective_cache_size to reflect the actual
> size of data being cached by your OS / filesystem / pgsql, and then
> lowering random_page_cost.

Thanks to all who answered. Your answers were really helpful, I've
split the query in two (couldn't make Django to use JOIN here) and was
able to speed it up by a factor of 10!
Eugene

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

Предыдущее
От: Kevin Kempter
Дата:
Сообщение: partitioning max() sql not using index
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: partitioning max() sql not using index