Re: Query planner isn't using my indices

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
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:36:44
Message-ID: 20020108153541.N64700-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Tue, 8 Jan 2002, Alaric B. Snell wrote:

> 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)
>

See past discussions, you'll need to either explicitly cast the
constant to bigint or quote it, because otherwise it prematurely
casts the constant into an int4.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2002-01-09 00:02:56 Re: Query planner isn't using my indices
Previous Message Tom Lane 2002-01-08 23:16:35 Re: Query planner isn't using my indices