| От | Tom Lane |
|---|---|
| Тема | Re: Index on timestamp fields |
| Дата | |
| Msg-id | 11650.1181266111@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Index on timestamp fields (David Gardner <David.Gardner@yucaipaco.com>) |
| Ответы |
Re: Index on timestamp fields
|
| Список | pgsql-novice |
David Gardner <David.Gardner@yucaipaco.com> writes:
> I have a timestamp without timezone field in one of my tables that is used =
> in the where clause of one of my queries:
> WHERE date_trunc('day',"backupReports"."start") = current_date
If you can change the query, it'd be better/more efficient to spell this
as
WHERE "backupReports"."start"::date = current_date
Either way, you need to build an index on the expression, not just the
raw column, to make this search fast.
regards, tom lane
В списке pgsql-novice по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера