How to create index on only some of the rows

Поиск
Список
Период
Сортировка
От A B
Тема How to create index on only some of the rows
Дата
Msg-id AANLkTik2jC2fKzQXSNqkd6manZVp=aOrkfrUiSr1662O@mail.gmail.com
обсуждение исходный текст
Ответы Re: How to create index on only some of the rows  (Vibhor Kumar <vibhor.kumar@enterprisedb.com>)
Re: How to create index on only some of the rows  (Andrew Sullivan <ajs@crankycanuck.ca>)
Список pgsql-general
Hello.

How do you create an index for only some of the rows in a table? I
read in the docs:

 "The expression used in the WHERE clause can refer only to columns of
the underlying table, but it can use all columns, not just the ones
being indexed. Presently, subqueries and aggregate expressions are
also forbidden in WHERE. The same restrictions apply to index fields
that are expressions. "

So until this changes, can you just add a boolean field to tell if the
column should be used in the index, and then run  "create index ....
where use_in_index = true"  or are there other (better?) ways of doing
this?

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

Предыдущее
От: markw
Дата:
Сообщение: Re: Subquery for column names of tablefunc crosstab queries
Следующее
От: Andre Lopes
Дата:
Сообщение: Slow Inserts, two different scenarios.