Interpolate MySQL query parameters by default
What changed?
We now specify interpolateParams by default when using MySQL for either our main or visibility database. This required changing the type returned when serializing VisibilitySearchAttributes as this version won't allow binary data within JSON columns (which makes sense).
While we could also have explicitly prepared and reused our statements that requires far more work and it may not be the better approach anyways.
Why?
@mattrobenolt did a good job of explaining why in #5425 but I'll summarize it here anyways.
When interpolateParams is false (the default) the driver will prepare parameterized statements before executing them, meaning we need two round-trips to the database for each query. By setting interpolateParams to true the DB driver will handle interpolation and send the query just once to the database, halving the number of round trips necessary. This should improve the performance of all clusters using MySQL.
How did you test it?
Existing tests.
Potential risks
No
Is hotfix candidate?
This is up for discussion