postgres 7.1.3: why does the query plan ignore indexes? - Mailing list pgsql-sql

From Marco Vezzoli
Subject postgres 7.1.3: why does the query plan ignore indexes?
Date
Msg-id 3F41E343.AE3B5E@st.com
Whole thread Raw
Responses Re: postgres 7.1.3: why does the query plan ignore indexes?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Hi,
I know this question was asked many times, but please help me understand
what I am doing wrong.
I work with a postgresql 7.1.3 on Solaris 8 compiled with gcc 3.0.2

Some indexes are defined on a table 

ewsweb_test=> \d measures_product
Index "measures_product"Attribute  |   Type   
------------+----------product_id | smallint
btree

ewsweb_test=> \d measures_date       Index "measures_date"Attribute |           Type           
-----------+--------------------------date      | timestamp with time zone
btree

but the query seems to ignore it.

ewsweb_test=> explain select zero_yield, gross from measures where
product_id=29 and date between '2003-03-12' and '2003-08-14';
NOTICE:  QUERY PLAN:

Seq Scan on measures  (cost=0.00..12937.76 rows=254 width=12)

EXPLAIN

I know there is an option that alter the seq scan cost but I prefer to
leave the optimizer as clean as possible.
Thanks in advence for any help.Marco

-- 
Marco Vezzoli       tel. +39 039 603 6852
STMicroelectronics fax. +39 039 603 5055


pgsql-sql by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Changing data type must recreate all views?
Next
From: shyamperi@davlin.co.in
Date:
Subject: Migration from db2 to postgres'