Re: take my index, please

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: take my index, please
Дата
Msg-id 10085.988603130@sss.pgh.pa.us
обсуждение исходный текст
Ответ на take my index, please  (Lyn A Headley <laheadle@cs.uchicago.edu>)
Список pgsql-novice
Lyn A Headley <laheadle@cs.uchicago.edu> writes:
>                   Table "allocation"
>    Attribute    |           Type           | Modifier
> ----------------+--------------------------+----------
>  allocation_oid | bigint                   | not null

> webco=# explain select * from allocation where allocation_oid = 5;
> NOTICE:  QUERY PLAN:

> Seq Scan on allocation  (cost=0.00..2295.79 rows=1 width=104)

Try

select * from allocation where allocation_oid = 5::int8;

As you wrote it, it's a cross-datatype operator (int8 vs int4)
and the planner is not very smart about those at the moment.

You should probably also ask yourself whether you *really* need int8
for this column, at least for the next release or two that it's likely
to be before something is done about this problem.

            regards, tom lane

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

Предыдущее
От: Steve Waldman
Дата:
Сообщение: Re: Attribute 'name' not found ERROR for postgres and java
Следующее
От: "J. Patrick Lanigan"
Дата:
Сообщение: Include and lib dirs under RH7?