Index not being used

From: Matthew Price <pricem(at)juno(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Index not being used
Date: 2002-02-14 19:33:49
Message-ID: 20020214.143355.20740.14708@wm14.jersey.juno.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Howdy,

I have a table like:
CREATE TABLE sometable (cdate date, ....);

and

CREATE INDEX sometable_cdate on sometable (cdate);

Question is, why does the following use the index

EXPLAIN SELECT cdate FROM sometable WHERE cdate = '02/14/2002';

but this does not

EXPLAIN SELECT cdate FROM sometable WHERE cdate = current_date;

I would like to make the SQL call dynamic and not have to make my code do the work.

Thanks for any help,
Matthew

________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today! For your FREE software, visit:
http://dl.www.juno.com/get/web/.

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Oleg Bartunov 2002-02-14 19:36:02 pre-alpha release of OpenFTS (perl version) is available for testing
Previous Message Eduardo 2002-02-14 19:23:19 Money type and kylix