## 1) Enter MySQLmysql -u root -p## 2) Let's see the list of locked tablesshow open tables where in_use>0;## 3) Let's see the list of the current processes,## one of them is locking your table(s)show processlist;## 4) Kill one of these processeskill <put_process_id_here>;
Inside Kubernetes
# Run db client in a pod inside kuberneteskubectl run galera-mariadb-galera-client -n shared-qa --rm --tty -i --restart='Never' --image REGISTRY/mariadb-galera:10.4.12-debian-10-r78 --command -- mysql -h galera-mariadb-galera -P 3306 -uroot -pPASSWORD
Queries para encontrar problemas de desempenho
-- Use o EXPLAIN para entender o plano de execução de uma consulta problemáticaEXPLAIN SELECT * FROM sua_tabela;-- Print all killable queriesSELECT GROUP_CONCAT(CONCAT('KILL ',id,';') SEPARATOR ' ')FROM information_schema.processlist WHERE user <> 'system user';-- Print all queries from specific userSELECT GROUP_CONCAT(CONCAT('KILL ',id,';') SEPARATOR ' ')FROM information_schema.processlist WHERE user = 'joaozinho';