index behavior question - multicolumn not consulted ?

Поиск
Список
Период
Сортировка
От Jonathan Vanasco
Тема index behavior question - multicolumn not consulted ?
Дата
Msg-id 708EF8C8-7ACD-44C6-B948-AF19CAE6B12A@2xlp.com
обсуждение исходный текст
Ответы Re: index behavior question - multicolumn not consulted ?  (John R Pierce <pierce@hogranch.com>)
Список pgsql-general
I have a table with over 1MM records and 15 columns.

I had created a "unique index" on a mix of two columns to enforce a constraint : (resource_type_id,
lower(archive_pathname))

i've noticed that searches never use this.  no matter what I query, even if it's only the columns in the index.  I'm
seeinga 550ms sequential scan on everything. 

If I create an index only on the text field: lower(archive_pathname) , all the queries use that and complete in 1.4ms

does anyone know why this happens ?

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

Предыдущее
От: Sergey Konoplev
Дата:
Сообщение: Re: Converting char to varchar automatically
Следующее
От: John R Pierce
Дата:
Сообщение: Re: index behavior question - multicolumn not consulted ?