15.00 - Specifying DECIMAL and NUMERIC Precisions - Teradata Database

Teradata Database Design

prodname
Teradata Database
vrm_release
15.00
category
User Guide
featnum
B035-1094-015K

Specifying DECIMAL and NUMERIC Precisions

Storage requirements for decimal data types are a function of the precision required of the values to be stored. The following table indicates the number of bytes used to store DECIMAL and NUMERIC data types of various precisions.

 

                 Number of Precision Digits

                Number of Bytes Stored

                                       1 - 2

                                     1

                                       3 - 4

                                     2

                                       5 - 9

                                     4

                                     10 - 18

                                     8

You can achieve optimal space savings by using multi-value compression together with an efficient decimal size. An example would be to define decimal precision such that a 4-byte representation was used instead of an 8-byte representation, for example DECIMAL(9) instead of DECIMAL(10). Then, multi-value compression could be used on the most frequently occurring values to reduce the storage overhead still further.