index error

Started by Hao Heover 24 years ago2 messagesbugs
Jump to latest
#1Hao He
Hao.He@thomson.com.au

hi,

If you create a table with one of the columns defined as int8, then the
index created on this column does not work. When I use explain to see
the plan, it is always seq scan instead of index scan as one would expect.
Other types of columns work fine (int4, string ...).

Hao

Attachments:

InterScan_Disclaimer.txttext/plain; name=InterScan_Disclaimer.txtDownload
#2Stephan Szabo
sszabo@megazone23.bigpanda.com
In reply to: Hao He (#1)
Re: index error

On Thu, 6 Dec 2001, Hao He wrote:

hi,

If you create a table with one of the columns defined as int8, then the
index created on this column does not work. When I use explain to see
the plan, it is always seq scan instead of index scan as one would expect.
Other types of columns work fine (int4, string ...).

IIRC, you need to either single quote the number or explicitly cast it
into an int8 for the index to work in general, otherwise it prematurely
makes it an int4 and then doesn't use the index. There've been
discussions about this in the past that you can get from the archives
if you're interested.

(Info about this should probably be added to the FAQ if it's
not there, it's pretty F)