Index not being used - Mailing list pgsql-sql

From Matthew Price
Subject Index not being used
Date
Msg-id 20020214.143355.20740.14708@wm14.jersey.juno.com
Whole thread Raw
Responses Re: Index not being used  ("Josh Berkus" <josh@agliodbs.com>)
List 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/.


pgsql-sql by date:

Previous
From: Oleg Bartunov
Date:
Subject: pre-alpha release of OpenFTS (perl version) is available for testing
Next
From: Oleg Bartunov
Date:
Subject: Re: Is this the most efficent way to child nodes off a N-ary