Table Design: Timestamp vs time/date - Mailing list pgsql-general

From Dale Walker
Subject Table Design: Timestamp vs time/date
Date
Msg-id 398CE86C.18AA9F4@icr.com.au
Whole thread Raw
Responses Re: Table Design: Timestamp vs time/date  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: "Carsten Huettl"
Date:
Subject: Re: pg_id: command not found
Next
From: Tom Lane
Date:
Subject: Re: Re: Need for rebuilding index after many deletions?