pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michal Taborsky <michal@taborsky.cz>
To: Artimenko Igor <igorart7@yahoo.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Postgres does not utilize indexes. Why?
Date: Tue, 17 Aug 2004 17:45:34 +0200
Message-ID: <4122281E.1060402@taborsky.cz> (raw)
In-Reply-To: <20040817153555.85408.qmail@web11901.mail.yahoo.com>
References: <20040817153555.85408.qmail@web11901.mail.yahoo.com>

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




view thread (3+ messages)  latest in thread

Message-ID: <4122281E.1060402@taborsky.cz>
Permalink:  ../4122281E.1060402@taborsky.cz/
Also on:    postgresql.org/message-id/4122281E.1060402@taborsky.cz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: michal@taborsky.cz, igorart7@yahoo.com
  Subject: Re: Postgres does not utilize indexes. Why?
  In-Reply-To: <4122281E.1060402@taborsky.cz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox