索引操作
加联合组件:
ALTER TABLE dws_stock_age_material_transactions_total_pri_rpt_update ADD INDEX index_sio (organization_id(16),item_code,subinventory_code);
查看索引:
SHOW INDEX FROM dws_stock_age_material_transactions_detail_pri_rpt
查看被锁表:
查看事物表,找出被锁线程的id:
方式一:SELECT * FROM information_schema.INNODB_TRX; trx_mysql_thread_id :线程ID
方式二:SHOW FULL PROCESSLIST; 找到被锁住的线程ID
根据id,kill掉被锁住的线程:kill 65
show engine innodb status 来查看简略信息或者开死锁日志