Problem with indicies... - Mailing list pgsql-hackers

From Andy Farrell
Subject Problem with indicies...
Date
Msg-id n1302005168.20358@itd.sterling.com
Whole thread Raw
List pgsql-hackers
REGARDING                Problem with indicies...

I'm having trouble getting indicies to be used when performing various
"covered" queries.

For example see the following table, index and query.

CREATE TABLE JDSFTRATT
(
ATT_CODE char(3),
DS_ID int,
FTR_ID int,
ATT_VALUE float,
ATT_TEXT varchar(128) )
;

create index jdsftratt_b_ds_id_ftr_id
on jdsftratt
using btree (ds_id int4_ops, ftr_id int4_ops, att_code char4_ops, att_value
float8_ops);

select ftr_id from jdsftratt;

As per the explain command, a "Seq Scan" (see explain command output below)
is being performed by postgres for the above query.  Also, why would
sequential scan be performed by postgres given a select count(*) on and
indexed table?

explain select ftr_id from jdsftratt;

Seq Scan on jdsftratt  (cost=90889.78 size=2134660 width=4)

I have verified that the index exists via querying the system tables. I'm
using postgres 6.3.2 on Sun Ultra 10 running Solaris.  Any help would be
appreciated on this.  

Andy



pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] Warning!!
Next
From: "Oliver Elphick"
Date:
Subject: Mixing library versions