Re: Advice on optimizing select/index

Поиск
Список
Период
Сортировка
От Robert Klemme
Тема Re: Advice on optimizing select/index
Дата
Msg-id knsvg4$ldg$1@ger.gmane.org
обсуждение исходный текст
Ответ на Advice on optimizing select/index  (Niels Kristian Schjødt <nielskristian@autouncle.com>)
Список pgsql-performance
On 22.05.2013 16:37, Niels Kristian Schjødt wrote:

> In reality the adverts that are selected is all 'active'. I'm hence
> wondering if it theoretically (and in reality of cause) would make my
> query faster if I did something like:  "SELECT .* FROM cars LEFT
> OUTER JOIN adverts on cars.id = adverts.car_id WHERE cars.brand =
> 'Audi' AND adverts.state = 'active'" with a partial index on "INDEX
> adverts ON (car_id) WHERE state = 'active'"?

That sounds reasonable to do.  If you have enough bandwidth on your
production database why not just try it out?  Otherwise you could do
this on a test database and see how it goes and what plan you get.  Btw.
did you look at the original plan?

Cheers

    robert


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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: Reporting query failing
Следующее
От: John Mudd
Дата:
Сообщение: Slow SELECT by primary key? Postgres 9.1.2