| От | Andrew Sullivan |
|---|---|
| Тема | Re: Create Index on Date portion of timestamp |
| Дата | |
| Msg-id | 20061013201607.GF31912@phlogiston.dyndns.org обсуждение исходный текст |
| Ответ на | Create Index on Date portion of timestamp ("Niederland" <niederland@gmail.com>) |
| Список | pgsql-general |
On Thu, Oct 12, 2006 at 06:40:22PM -0700, Niederland wrote:
> I am using postgresql 8.1.4.
>
> Is there anyway to create an index equivalent to:
> CREATE INDEX i1 ON t1 USING btree (ts::Date);
>
> So that indexes are used for queries when the field is cast to a date.
I didn't try it, but you ought to be able to create a functional
index on the to_date() of the column. I don't know if that will
solve your cast issue, but you could rewrite the CAST into the
to_date form to get around that.
A
--
Andrew Sullivan | ajs@crankycanuck.ca
"The year's penultimate month" is not in truth a good way of saying
November.
--H.W. Fowler
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера