Re: correct example of a functional index usage?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: correct example of a functional index usage?
Дата
Msg-id 7057.1098457197@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: correct example of a functional index usage?  (Dennis Gearon <gearond@fireserve.net>)
Ответы Re: correct example of a functional index usage?
Список pgsql-general
Dennis Gearon <gearond@fireserve.net> writes:
> But it is possible to use multiple indexes on dates, and that is why the one at the bottom works, right?

No, it is possible to use multiple conditions that are relevant to a
single index.  A range query like "where x >= lobound and x <= hibound"
works very nicely with a btree index on x.  But "where x >= lobound and
y <= hibound" isn't a range query.

> Would a single index get used for

> SELECT appointment
> FROM the_table
> WHERE 0 <> (date_mask &&  date_range);

I don't see any indexable operator there at all.  You might care to read
http://developer.postgresql.org/docs/postgres/xindex.html
which describes the behaviors Postgres indexes have.

            regards, tom lane

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

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: Slony-I 1.0.4 Released
Следующее
От: Eric E
Дата:
Сообщение: PlPERL and shared libraries on Suse