Index on timestamp fields
| От | David Gardner |
|---|---|
| Тема | Index on timestamp fields |
| Дата | |
| Msg-id | C975BFE03CC5DE4999143A5BEA9FB515021DC0C51F@yucex.lax.yucwin обсуждение исходный текст |
| Ответы |
Re: Index on timestamp fields
Re: Index on timestamp fields |
| Список | pgsql-novice |
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
I also built an index on that column, I'm assuming that by using the date_trunc() function in my where clause forces
pgsqlto perform a sequential scan.
Is there a better way to do this? The query needs to return the full timestamp, although I am only selecting by date so
changingthe data type for the column won't work.
Also would saving the value of current_date to a local variable improve performance?
---
David Gardner, IT
The Yucaipa Companies
(310) 228-2855
В списке pgsql-novice по дате отправления: