Re: Create index on the year of a date column

From: "Vincent Hikida" <vhikida(at)inreach(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Create index on the year of a date column
Date: 2003-06-06 22:31:11
Message-ID: 00e201c32c7b$559a9720$6601a8c0@HOMEOFFICE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> regression=# explain SELECT * FROM sm_item WHERE
> regression-# item_created_date_start BETWEEN '1685-01-01' AND
'1685-12-31';
> QUERY PLAN

Hmm, if date includes the time, shouldn't the query be:

SELECT *
FROM sm_item
WHERE item_created_date_start >= '1685-01-01'
AND item_created_date_start < '1686-01-01'

Vincent Hikida,
Member of Technical Staff - Urbana Software, Inc.
"A Personalized Learning Experience"

www.UrbanaSoft.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message DeJuan Jackson 2003-06-06 22:46:11 Re: Nulls get converted to 0 problem
Previous Message David Olbersen 2003-06-06 21:23:49 (long) What's the problem?