Re: Query Plan - Index Scan & Seq Scan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query Plan - Index Scan & Seq Scan
Дата
Msg-id 11484.1115925096@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Query Plan - Index Scan & Seq Scan  (Prasanth <dbadmin@nqadmin.com>)
Список pgsql-admin
Prasanth <dbadmin@nqadmin.com> writes:
> Seems like having int2 after code is doing the trick.
> Can you please explain the reasons behind this.

When you write "int2col > 2", the operator that is selected is int2-gt-int4.
However the index on an int2 column can only deal with int2-gt-int2.

8.0 generalized the index mechanism enough to allow int2 indexes to deal
with int2-gt-int4, but in earlier releases you have to take care to make
the constant an int2.

int8 columns have the same issue from the other direction ...

            regards, tom lane

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

Предыдущее
От: Postgres Admin
Дата:
Сообщение: ACT! and PostgreSQL
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: resource allocation ; postgresql-8.0