Skip to content

Instantly share code, notes, and snippets.

@JonnoN
Last active September 17, 2019 20:34
Show Gist options
  • Save JonnoN/5c7a36017d38caa3a2d70cea77fd9ac8 to your computer and use it in GitHub Desktop.
Save JonnoN/5c7a36017d38caa3a2d70cea77fd9ac8 to your computer and use it in GitHub Desktop.
SQL for measuring binlog group commit efficiency
-- (run this all at once)
set @binlog_commits_1 = (select variable_value from information_schema.global_status where variable_Name = 'Binlog_commits');
set @binlog_group_commits_1 = (select variable_value from information_schema.global_status where variable_Name = 'Binlog_group_commits');
set @trigger_count_1 = (select variable_value from information_schema.global_status where variable_Name = 'Binlog_group_commit_trigger_count');
set @trigger_timeout_1 = (select variable_value from information_schema.global_status where variable_Name = 'Binlog_group_commit_trigger_timeout');
select sleep(60);
set @binlog_commits_2 = (select variable_value from information_schema.global_status where variable_Name = 'Binlog_commits');
set @binlog_group_commits_2 = (select variable_value from information_schema.global_status where variable_Name = 'Binlog_group_commits');
set @trigger_count_2 = (select variable_value from information_schema.global_status where variable_Name = 'Binlog_group_commit_trigger_count');
set @trigger_timeout_2 = (select variable_value from information_schema.global_status where variable_Name = 'Binlog_group_commit_trigger_timeout');
select (@binlog_group_commits_2 - @binlog_group_commits_1) as group_commits, (@binlog_commits_2 - @binlog_commits_1) as commits, @trigger_count_2 - @trigger_count_1 as trigger_count, @trigger_timeout_2 - @trigger_timeout_1 as trigger_timeout;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment