Re: Index + mismatching datatypes [WAS: index on custom

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: Index + mismatching datatypes [WAS: index on custom
Дата
Msg-id 1131396357.6884.110.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Index + mismatching datatypes [WAS: index on custom function; explain]  (Enrico Weigelt <weigelt@metux.de>)
Список pgsql-performance
On Mon, 2005-07-11 at 19:07 +0100, Enrico Weigelt wrote:
> I've got a similar problem: I have to match different datatypes,
> ie. bigint vs. integer vs. oid.
>
> Of course I tried to use casted index (aka ON (foo::oid)), but
> it didn't work.

Don't include the cast in the index definition, include it in the query
itself:

    SELECT ... FROM foo WHERE int8col = 5::int8

for example. Alternatively, upgrade to 8.0 or better, which doesn't
require this workaround.

-Neil



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

Предыдущее
От: Enrico Weigelt
Дата:
Сообщение: Index + mismatching datatypes [WAS: index on custom function; explain]
Следующее
От: Ralph Mason
Дата:
Сообщение: Figuring out which command failed