Re: Query planner is using wrong index.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query planner is using wrong index.
Дата
Msg-id 3544.1144379836@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Query planner is using wrong index.  (Brian Herlihy <btherl@yahoo.com.au>)
Ответы Re: Query planner is using wrong index.  (Brian Herlihy <btherl@yahoo.com.au>)
Список pgsql-performance
Brian Herlihy <btherl@yahoo.com.au> writes:
> My options seem to be
>   - Fudge the analysis results so that the selectivity estimate changes.  I
> have tested reducing n_distinct, but this doesn't seem to help.
>   - Combine the columns into one column, allowing postgres to calculate the
> combined selectivity.
>   - Drop the (p2, p3) index.  But I need this for other queries.

Have you considered reordering the pkey to be (p2,p3,p1) and then
dropping the (p2,p3) index?

            regards, tom lane

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

Предыдущее
От: Brian Herlihy
Дата:
Сообщение: Re: Query planner is using wrong index.
Следующее
От: Brian Herlihy
Дата:
Сообщение: Re: Query planner is using wrong index.