Re: PostgreSQL doesn't use indexes even is enable_seqscan = off - Mailing list pgsql-general

From nconway@klamath.dyndns.org (Neil Conway)
Subject Re: PostgreSQL doesn't use indexes even is enable_seqscan = off
Date
Msg-id 20020708182112.GB3358@klamath.dyndns.org
Whole thread Raw
In response to PostgreSQL doesn't use indexes even is enable_seqscan = off  (Hans-Juergen Schoenig <hs@cybertec.at>)
List pgsql-general
On Sun, Jul 07, 2002 at 10:48:51AM +0200, Hans-Juergen Schoenig wrote:
> cluster=# \d one
>          Table "one"
>  Column |  Type   | Modifiers
> --------+---------+-----------
>  id     | bigint  |
>  even   | boolean |
>  xmod   | integer |
> Indexes: idx_one_xmod
> Unique keys: idx_one_id

> cluster=# EXPLAIN SELECT * FROM one WHERE id=300000;
> NOTICE:  QUERY PLAN:
>
> Seq Scan on one  (cost=100000000.00..109434714.00 rows=1 width=13)

Use single quotes around the int8 literal -- i.e.

SELECT * FROM one WHERE id = '300000';

This is an FAQ.

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC



pgsql-general by date:

Previous
From: Christoph Dalitz
Date:
Subject: Re: Linux 7.1 dependency problems
Next
From: "João" Paulo Batistella
Date:
Subject: Select in update