Re: newbie questions about composite key
Posted by: Peter Brawley
Date: September 30, 2007 05:26PM

Why keep date & time in different columns?

If there is zero possibility of two reports arriving with timestamps within one sec of each other, you can use a timestamp column (resolution=1 sec) as a PK (it's trivial to extract day, hour, min & sec from such a column). Otherwise merely keep an index on the timestamp, and mount a PK which delivers zero possibility of duplication, ie an auto_increment (surrogate) PK. I think you will find that such a query will greatly simplify many of your queries.

PB

Options: ReplyQuote


Subject
Written By
Posted
Re: newbie questions about composite key
September 30, 2007 05:26PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.