Re: Postgres performs a Seq Scan instead of an Index Scan! - Mailing list pgsql-hackers

From James Robinson
Subject Re: Postgres performs a Seq Scan instead of an Index Scan!
Date
Msg-id 534A925F-276B-11D9-BFDF-000A9566A412@socialserve.com
Whole thread Raw
In response to Postgres performs a Seq Scan instead of an Index Scan!  (Jos van Roosmalen <josr@josr.org>)
List pgsql-hackers
On Oct 26, 2004, at 12:12 PM, Jos van Roosmalen wrote:

> ATTR1 INT8

Looks like your column is int8, yet your query is sending in an int4. 
Therefore the index is not used. This is fixed in PG 8.0. In the mean 
time, you can:
SELECT * FROM TESTTABLE WHERE ATTR1=1::INT8 ...

which explicitly casts the literal int4 to an int8, making the int8 
column index useable.

----
James Robinson
Socialserve.com



pgsql-hackers by date:

Previous
From: Jos van Roosmalen
Date:
Subject: Postgres performs a Seq Scan instead of an Index Scan!
Next
From: Jochem van Dieten
Date:
Subject: Re: Postgres performs a Seq Scan instead of an Index Scan!