rm -rf 97913/ bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/97913 --log-error-verbosity=3 bin/mysqld --no-defaults --basedir=$PWD --datadir=$PWD/97913 --core-file --socket=/tmp/mysql_ushastry.sock --port=3333 --log-error=$PWD/97913/log.err --log-error-verbosity=3 --secure-file-priv="" --innodb_monitor_enable="module_dml,module_trx,module_purge,module_buffer_page,module_undo" 2>&1 & - Before ALTER mysql> select name, subsystem, count, comment from information_schema.innodb_metrics where name like '%undo%' or name like '%rseg%'; +------------------------------+----------------+-------+-----------------------------------------------+ | name | subsystem | count | comment | +------------------------------+----------------+-------+-----------------------------------------------+ | buffer_page_read_undo_log | buffer_page_io | 6 | Number of Undo Log Pages read | | buffer_page_written_undo_log | buffer_page_io | 22578 | Number of Undo Log Pages written | | trx_rseg_history_len | transaction | 38 | Length of the TRX_RSEG_HISTORY list | | trx_undo_slots_used | transaction | 19 | Number of undo slots used | | trx_undo_slots_cached | transaction | 19 | Number of undo slots cached | | trx_rseg_current_size | transaction | 185 | Current rollback segment size in pages | | purge_undo_log_pages | purge | 38 | Number of undo log pages handled by the purge | +------------------------------+----------------+-------+-----------------------------------------------+ 7 rows in set (0.00 sec) - During ALTER mysql> select name, subsystem, count, comment from information_schema.innodb_metrics where name like '%undo%' or name like '%rseg%'; +------------------------------+----------------+-------+-----------------------------------------------+ | name | subsystem | count | comment | +------------------------------+----------------+-------+-----------------------------------------------+ | buffer_page_read_undo_log | buffer_page_io | 58 | Number of Undo Log Pages read | | buffer_page_written_undo_log | buffer_page_io | 27313 | Number of Undo Log Pages written | | trx_rseg_history_len | transaction | 0 | Length of the TRX_RSEG_HISTORY list | | trx_undo_slots_used | transaction | 58 | Number of undo slots used | | trx_undo_slots_cached | transaction | 57 | Number of undo slots cached | | trx_rseg_current_size | transaction | 5168 | Current rollback segment size in pages | | purge_undo_log_pages | purge | 64 | Number of undo log pages handled by the purge | +------------------------------+----------------+-------+-----------------------------------------------+ 7 rows in set (0.00 sec) mysql> SELECT EVENT_NAME, WORK_COMPLETED, WORK_ESTIMATED FROM performance_schema.events_stages_current; +-----------------------------+----------------+----------------+ | EVENT_NAME | WORK_COMPLETED | WORK_ESTIMATED | +-----------------------------+----------------+----------------+ | stage/sql/copy to tmp table | 5712466 | 24513418 | | stage/sql/Sending data | NULL | NULL | +-----------------------------+----------------+----------------+ 2 rows in set (0.00 sec) . mysql> select name, subsystem, count, comment from information_schema.innodb_metrics where name like '%undo%' or name like '%rseg%'; +------------------------------+----------------+-------+-----------------------------------------------+ | name | subsystem | count | comment | +------------------------------+----------------+-------+-----------------------------------------------+ | buffer_page_read_undo_log | buffer_page_io | 152 | Number of Undo Log Pages read | | buffer_page_written_undo_log | buffer_page_io | 43947 | Number of Undo Log Pages written | | trx_rseg_history_len | transaction | 12 | Length of the TRX_RSEG_HISTORY list | | trx_undo_slots_used | transaction | 74 | Number of undo slots used | | trx_undo_slots_cached | transaction | 73 | Number of undo slots cached | | trx_rseg_current_size | transaction | 21560 | Current rollback segment size in pages | | purge_undo_log_pages | purge | 140 | Number of undo log pages handled by the purge | +------------------------------+----------------+-------+-----------------------------------------------+ 7 rows in set (0.00 sec) mysql> SELECT EVENT_NAME, WORK_COMPLETED, WORK_ESTIMATED FROM performance_schema.events_stages_current; +-----------------------------+----------------+----------------+ | EVENT_NAME | WORK_COMPLETED | WORK_ESTIMATED | +-----------------------------+----------------+----------------+ | stage/sql/copy to tmp table | 23519811 | 24513418 | | stage/sql/Sending data | NULL | NULL | +-----------------------------+----------------+----------------+ 2 rows in set (0.00 sec) -- mysql> ALTER TABLE t1 PARTITION BY HASH(id) partitions 4; Query OK, 25165824 rows affected (4 min 12.47 sec) Records: 25165824 Duplicates: 0 Warnings: 0 -- mysql> select name, subsystem, count, comment from information_schema.innodb_metrics where name like '%undo%' or name like '%rseg%'; +------------------------------+----------------+-------+-----------------------------------------------+ | name | subsystem | count | comment | +------------------------------+----------------+-------+-----------------------------------------------+ | buffer_page_read_undo_log | buffer_page_io | 164 | Number of Undo Log Pages read | | buffer_page_written_undo_log | buffer_page_io | 45937 | Number of Undo Log Pages written | | trx_rseg_history_len | transaction | 27 | Length of the TRX_RSEG_HISTORY list | | trx_undo_slots_used | transaction | 88 | Number of undo slots used | | trx_undo_slots_cached | transaction | 88 | Number of undo slots cached | | trx_rseg_current_size | transaction | 254 | Current rollback segment size in pages | | purge_undo_log_pages | purge | 155 | Number of undo log pages handled by the purge | +------------------------------+----------------+-------+-----------------------------------------------+ 7 rows in set (0.00 sec) mysql> SELECT EVENT_NAME, WORK_COMPLETED, WORK_ESTIMATED FROM performance_schema.events_stages_current; +-----------------------------+----------------+----------------+ | EVENT_NAME | WORK_COMPLETED | WORK_ESTIMATED | +-----------------------------+----------------+----------------+ | stage/sql/copy to tmp table | 23519811 | 24513418 | | stage/sql/Sending data | NULL | NULL | +-----------------------------+----------------+----------------+