Archives of the TeradataForum
Message Posted: Fri, 04 Jan 2008 @ 17:58:54 GMT
<-- Anonymously Posted: Fri, 4 Jan 2008 08:35 -->
I need to capture timestamp information - call this column x.
Should I model it as TIMESTAMP(n) or use 2 columns : DATE and TIME(n)
What are the pros and cons?
Here are some usage considerations :
Only the date part, x (date), may be used in joins between tables.
This column will be used in WHERE clauses. The WHERE clause can be in either format
1) WHERE x (date) between 2 date literals
2) WHERE x (timestamp) between 2 timestamp literals
This column will also be used in PPI (with intervals of 1 day or 1 month).
Is there any case when TIMESTAMP(n) will perform better than DATE+TIME(n)? I see none. Irrespective of usage patterns, I am leaning towards always modeling it as DATE+TIME(n), and in the view I would join these 2 to expose as TIMESTAMP(n) (in addition to DATE and TIME(0)).
|Copyright 2016 - All Rights Reserved|
|Last Modified: 27 Dec 2016|