Re: PostgreSQL doesn't use indexes even is enable_seqscan = off

From: Richard Huxton <dev(at)archonet(dot)com>
To: Hans-Juergen Schoenig <hs(at)cybertec(dot)at>, pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL doesn't use indexes even is enable_seqscan = off
Date: 2002-07-08 16:39:41
Message-ID: 200207081739.41553.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-07-08 16:40:35 Re: WAL recycling, ext3, Linux 2.4.18
Previous Message Doug Fields 2002-07-08 16:20:32 Re: WAL recycling, ext3, Linux 2.4.18