Re: take my index, please - Mailing list pgsql-novice

From Tom Lane
Subject Re: take my index, please
Date
Msg-id 10085.988603130@sss.pgh.pa.us
Whole thread Raw
In response to take my index, please  (Lyn A Headley <laheadle@cs.uchicago.edu>)
List 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 by date:

Previous
From: Steve Waldman
Date:
Subject: Re: Attribute 'name' not found ERROR for postgres and java
Next
From: "J. Patrick Lanigan"
Date:
Subject: Include and lib dirs under RH7?