Received: from wm14.jersey.juno.com (wm14.jersey.juno.com [64.136.16.234]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g1EJY4E54482 for ; Thu, 14 Feb 2002 14:34:05 -0500 (EST) (envelope-from pricem@juno.com) Received: from cookie.juno.com by cookie.juno.com for <"/TkDBi7JJ2b6tmw2z88AAPfNnOifddYsSeWVHOWBIA0LQ717hT41sw=="> Received: (from pricem@juno.com) by wm14.jersey.juno.com (jqueuemail) id GTMQ89T9; Thu, 14 Feb 2002 14:33:55 EST X-Original-From: "Matthew Price" Date: Thu, 14 Feb 2002 19:33:49 GMT To: pgsql-sql@postgresql.org Subject: Index not being used X-Mailer: Juno Webmail Version 1.0 From: Matthew Price Message-Id: <20020214.143355.20740.14708@wm14.jersey.juno.com> X-Archive-Number: 200202/158 X-Sequence-Number: 6585 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/.