agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Matthew Price <pricem@juno.com>
To: pgsql-sql@postgresql.org
Subject: Index not being used
Date: Thu, 14 Feb 2002 19:33:49 GMT
Message-ID: <20020214.143355.20740.14708@wm14.jersey.juno.com> (raw)

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/.



view thread (11+ messages)  latest in thread

Message-ID: <20020214.143355.20740.14708@wm14.jersey.juno.com>
Permalink:  ../20020214.143355.20740.14708@wm14.jersey.juno.com/
Also on:    postgresql.org/message-id/20020214.143355.20740.14708@wm14.jersey.juno.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: pricem@juno.com
  Subject: Re: Index not being used
  In-Reply-To: <20020214.143355.20740.14708@wm14.jersey.juno.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox