On Sunday 07 Jul 2002 9:48 am, Hans-Juergen Schoenig wrote:
> The index was created properly but somehow it isn't used:
>
> cluster=# \d one
> Table "one"
> Column | Type | Modifiers
> --------+---------+-----------
> id | bigint |
> even | boolean |
> xmod | integer |
> Indexes: idx_one_xmod
> Unique keys: idx_one_id
>
> cluster=# SET enable_seqscan TO off;
> SET VARIABLE
> cluster=# SELECT * FROM one WHERE id=300000;
try... WHERE id=300000::bigint
or... WHERE id='300000'
Postgres thinks the 300000 is of type int then fails to find an index of that
type.
Search the archives for "bigint" and "index" for loads on this.
- Richard Huxton