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

From: nconway(at)klamath(dot)dyndns(dot)org (Neil Conway)
To: Hans-Juergen Schoenig <hs(at)cybertec(dot)at>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL doesn't use indexes even is enable_seqscan = off
Date: 2002-07-08 18:21:13
Message-ID: 20020708182112.GB3358@klamath.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)rogers(dot)com>
PGP Key ID: DB3C29FC

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Neil Conway 2002-07-08 18:23:34 Re: Bug in 7.2.1? -- ERROR: Adding columns with defaults is not implemented.
Previous Message Bruce Momjian 2002-07-08 18:18:31 Re: Compile from cvs