Re: Create index on the year of a date column

Поиск
Список
Период
Сортировка
Искать
От
Ron Johnson
Тема
Re: Create index on the year of a date column
Дата
Msg-id
1054895641.18124.46.camel@haggis
Ответ на
Список
Дерево обсуждения
Create index on the year of a date column "Nick Barr" <nick.barr@webbased.co.uk>
Re: Create index on the year of a date column Ron Johnson <ron.l.johnson@cox.net>
Re: Create index on the year of a date column Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: Create index on the year of a date column Bruno Wolff III <bruno@wolff.to>
Re: Create index on the year of a date column Tom Lane <tgl@sss.pgh.pa.us>
Re: Create index on the year of a date column Oleg Bartunov <oleg@sai.msu.su>
On Thu, 2003-06-05 at 11:38, Nick Barr 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

If, for example, you want all records where item_created_start_date
in calendar year 2001, why not create the index on i_c_s_d and say 
  WHERE item_created_start_date between '2001-01-01' and '2001-12-31'


-- 
+-----------------------------------------------------------+
| Ron Johnson, Jr.     Home: ron.l.johnson@cox.net          |
| Jefferson, LA  USA   http://members.cox.net/ron.l.johnson |
|                                                           |
| Regarding war zones: "There's nothing sacrosanct about a  |
| hotel with a bunch of journalists in it."                 |
|     Marine Lt. Gen. Bernard E. Trainor (Retired)          |
+-----------------------------------------------------------+

В списке pgsql-general по дате отправления
От: Jon Earle
Дата:
От: Richard Huxton
Дата:
FAQ