Re: Tuning to speed select

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Tuning to speed select
Дата
Msg-id 16115.1155225263@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Tuning to speed select  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-general
Michael Fuhr <mike@fuhr.org> writes:
> Excerpt from the 8.1 Release Notes:
>   * Allow nonconsecutive index columns to be used in a multicolumn
>     index (Tom)

>     For example, this allows an index on columns a,b,c to be used in
>     a query with WHERE a = 4 and c = 10.

> If you're querying only on c then an index on (a,b,c) will probably
> be slower than an index on (c), but if you have only (a,b,c) then
> the planner will consider using it.

Note that if your query doesn't have a constraint on the first index
column, it's unlikely that that index will get chosen, because the
entire index would have to be scanned.  Before 8.1 it was guaranteed
not to be chosen.

            regards, tom lane

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

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: Tuning to speed select
Следующее
От: "Harpreet Dhaliwal"
Дата:
Сообщение: Re: Connection string