Selecting a Data Type
Use the following principles to select efficient data types:
- Select data types that facilitate data calculation.
Generally, integer data calculations (including common comparison calculations such as =, >, <, ≥, ≤, and ≠, and GROUP BY) are more efficient than character strings and floating-point numbers.
- Select data types with a short length.
Data types with short length reduce both the data file size and the memory used for computing, improving the I/O and computing performance. For example, if smallint can be used for integer data, do not use int. If int can be used, do not use bigint.
- Use the same data type for a join.
You are advised to use the same data type for a join. To join columns with different data types, the database needs to convert them to the same type, which leads to additional performance overheads.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot