Re: Tuning to speed select

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Tuning to speed select
Дата
Msg-id 20060810153452.GA17065@winnie.fuhr.org
обсуждение исходный текст
Ответ на Re: Tuning to speed select  (Tom Laudeman <twl8n@virginia.edu>)
Ответы Re: Tuning to speed select  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Thu, Aug 10, 2006 at 11:00:00AM -0400, Tom Laudeman wrote:
> As far as I can tell (from running actual tests) Postgres will not use a
> multi-column index when the SELECT is constraining on only one of the
> columns in the index.

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.

--
Michael Fuhr

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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: CURRENT_TIMESTAMP wierd behaviour
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Tuning to speed select