Re: Bug #790: Optimizer does not want to use an index for large table

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bug #790: Optimizer does not want to use an index for large table
Дата
Msg-id 10878.1033312182@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Bug #790: Optimizer does not want to use an index for large table  (pgsql-bugs@postgresql.org)
Список pgsql-bugs
pgsql-bugs@postgresql.org writes:
> CREATE TABLE obj_props(obj_id int8,name text,value text);
                         ^^^^^^^^^^^

You need an explicit cast, like this:

EXPLAIN SELECT name,value FROM obj_props WHERE obj_id = 100::int8;

because the planner is not smart about converting cross-datatype
comparisons into indexscans, and unadorned "100" is taken as int4.

I think we will finally have a fix for this in 7.4.

            regards, tom lane

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

Предыдущее
От: Rod Taylor
Дата:
Сообщение: Re: Bug #790: Optimizer does not want to use an index for
Следующее
От: "Tim Knowles"
Дата:
Сообщение: Bug #785: 7.3b2 : Possible Inconsistency with DROP INDEX ... CASCADE and DROP CONSTRAINT