Re: Index on timestamp to date field

Поиск
Список
Период
Сортировка
От Jeff
Тема Re: Index on timestamp to date field
Дата
Msg-id Pine.BSF.4.44.0310140851410.1994-100000@torgo.978.org
обсуждение исходный текст
Ответ на Index on timestamp to date field  ("Patrick Hatcher" <PHatcher@macys.com>)
Список pgsql-general
On Mon, 13 Oct 2003, Patrick Hatcher wrote:

> I have a timestamp field where I find I'm doing a lot of searching by date
> (YYYY-MM-DD) or using this field as a match to another table that has a
> date format.  I wanted to create an index on the  timestamp field using a
> date format.  Is this possible?  I tried:
>  CREATE INDEX test_2 ON table1 USING btree to_char(field2, 'MM-DD-YYYY');
> but I get an error message error at or new to_char
>
> TIA
>

So you don't want a oh. lets call it a "real index" on the timestamp
field?

create index ts_index on mytable(mytimestamp);

Or can you not change the way the dates are input?

Or is the "mytimestamp" field a varchar containing a date string?

--
Jeff Trout <jeff@jefftrout.com>
http://www.jefftrout.com/
http://www.stuarthamm.net/



В списке pgsql-general по дате отправления:

Предыдущее
От: Harry Broomhall
Дата:
Сообщение: Re: Performance weirdness with/without vacuum analyze
Следующее
От: Jean-Luc Lachance
Дата:
Сообщение: Re: Table partitioning for maximum speed?