Re: Postgres does not utilize indexes. Why?

From: Michal Taborsky <michal(at)taborsky(dot)cz>
To: Artimenko Igor <igorart7(at)yahoo(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Postgres does not utilize indexes. Why?
Date: 2004-08-17 15:45:34
Message-ID: 4122281E.1060402@taborsky.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Artimenko Igor wrote:
> id int8 NOT NULL DEFAULT nextval('next_id_seq'::text) INIQUE,

ID column is bigint, but '50000' is int, therefore the index does not
match. You need to cast your clause like this:

select id from test where id = 50000::int8

Also, issue VACUUM ANALYZE, so Postgres knows about the structure of the
data.

--
Michal Taborsky
http://www.taborsky.cz

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Duane Lee - EGOVX 2004-08-17 16:58:59 Re: General performance problem!
Previous Message olivier HARO 2004-08-17 15:41:41 Re: General performance problem!