Question

From my reading of things the current wisdom appears to be that by and large utf8 is a good/failsafe/best choice for the default charset for a mysql database. I guess I could just accept that and live with the consequences. However, I am wondering...

Everything I put in my database is first encrypted and then base64 encoded. This means that pretty much the only characters ever likely to occur in my database tables are a-z,A-Z,0-9,= etc. I should mention that there is one column in many of my tables that contains some unencyrpted/unbase64 encoded data that contains the characters a-z,0-9 and A-Z. I need to do case sensitive searches for rows in this column.

Under the circumstances... - would I not see some benefits if I were to use US ASCII + ascii_bin rather than utf8?

I'd much appreciate any advice on the issue.

Was it helpful?

Solution

In order to reduce the size of the DB you should use the smallest charset that satisfies your needs. The utf* family is very big.

It depends really on what data is stored. If you use multi language characters (i.e. German, Hungarian, Arabic, Cyrillic) or special characters, not included in ascii (like integral or n-arry summation signs) the utf8 is a good choice.

However if you store only plain English (in the non-base64 column) use ASCII.

Otherwise consider making separate table(s) with the text (non-base64) values and when searching join them by index values.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top