r/mysql • u/SmartMySQL • Oct 13 '19
How monitor MySQL ALTER TABLE command progress?
It is a common question to MySQL experts when there are running ALTER TABLE on production environments especially for large tables with millions of records. How to monitor ALTER TABLE progress? How much time does it take?
You can get details using the following SQL query
SELECT EVENT_NAME, WORK_COMPLETED, WORK_ESTIMATED FROM performance_schema.events_stages_current;It should be needed to enable Performance_schema in MySQL . More details
This Query also loaded in SmartWorkbench tool and if you type "AM(AlterMonitor)" and enter then this query will be replaced.
SmartMySQL's SmartWorkbench is a GUI tool for MySQL to develop MySQL 10X faster demo. It is Free , Downlaod
5
u/xenilko Oct 13 '19
If it creates a temp file table just monitor its size as this will give you some insight
2
u/kristofer_grahn Oct 13 '19
IMHO, This is the best way to monitor progress.
A while true; loop running du -h on the temporary files.3
4
u/reddit_be_nice Oct 13 '19
Show processlist;