We will walk through an example of how to do this on a TAS deployed with internal MySQL.
1. SSH into a
mysql VM:
bosh -d <CF-DEP> ssh mysql/0
2. Connect to the
mysql client:
sudo mysql --defaults-file=/var/vcap/jobs/pxc-mysql/config/mylogin.cnf
3. Use the Autoscale database:
USE autoscale;
4. View the current indexes for the
service_bindings table:
SHOW INDEX FROM service_bindings;
5. Add the index:
ALTER TABLE service_bindings ADD INDEX app_guid_idx (app_guid);
6. Verify the newly added index is present:
SHOW INDEX FROM service_bindings;
7. Exit
exit
Now the index is added.
Note: If you need to remove the index, repeat steps 1-3 and then run the following command to drop it:
DROP INDEX app_guid_idx ON service_bindings;
If you find that you are still experiencing the MySQL deadlock errors even after adding this index, please contact Tanzu Support.