Re: Bug #848: Index on bigint column is unused in selects

From: Neil Conway <neilc(at)samurai(dot)com>
To: mathfox(at)xs4all(dot)nl, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug #848: Index on bigint column is unused in selects
Date: 2002-12-16 05:36:35
Message-ID: 1040016995.352.1.camel@tokyo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, 2002-12-14 at 15:33, pgsql-bugs(at)postgresql(dot)org wrote:
> PostgreSQL 7.2 will allways do a full table scan when the index field
> is a bigint. even with a "where bigkey = 99" clause.

This is a known problem: you need to enclose the integer literal in
single quotes, or cast it to int8 for the optimizer to consider an index
scan. i.e

select * from test1 where een = '99';

Cheers,

Neil

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Treat 2002-12-16 23:14:40 odd behavior: function not atomic/not seeing it's own updates/not acting serializable nor read committed
Previous Message Frank van Vugt 2002-12-15 11:02:40 v7.3 : \encoding doesn't show changes in client encoding that are not done with \encoding itself (i.e. set names/set client_encoding)