Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Posting topics into the correct forum - response (16) by smadagani@gmail.com

$
0
0
Quick question regading NUMBER vs DECIAL in TD 14.0 : 90% of our join access and optimal path based on Pers_id & Clent_Ky. Client keys start from 1 to 450 as smallint and Pers_id is always 22 degit number as DECIMAL(22.0). Here is the details of datatypes for  these two columns and these two columns part of the PRIMARY INDEX,PPI,  90% of my warehouse tables. PERS_ID DECIMAL(22,0) NOT NULL, CLIENT_KY SMALLINT NOT NULL, PPI on CLIENT_KY: PARTITION BY ( RANGE_N(CLIENT_KY  BETWEEN 1  AND 450  EACH 1 ),   We are not able to accommodate the 22 digits of the Pers_id. As part of Oracle to teradata conversion lift and drop, we moved all objects from Oracle to teradata.   In Oracle, PERS_ID is NUMBER 22, they converted PERS_ID as DECIMAL (22,0) in teradata. My Question is Here: - Can we change PERS_ID as NUMBER in Teradata? and is there any impact , as this new datatype in   TD  14.0 - Looks like NUMBER is belongs to DECIMAL family too?. Correct me if I am wrong, Is it really work as DECIMAL or an INTEGER. Can you please clarify, my PERS_ID column is always 22 digits INTEGER  field.   Reasons why we are asking this question because, integers give better performance over decimals, is integer comparison is bit level while decimals at character level(i.e. byte level).   The main reason they are higher performing, is that the CPU can perform comparison with binary subtraction, on the CPU's registers, where the Decimal is always character-for-character, usually in a loop in firmware, although the machines might actually compare them several bytes at once, they are still treated as separate bytes. Longer decimal values degrade faster than shorter ones for this reason, so you might not see measurable difference between an integer and decimal for tens of thousands of records, but you will for millions of records. The wider the decimal width, the poorer the performance (compared to integer equivalent). NUMBER is a new data type, introduced in Teradata 14.0, which is intended to emulate the Oracle number data type. It has an optional precision and scale of up to 38 decimal digits.  It can also represent exponential values. Its storage size varies from 0 to 18 bytes.

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>