According to MySQL manual, MySQL includes character set support that enables us to store data using a variety of character sets and perform comparisons according to a variety of collations. Character sets can be specified at four different levels:
- Server
- Database
- Table
- Column
Assuming I have a database that stores the following:
- User ID (INT)
- Email Address (VARCHAR 50)
- User profile (TEXT - multi-language)
- System flag (CHAR 1 - a-z only)
Between Latin1
and UTF-8
, which should I choose for the four different levels to achieve the best possible performance?
ADD NOTE: This is just a simplified example. In real scenario, I would expect several columns storing (a-zA-Z0-9) and one or two columns storing multi-lingual text. That is why I am concerned about performance.
ADD NOTE2: I am referring to a database that stores millions of records. That is why performance matters to me.