Table Design: Timestamp vs time/date

From: Dale Walker <dale(at)icr(dot)com(dot)au>
To: pgsql-general(at)postgresql(dot)org
Subject: Table Design: Timestamp vs time/date
Date: 2000-08-06 04:24:12
Message-ID: 398CE86C.18AA9F4@icr.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)icr(dot)com(dot)au

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-08-06 05:40:46 Re: Re: Need for rebuilding index after many deletions?
Previous Message Bruce Momjian 2000-08-05 23:39:09 Re: foreign keys