(go) the difference between int and varchar when storing a numeric field in a MySQL database

Source: Internet
Author: User
From the execution efficiency of the field type, the int is the highest and the varchar is the lowest.
The Status Type field, using char or varchar is undesirable, the int type is easier to index and retrieve, after all, the numeric type is the basis of the database retrieval, after all, the char type needs to be transformed, and varchar is more complex, and the ordering needs not only conversion and computation, You also need to access and follow the collation of the database (in fact, Char also requires a collation) and consume more resources.
Therefore, it is common to use the int type field rather than the character type field in the database design, which has significant performance differences in the optimization of large and very large databases.

(go) the difference between int and varchar when storing a numeric field in a MySQL database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.