Re: Query planner isn't using my indices

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Alaric B(dot) Snell" <abs(at)frontwire(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Query planner isn't using my indices
Date: 2002-01-08 23:16:35
Message-ID: 23346.1010531795@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Alaric B. Snell" <abs(at)frontwire(dot)com> writes:
> frontwire=# \d stakeholder_pk
> Index "stakeholder_pk"
> Attribute | Type
> -----------+--------
> id | bigint
> unique btree

> frontwire=# explain select * from stakeholder where id = 1;
> NOTICE: QUERY PLAN:

> Seq Scan on stakeholder (cost=0.00..602.81 rows=1 width=336)

Try "where id = 1::bigint" or "where id = '1'".

Unadorned 1 is an int4, not an int8 ... see archives for previous
discussions.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2002-01-08 23:36:44 Re: Query planner isn't using my indices
Previous Message Bruce Momjian 2002-01-08 22:38:08 Re: Does Postgres support BLOB datatypes?