Is it an int8 column? If it is, you have to cast all raw numbers to
int8, or the optimizer won't catch that it can use the index.
For example, in perl
$dbh->prepare("select * from mytable where myinteger = ?::int8");
will be able to use the optimizer.
Jon
On Fri, 6 Jun 2003, Tom Lane wrote:
> nolan@celery.tssi.com writes:
> > Is there a documented problem with optimizing integer key fields
> > in 7.3.3?
>
> No. How about providing some more details, like EXPLAIN ANALYZE
> output? The given query plan looks reasonable if the planner's
> estimates are right ... but since you're complaining, I'd imagine
> they are not. (Also, I assume you've done an ANALYZE lately?)
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>