Re: seqscan instead of index scan

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: seqscan instead of index scan
Дата
Msg-id 873c24ics1.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: seqscan instead of index scan  (Martin Sarsale <martin@emepe3.net>)
Список pgsql-performance
Another option here is to use a partial index. You can index on some other
column -- perhaps the column you want the results ordered by where the where
clause is true.

Something like:

create index t_idx on t (name) where c>0 and d>0;

then any select with a matching where clause can use the index:

select * from t where c>0 and d>0 order by name

Could scan the index and not even have to sort on name.

--
greg

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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Why does a simple query not use an obvious index?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: seqscan instead of index scan