Re: Create index on the year of a date column

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Nick Barr <nick(dot)barr(at)webbased(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Create index on the year of a date column
Date: 2003-06-06 12:29:16
Message-ID: 20030606122916.GC30097@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jun 05, 2003 at 17:38:21 +0100,
Nick Barr <nick(dot)barr(at)webbased(dot)co(dot)uk> wrote:
> Hi,
>
> I am trying to create an index on the year of a date field, to speed up
> some queries. Table structure is as follows

Wouldn't an index on the plain date work as well? You would have to
make queries for years be range queries instead of equal, but the index
could be used for other things (like ordering by date).

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jan Wieck 2003-06-06 12:46:06 Re: [HACKERS] SAP and MySQL ... [and Benchmark]
Previous Message Bruno Wolff III 2003-06-06 12:21:53 Re: EXTERN JOIN with WHEN query