Denis Gasparin <denis@edinet.it> writes:
> On table a (INTEGER datatype) the search is done using the index.
> Instead on table b (BIGINT datatype) the search is always done using the
> seq scan.
Try
select * from b where col1 = 123::int8;
The query planner is not presently very smart about cross-datatype
comparisons (int8 vs int4). We have a TODO item to fix this...
regards, tom lane