Archives of the TeradataForum
Message Posted: Tue, 28 Nov 2006 @ 22:15:01 GMT
Subj: | | Re: Length of timestamp |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Tuesday, November 28, 2006 17:03 -->
We are trying to estimate volumetrics for a new application and I really need to understand how much physical disk space a Timestamp(0)
datatype will consume. Dieter's comments pasted below leave me a little confused. I think what you are saying is that the columnlength column
indicates the "logical" presentation of the timestamp value, e.g. Timestamp(0) = 19 but physical internal storage only consumes 10 bytes. What I
don't understand is why other column datatypes like Smallint, Integer and Date have their "physical" column length displayed in the columnlength
column Is it not safe to assume the TS value is physical as well?
I created a test table (shown below) with a few different datatypes for each column and then checked their columnlength values in DBC.Columns.
It appears that the numeric datatypes display their "physical" length and the non-numeric datatypes display their "logical" length. Is my
assumption correct? And if so, how do I determine/prove what it costs to store a Timestamp(0) datatype?
Thanks in advance for sharing your knowledge!
ColumnName Type Length Format
SMALLINTsamp SMALLINT 2
INTEGERsamp INTEGER 4
DATEsamp DATE 4 YYYY-MM-DD
TIMEHHMM INTEGER 4 99:99
TIMEsamp TIME 8 HH:MI:SS
TIME_WITH_ZONE TIME WITH TIMEZONE 21 HH:MI:SS.S(6)Z
BYTEINTsamp BYTEINT 1
DECIMAL9_4 DECIMAL 4 ------.9999
DECIMAL10_0 DECIMAL 8 ----------9.
CHAR8 CHAR 8 X(8)
VARCHAR8 VARCHAR 8 X(8)
TIMESTAMPsix TIMESTAMP 26 YYYY-MM-DDBHH:MI:SS.S(6)
TIMESTAMPzero TIMESTAMP 19 YYYY-MM-DDBHH:MI:SS TimeStamp(0)
|