6. Stage 4--Optimize the Database Schema : Performance Considerations : Using Correct Data Types
 
Share this page                  
Using Correct Data Types
VectorH is optimized to perform as much query processing in memory as possible. As such, choice of appropriate data types and length is an important factor in ensuring efficient execution. In general, choosing large character data types for columns that are used in table joins is less efficient than choosing numeric types.
In addition, choosing numeric types that are larger than they need to be will also affect performance, so do not simply choose the largest data type available when designing your schema; try to pick the smallest and most appropriate data type that will still hold all of your target data.
For example, we have often observed that customers who have a background in Oracle will choose large DECIMAL data types with a scale of zero (for example, DECIMAL(38,0)) when one of the INTEGER data types (1, 2, 4, or 8-bytes) is a better choice. This can further be improved by selecting the correct INTEGER length. An 8-byte INTEGER can store numbers in the range -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807; if storing the floor number in a building, a 1-byte INTEGER may be more than adequate (‑128 to +127)!