Re: Query planner isn't using my indices - Mailing list pgsql-general

From Tom Lane
Subject Re: Query planner isn't using my indices
Date
Msg-id 23346.1010531795@sss.pgh.pa.us
Whole thread Raw
In response to Query planner isn't using my indices  ("Alaric B. Snell" <abs@frontwire.com>)
List pgsql-general
"Alaric B. Snell" <abs@frontwire.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

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Does Postgres support BLOB datatypes?
Next
From: Stephan Szabo
Date:
Subject: Re: Query planner isn't using my indices