The following test case, derived from main.sum_distinct-big, is showing a significant regression due to MDEV-12353. It seems to be mostly explained by the increased redo log volume:
--source include/have_innodb.inc
|
--source include/have_sequence.inc
|
show status like 'innodb_lsn_current';
|
CREATE TABLE t2 ENGINE=InnoDB SELECT * FROM seq_1_to_2097152;
|
show status like 'innodb_lsn_current';
|
DROP TABLE t2;
|
revision |
LSN1 |
LSN2-LSN1 |
time |
10.5 ac51bcfd8d3b08b62d88350fd9de8ae43f7b1637 (before) |
62,998 |
128,417,353 |
15.9s |
10.5 f8a9f906679e1d1ab026c245f7d24c652050d8b3 (after MDEV-12353) |
53,077 |
214,956,466 |
25.7s |
Because the perf report output was ‘polluted’ by PERFORMANCE_SCHEMA functions, I decided to rebuild with cmake -DPLUGIN_PERFSCHEMA_NO. I also disabled the concurrent purge activity (MDEV-12288) to remove one source of nondeterminism:
perf record ./mtr --mysqld=--innodb-force-recovery=2 main.ib
|
revision |
LSN1 |
LSN2-LSN1 |
time |
10.5 ac51bcfd8d3b08b62d88350fd9de8ae43f7b1637 (before) |
60,516 |
128,417,675 |
14.9s |
10.5 f8a9f906679e1d1ab026c245f7d24c652050d8b3 (after MDEV-12353) |
51,149 |
215,006,904 |
23.9s |
The execution times include the perf record overhead.
Here is the perf report output (evaluate_join_record() and anything that consumed more time):
10.5 ac51bcfd8d3b08b62d88350fd9de8ae43f7b1637 (before)
|
12.02% mysqld [.] rec_get_offsets_func
|
9.36% mysqld [.] buf_page_get_gen
|
6.32% mysqld [.] cmp_dtuple_rec_with_match_low
|
6.31% mysqld [.] page_cur_search_with_match
|
6.30% mysqld [.] btr_cur_search_to_nth_level_func
|
2.99% mysqld [.] cmp_data
|
2.04% mysqld [.] row_ins_step
|
1.92% mysqld [.] mtr_t::commit
|
1.88% mysqld [.] trx_undo_report_row_operation
|
1.68% mysqld [.] page_cur_insert_rec_low
|
1.63% mysqld [.] row_ins_clust_index_entry_low
|
1.57% mysqld [.] rw_lock_x_lock_func
|
1.51% mysqld [.] btr_cur_optimistic_insert
|
1.39% mysqld [.] page_cur_insert_rec_write_log
|
1.26% mysqld [.] rw_lock_x_lock_wait_func
|
1.25% mysqld [.] rec_get_converted_size_comp
|
1.24% mysqld [.] ReleaseLatches::operator()
|
1.10% mysqld [.] mlog_open_and_write_index
|
1.00% mysqld [.] row_insert_for_mysql
|
1.00% mysqld [.] mtr_t::memo_push
|
1.00% mysqld [.] TTASEventMutex<GenericPolicy>::enter
|
0.98% mysqld [.] rec_convert_dtuple_to_rec_comp<false>
|
0.94% mysqld [.] ut_crc32_hw
|
0.83% mysqld [.] rw_lock_x_lock_low
|
0.82% mysqld [.] ReleaseBlocks::add_dirty_page_to_flush_list
|
0.82% mysqld [.] log_margin_checkpoint_age
|
0.78% mysqld [.] mtr_t::prepare_write
|
0.72% mysqld [.] TTASEventMutex<BlockMutexPolicy>::enter
|
0.70% mysqld [.] buf_LRU_remove_block
|
0.69% mysqld [.] mtr_t::release_block_at_savepoint
|
0.66% mysqld [.] lock_rec_insert_check_and_lock
|
0.66% mysqld [.] btr_node_ptr_max_size
|
0.63% mysqld [.] ha_seq::index_next
|
0.62% mysqld [.] mtr_t::finish_write
|
0.60% mysqld [.] handler::ha_index_next
|
0.59% mysqld [.] btr_cur_ins_lock_and_undo
|
0.58% mysqld [.] fill_record
|
0.57% mysqld [.] write_record
|
0.56% mysqld [.] page_cur_tuple_insert
|
0.53% mysqld [.] handler::ha_write_row
|
0.52% mysqld [.] row_mysql_store_col_in_innobase_format
|
0.52% mysqld [.] ha_innobase::write_row
|
0.50% mysqld [.] evaluate_join_record
|
10.5 f8a9f906679e1d1ab026c245f7d24c652050d8b3 (after)
|
10.03% mysqld [.] rec_get_offsets_func
|
9.41% mysqld [.] buf_page_get_gen
|
7.35% mysqld [.] page_cur_search_with_match
|
5.60% mysqld [.] btr_cur_search_to_nth_level_func
|
5.46% mysqld [.] cmp_dtuple_rec_with_match_low
|
3.44% mysqld [.] page_cur_insert_rec_low
|
3.29% mysqld [.] mtr_t::log_write<(unsigned char)48>
|
2.64% mysqld [.] cmp_data
|
2.01% mysqld [.] mtr_t::commit
|
1.94% mysqld [.] row_ins_step
|
1.92% mysqld [.] trx_undo_report_row_operation
|
1.84% mysqld [.] rec_get_converted_size_comp
|
1.64% mysqld [.] mtr_t::memcpy_low
|
1.49% mysqld [.] row_ins_clust_index_entry_low
|
1.47% mysqld [.] rw_lock_x_lock_func
|
1.40% mysqld [.] btr_cur_optimistic_insert
|
1.30% mysqld [.] rec_convert_dtuple_to_rec_comp<false>
|
1.17% mysqld [.] mtr_t::memo_push
|
1.16% mysqld [.] rw_lock_x_lock_wait_func
|
1.09% mysqld [.] ReleaseLatches::operator()
|
1.08% mysqld [.] ut_crc32_hw
|
1.03% mysqld [.] row_insert_for_mysql
|
0.81% mysqld [.] handler::ha_index_next
|
0.79% mysqld [.] TTASEventMutex<GenericPolicy>::enter
|
0.77% mysqld [.] ReleaseBlocks::add_dirty_page_to_flush_list
|
0.77% mysqld [.] btr_node_ptr_max_size
|
0.74% mysqld [.] rw_lock_x_lock_low
|
0.73% mysqld [.] lock_rec_insert_check_and_lock
|
0.71% mysqld [.] mtr_t::prepare_write
|
0.69% mysqld [.] log_margin_checkpoint_age
|
0.68% mysqld [.] TTASEventMutex<BlockMutexPolicy>::enter
|
0.60% mysqld [.] ha_innobase::write_row
|
0.57% mysqld [.] mtr_t::release_block_at_savepoint
|
0.55% mysqld [.] row_mysql_store_col_in_innobase_format
|
0.55% mysqld [.] btr_cur_ins_lock_and_undo
|
0.54% mysqld [.] buf_LRU_remove_block
|
0.54% mysqld [.] evaluate_join_record
|
As expected, rec_get_offsets_func() was removed from the top, because we no longer call it when writing log for an insert.
The function trx_undo_report_row_operation() is taking slightly more time, and mtr_t::log_write<WRITE>() and mtr_t::memcpy_low() are new entries related to the new redo log format. We also spend some more time on ut_crc32_hw() due to the 67% increase of redo log volume.
With a single-row INSERT, there is no regression:
--source include/have_innodb.inc
|
CREATE TABLE t2 (a BIGINT) ENGINE=InnoDB;
|
show status like 'innodb_lsn_current';
|
INSERT INTO t2 VALUES(1);
|
show status like 'innodb_lsn_current';
|
DROP TABLE t2;
|
./mtr --mysqld=--innodb-force-recovery=2 main.ib1
|
revision |
LSN1 |
LSN2-LSN1 |
before |
61,792 |
204 |
after |
52,361 |
175 |
The following test case, derived from main.sum_distinct-big, is showing a significant regression due to
MDEV-12353. It seems to be mostly explained by the increased redo log volume:--source include/have_innodb.inc
--source include/have_sequence.inc
MDEV-12353)Because the perf report output was ‘polluted’ by PERFORMANCE_SCHEMA functions, I decided to rebuild with cmake -DPLUGIN_PERFSCHEMA_NO. I also disabled the concurrent purge activity (
MDEV-12288) to remove one source of nondeterminism:perf record ./mtr --mysqld=--innodb-force-recovery=2 main.ib
MDEV-12353)The execution times include the perf record overhead.
Here is the perf report output (evaluate_join_record() and anything that consumed more time):
10.5 ac51bcfd8d3b08b62d88350fd9de8ae43f7b1637 (before)
12.02% mysqld [.] rec_get_offsets_func
9.36% mysqld [.] buf_page_get_gen
6.32% mysqld [.] cmp_dtuple_rec_with_match_low
6.31% mysqld [.] page_cur_search_with_match
6.30% mysqld [.] btr_cur_search_to_nth_level_func
2.99% mysqld [.] cmp_data
2.04% mysqld [.] row_ins_step
1.92% mysqld [.] mtr_t::commit
1.88% mysqld [.] trx_undo_report_row_operation
1.68% mysqld [.] page_cur_insert_rec_low
1.63% mysqld [.] row_ins_clust_index_entry_low
1.57% mysqld [.] rw_lock_x_lock_func
1.51% mysqld [.] btr_cur_optimistic_insert
1.39% mysqld [.] page_cur_insert_rec_write_log
1.26% mysqld [.] rw_lock_x_lock_wait_func
1.25% mysqld [.] rec_get_converted_size_comp
1.24% mysqld [.] ReleaseLatches::operator()
1.10% mysqld [.] mlog_open_and_write_index
1.00% mysqld [.] row_insert_for_mysql
1.00% mysqld [.] mtr_t::memo_push
1.00% mysqld [.] TTASEventMutex<GenericPolicy>::enter
0.98% mysqld [.] rec_convert_dtuple_to_rec_comp<false>
0.94% mysqld [.] ut_crc32_hw
0.83% mysqld [.] rw_lock_x_lock_low
0.82% mysqld [.] ReleaseBlocks::add_dirty_page_to_flush_list
0.82% mysqld [.] log_margin_checkpoint_age
0.78% mysqld [.] mtr_t::prepare_write
0.72% mysqld [.] TTASEventMutex<BlockMutexPolicy>::enter
0.70% mysqld [.] buf_LRU_remove_block
0.69% mysqld [.] mtr_t::release_block_at_savepoint
0.66% mysqld [.] lock_rec_insert_check_and_lock
0.66% mysqld [.] btr_node_ptr_max_size
0.63% mysqld [.] ha_seq::index_next
0.62% mysqld [.] mtr_t::finish_write
0.60% mysqld [.] handler::ha_index_next
0.59% mysqld [.] btr_cur_ins_lock_and_undo
0.58% mysqld [.] fill_record
0.57% mysqld [.] write_record
0.56% mysqld [.] page_cur_tuple_insert
0.53% mysqld [.] handler::ha_write_row
0.52% mysqld [.] row_mysql_store_col_in_innobase_format
0.52% mysqld [.] ha_innobase::write_row
0.50% mysqld [.] evaluate_join_record
10.5 f8a9f906679e1d1ab026c245f7d24c652050d8b3 (after)
10.03% mysqld [.] rec_get_offsets_func
9.41% mysqld [.] buf_page_get_gen
7.35% mysqld [.] page_cur_search_with_match
5.60% mysqld [.] btr_cur_search_to_nth_level_func
5.46% mysqld [.] cmp_dtuple_rec_with_match_low
3.44% mysqld [.] page_cur_insert_rec_low
3.29% mysqld [.] mtr_t::log_write<(unsigned char)48>
2.64% mysqld [.] cmp_data
2.01% mysqld [.] mtr_t::commit
1.94% mysqld [.] row_ins_step
1.92% mysqld [.] trx_undo_report_row_operation
1.84% mysqld [.] rec_get_converted_size_comp
1.64% mysqld [.] mtr_t::memcpy_low
1.49% mysqld [.] row_ins_clust_index_entry_low
1.47% mysqld [.] rw_lock_x_lock_func
1.40% mysqld [.] btr_cur_optimistic_insert
1.30% mysqld [.] rec_convert_dtuple_to_rec_comp<false>
1.17% mysqld [.] mtr_t::memo_push
1.16% mysqld [.] rw_lock_x_lock_wait_func
1.09% mysqld [.] ReleaseLatches::operator()
1.08% mysqld [.] ut_crc32_hw
1.03% mysqld [.] row_insert_for_mysql
0.81% mysqld [.] handler::ha_index_next
0.79% mysqld [.] TTASEventMutex<GenericPolicy>::enter
0.77% mysqld [.] ReleaseBlocks::add_dirty_page_to_flush_list
0.77% mysqld [.] btr_node_ptr_max_size
0.74% mysqld [.] rw_lock_x_lock_low
0.73% mysqld [.] lock_rec_insert_check_and_lock
0.71% mysqld [.] mtr_t::prepare_write
0.69% mysqld [.] log_margin_checkpoint_age
0.68% mysqld [.] TTASEventMutex<BlockMutexPolicy>::enter
0.60% mysqld [.] ha_innobase::write_row
0.57% mysqld [.] mtr_t::release_block_at_savepoint
0.55% mysqld [.] row_mysql_store_col_in_innobase_format
0.55% mysqld [.] btr_cur_ins_lock_and_undo
0.54% mysqld [.] buf_LRU_remove_block
0.54% mysqld [.] evaluate_join_record
As expected, rec_get_offsets_func() was removed from the top, because we no longer call it when writing log for an insert.
The function trx_undo_report_row_operation() is taking slightly more time, and mtr_t::log_write<WRITE>() and mtr_t::memcpy_low() are new entries related to the new redo log format. We also spend some more time on ut_crc32_hw() due to the 67% increase of redo log volume.
With a single-row INSERT, there is no regression:
--source include/have_innodb.inc
./mtr --mysqld=--innodb-force-recovery=2 main.ib1