Re: Using bigint needs explicit cast to use the index - Mailing list pgsql-performance

From Neil Conway
Subject Re: Using bigint needs explicit cast to use the index
Date
Msg-id 404BC1CE.3040009@samurai.com
Whole thread Raw
In response to Using bigint needs explicit cast to use the index  ("Steven Butler" <stevenb@kjross.com.au>)
List pgsql-performance
Steven Butler wrote:
> I've recently converted a database to use bigint for the indices.  Suddenly
> simple queries like
>
> select * from new_test_result where parent_id = 2
>
> are doing full table scans instead of using the index.

This is fixed in CVS HEAD. In the mean time, you can enclose the
integer literal in single quotes, or explicitely cast it to the type
of the column.

FWIW, this is an FAQ.

-Neil

pgsql-performance by date:

Previous
From: "Steven Butler"
Date:
Subject: Using bigint needs explicit cast to use the index
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: speeding up a select with C function?