Re: BUG #14087: btree_gin index doesn't work on INT with POSITIVE constraint

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #14087: btree_gin index doesn't work on INT with POSITIVE constraint
Дата
Msg-id 30984.1460754556@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #14087: btree_gin index doesn't work on INT with POSITIVE constraint  (joris.vandyck@promani.be)
Список pgsql-bugs
joris.vandyck@promani.be writes:
> It seems like the choice between using the full index (first case with
> integer) or using the index partly and then filtering manually (second case
> with smallint) should not depend on whether the random_id is defined as
> integer or smallint.

The reason for the plan change is that if "random_id" is smallint, then
"random_id > 11422" is a cross-type operator (int2 > int4), and btree_gin
lacks support for such operators.  Fixing that is probably just a Small
Matter Of Programming, but I doubt it's very high on anyone's to-do list.
In the meantime, you might consider casting the comparison constant to
int2 explicitly if you want to make "random_id" be smallint; that is,
"random_id > 11422::smallint" would be indexable.

            regards, tom lane

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: BUG #14088: pg_restore, --schema, causes TOC entries from even executing.
Следующее
От: quassnoi@gmail.com
Дата:
Сообщение: BUG #14089: ON CONFLICT allows function variables in index expressions