Re: BIGINT datatype and Indexes Failure - Mailing list pgsql-general

From Tom Lane
Subject Re: BIGINT datatype and Indexes Failure
Date
Msg-id 3038.998661052@sss.pgh.pa.us
Whole thread Raw
In response to BIGINT datatype and Indexes Failure  (Denis Gasparin <denis@edinet.it>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re:
Next
From: Stephan Bergmann
Date:
Subject: libpq