My default collation_connection was 'utf8_generic_ci' and it caused an issue today with a polish character not fitting, thowing an error (the table has utf8mb4_0900_as_ci)
So I changed the connectin to utf8mb4_0900_as_cs but I don't know if that can affect performance, matching or returned data beyond the utf8 encoding.
Is there any difference between ci and cs in the connection collation ?
I of course understand the difference in column/table collation.
Best Answer
Changing the collation of the connection will have little to no impact on performance, but also on what you probably want to achieve. From the manual:
If you want to make comparisons in with or without case sensitivity/accent sensitivity, you will have to update the actual column's collation, or force the collation on every comparison manually (e.g. WHERE ). The latter may have low impact if no index is required, or a huge impact if the usage of an index is prevented because the comparison and the column use different collation.
In practice: