pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marco Vezzoli <marco.vezzoli@st.com>
To: sql <pgsql-sql@postgresql.org>
Subject: postgres 7.1.3: why does the query plan ignore indexes?
Date: Tue, 19 Aug 2003 10:43:47 +0200
Message-ID: <3F41E343.AE3B5E@st.com> (raw)

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



view thread (8+ messages)  latest in thread

Message-ID: <3F41E343.AE3B5E@st.com>
Permalink:  ../3F41E343.AE3B5E@st.com/
Also on:    postgresql.org/message-id/3F41E343.AE3B5E@st.com

 · 

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-sql@postgresql.org
  Cc: marco.vezzoli@st.com
  Subject: Re: postgres 7.1.3: why does the query plan ignore indexes?
  In-Reply-To: <3F41E343.AE3B5E@st.com>

* 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