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>)
Список pgsql-general
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
Дата:
Сообщение: Re: Nulls get converted to 0 problem
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: EXTERN JOIN with WHEN query