Table Design: Timestamp vs time/date

Поиск
Список
Период
Сортировка
От Dale Walker
Тема Table Design: Timestamp vs time/date
Дата
Msg-id 398CE86C.18AA9F4@icr.com.au
обсуждение исходный текст
Ответы Re: Table Design: Timestamp vs time/date
Список pgsql-general
I'm currently setting up a table to contain user login/logout
information. Just wondered what would be more scalable??better to
index,etc...

Having a 'timestamp' field 'CCYY-MM-DD HH:MM:SS.SS' or two separate
fields one for time 'HH:MM:SS.SS' and one for Date 'CCYY-MM-DD'.

most queries will be of the form:

------------------------------------------------
select ........ from <table> where username='xxx' and date<'CCYY-MM-DD'
and date>'CCYY-MM-DD'
------------------------------------------------

so I was thinking that a separate 'Date only' field would index better..

Any Thoughts??

--
Dale Walker                                              dale@icr.com.au

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