mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 10:31:54 +01:00
MDEV-28539 Some InnoDB counters are duplicating generic SHOW STATUS
The InnoDB srv_stats counters n_rows_updated, n_rows_deleted, n_rows_inserted, and n_rows_read are duplicating Handler_update, Handler_delete, Handler_write, and Handler_read_ counters. Updating those counters is not free, especially because some counters are furthermore split to distinguish a rare case of modifying tables in the system schema.
This commit is contained in:
parent
6b9bba41e8
commit
0dab74ff3f
16 changed files with 6 additions and 882 deletions
|
@ -1694,15 +1694,6 @@ OK
|
|||
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
|
||||
variable_value
|
||||
16384
|
||||
SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
|
||||
variable_value - @innodb_rows_deleted_orig
|
||||
71
|
||||
SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
|
||||
variable_value - @innodb_rows_inserted_orig
|
||||
964
|
||||
SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated';
|
||||
variable_value - @innodb_rows_updated_orig
|
||||
865
|
||||
SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits';
|
||||
variable_value - @innodb_row_lock_waits_orig
|
||||
0
|
||||
|
|
|
@ -226,14 +226,6 @@ innodb_dict_lru_count_idle server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NU
|
|||
innodb_dblwr_writes server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of doublewrite operations that have been performed (innodb_dblwr_writes)
|
||||
innodb_dblwr_pages_written server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages that have been written for doublewrite operations (innodb_dblwr_pages_written)
|
||||
innodb_page_size server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value InnoDB page size in bytes (innodb_page_size)
|
||||
dml_reads dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of rows read
|
||||
dml_inserts dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of rows inserted
|
||||
dml_deletes dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of rows deleted
|
||||
dml_updates dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of rows updated
|
||||
dml_system_reads dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of system rows read
|
||||
dml_system_inserts dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of system rows inserted
|
||||
dml_system_deletes dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of system rows deleted
|
||||
dml_system_updates dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of system rows updated
|
||||
ddl_background_drop_indexes ddl 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of indexes waiting to be dropped after failed index creation
|
||||
ddl_online_create_index ddl 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of indexes being created online
|
||||
ddl_pending_alter_table ddl 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of ALTER TABLE, CREATE INDEX, DROP INDEX in progress
|
||||
|
|
|
@ -74,14 +74,6 @@ INNODB_ROW_LOCK_TIME
|
|||
INNODB_ROW_LOCK_TIME_AVG
|
||||
INNODB_ROW_LOCK_TIME_MAX
|
||||
INNODB_ROW_LOCK_WAITS
|
||||
INNODB_ROWS_DELETED
|
||||
INNODB_ROWS_INSERTED
|
||||
INNODB_ROWS_READ
|
||||
INNODB_ROWS_UPDATED
|
||||
INNODB_SYSTEM_ROWS_DELETED
|
||||
INNODB_SYSTEM_ROWS_INSERTED
|
||||
INNODB_SYSTEM_ROWS_READ
|
||||
INNODB_SYSTEM_ROWS_UPDATED
|
||||
INNODB_NUM_OPEN_FILES
|
||||
INNODB_TRUNCATED_STATUS_WRITES
|
||||
INNODB_AVAILABLE_UNDO_LOGS
|
||||
|
|
|
@ -192,14 +192,6 @@ innodb_dict_lru_count_idle disabled
|
|||
innodb_dblwr_writes disabled
|
||||
innodb_dblwr_pages_written disabled
|
||||
innodb_page_size disabled
|
||||
dml_reads disabled
|
||||
dml_inserts disabled
|
||||
dml_deletes disabled
|
||||
dml_updates disabled
|
||||
dml_system_reads disabled
|
||||
dml_system_inserts disabled
|
||||
dml_system_deletes disabled
|
||||
dml_system_updates disabled
|
||||
ddl_background_drop_indexes disabled
|
||||
ddl_online_create_index disabled
|
||||
ddl_pending_alter_table disabled
|
||||
|
@ -391,134 +383,6 @@ where name='trx_rollbacks';
|
|||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
trx_rollbacks 1 NULL 1 1 NULL 1 enabled
|
||||
set global innodb_monitor_disable = module_trx;
|
||||
set global innodb_monitor_enable = module_dml;
|
||||
insert into monitor_test values(9);
|
||||
update monitor_test set col = 10 where col = 9;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset,
|
||||
if(enabled,'enabled','disabled') status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 2 NULL 2 2 NULL 2 enabled
|
||||
dml_inserts 1 NULL 1 1 NULL 1 enabled
|
||||
dml_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_updates 2 NULL 2 2 NULL 2 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
delete from monitor_test;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset,
|
||||
if(enabled,'enabled','disabled') status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 4 NULL 4 4 NULL 4 enabled
|
||||
dml_inserts 1 NULL 1 1 NULL 1 enabled
|
||||
dml_deletes 2 NULL 2 2 NULL 2 enabled
|
||||
dml_updates 2 NULL 2 2 NULL 2 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
set global innodb_monitor_reset = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset,
|
||||
if(enabled,'enabled','disabled') status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 4 NULL 4 0 NULL 0 enabled
|
||||
dml_inserts 1 NULL 1 0 NULL 0 enabled
|
||||
dml_deletes 2 NULL 2 0 NULL 0 enabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
delete from monitor_test;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset,
|
||||
if(enabled,'enabled','disabled') status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 6 NULL 6 2 NULL 2 enabled
|
||||
dml_inserts 3 NULL 3 2 NULL 2 enabled
|
||||
dml_deletes 4 NULL 4 2 NULL 2 enabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset,
|
||||
if(enabled,'enabled','disabled') status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 6 NULL 6 2 NULL 2 enabled
|
||||
dml_inserts 3 NULL 3 2 NULL 2 enabled
|
||||
dml_deletes 4 NULL 4 2 NULL 2 enabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 enabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 enabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 enabled
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset,
|
||||
if(enabled,'enabled','disabled') status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads 6 NULL 6 2 NULL 2 disabled
|
||||
dml_inserts 3 NULL 3 2 NULL 2 disabled
|
||||
dml_deletes 4 NULL 4 2 NULL 2 disabled
|
||||
dml_updates 2 NULL 2 0 NULL 0 disabled
|
||||
dml_system_reads 0 NULL 0 0 NULL 0 disabled
|
||||
dml_system_inserts 0 NULL 0 0 NULL 0 disabled
|
||||
dml_system_deletes 0 NULL 0 0 NULL 0 disabled
|
||||
dml_system_updates 0 NULL 0 0 NULL 0 disabled
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset,
|
||||
if(enabled,'enabled','disabled') status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_inserts NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_enable = dml_inserts;
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
delete from monitor_test;
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset,
|
||||
if(enabled,'enabled','disabled') status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
name max_count min_count count max_count_reset min_count_reset count_reset status
|
||||
dml_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_inserts 2 NULL 2 2 NULL 2 enabled
|
||||
dml_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_reads NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_inserts NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_deletes NULL NULL 0 NULL NULL 0 disabled
|
||||
dml_system_updates NULL NULL 0 NULL NULL 0 disabled
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
drop table monitor_test;
|
||||
set global innodb_monitor_enable = file_num_open_files;
|
||||
select name, max_count, min_count, count,
|
||||
|
|
|
@ -25,9 +25,6 @@ call mtr.add_suppression("\\[ERROR\\] InnoDB: in ALTER TABLE `test`.`t1`");
|
|||
call mtr.add_suppression("\\[ERROR\\] InnoDB: in RENAME TABLE table `test`.`t1`");
|
||||
|
||||
--disable_warnings
|
||||
SET @innodb_rows_deleted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted');
|
||||
SET @innodb_rows_inserted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted');
|
||||
SET @innodb_rows_updated_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated');
|
||||
SET @innodb_row_lock_waits_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits');
|
||||
SET @innodb_row_lock_current_waits_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits');
|
||||
SET @innodb_row_lock_time_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time');
|
||||
|
@ -1319,9 +1316,6 @@ drop table t1;
|
|||
# uses previous ones(pages_created, rows_deleted, ...).
|
||||
SELECT IF(variable_value BETWEEN 488 AND 512, 'OK', variable_value) FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
|
||||
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
|
||||
SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
|
||||
SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
|
||||
SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated';
|
||||
|
||||
# Test for row locks InnoDB status variables.
|
||||
SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits';
|
||||
|
|
|
@ -254,93 +254,6 @@ where name='trx_rollbacks';
|
|||
|
||||
set global innodb_monitor_disable = module_trx;
|
||||
|
||||
# Test DML Module
|
||||
set global innodb_monitor_enable = module_dml;
|
||||
|
||||
insert into monitor_test values(9);
|
||||
|
||||
update monitor_test set col = 10 where col = 9;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset,
|
||||
if(enabled,'enabled','disabled') status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
delete from monitor_test;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset,
|
||||
if(enabled,'enabled','disabled') status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# test reset counter while the counter is on
|
||||
set global innodb_monitor_reset = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset,
|
||||
if(enabled,'enabled','disabled') status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# insert/delete some rows after the reset
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
|
||||
delete from monitor_test;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset,
|
||||
if(enabled,'enabled','disabled') status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# We do not allow reset_all while the counter is on, nothing
|
||||
# should be reset here
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset,
|
||||
if(enabled,'enabled','disabled') status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# Turn off the counter
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset,
|
||||
if(enabled,'enabled','disabled') status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# Reset all counter values
|
||||
set global innodb_monitor_reset_all = module_dml;
|
||||
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset,
|
||||
if(enabled,'enabled','disabled') status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
# Open individual counter "dml_inserts"
|
||||
set global innodb_monitor_enable = dml_inserts;
|
||||
|
||||
insert into monitor_test values(9);
|
||||
insert into monitor_test values(1);
|
||||
|
||||
delete from monitor_test;
|
||||
|
||||
# Only counter "dml_inserts" should be updated
|
||||
select name, max_count, min_count, count,
|
||||
max_count_reset, min_count_reset, count_reset,
|
||||
if(enabled,'enabled','disabled') status
|
||||
from information_schema.innodb_metrics
|
||||
where name like "dml%";
|
||||
|
||||
set global innodb_monitor_disable = module_dml;
|
||||
|
||||
drop table monitor_test;
|
||||
|
||||
set global innodb_monitor_enable = file_num_open_files;
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
#########################################
|
||||
# Author: Benjamin Renard benj@fb.com
|
||||
# Date: 11/15/2013
|
||||
# Purpose: Showing the difference between current innodb rows stats and the ones recorded at the beginning of the test
|
||||
# Requirements: Having @[master|slave]_[system_]rows_[read|inserted|deleted|updated] counters already created
|
||||
#########################################
|
||||
|
||||
--connection master
|
||||
|
||||
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
||||
select @rows_read - @master_rows_read;
|
||||
select variable_value into @rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
||||
select @rows_updated - @master_rows_updated;
|
||||
select variable_value into @rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
||||
select @rows_deleted - @master_rows_deleted;
|
||||
select variable_value into @rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
||||
select @rows_inserted - @master_rows_inserted;
|
||||
|
||||
select variable_value into @system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
||||
select @system_rows_read - @master_system_rows_read;
|
||||
select variable_value into @system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
||||
select @system_rows_updated - @master_system_rows_updated;
|
||||
select variable_value into @system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
||||
select @system_rows_deleted - @master_system_rows_deleted;
|
||||
select variable_value into @system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
||||
select @system_rows_inserted - @master_system_rows_inserted;
|
||||
|
||||
--sync_slave_with_master
|
||||
|
||||
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
||||
select @rows_read - @slave_rows_read;
|
||||
select variable_value into @rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
||||
select @rows_updated - @slave_rows_updated;
|
||||
select variable_value into @rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
||||
select @rows_deleted - @slave_rows_deleted;
|
||||
select variable_value into @rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
||||
select @rows_inserted - @slave_rows_inserted;
|
||||
|
||||
select variable_value into @system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
||||
select @system_rows_read - @slave_system_rows_read;
|
||||
select variable_value into @system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
||||
select @system_rows_updated - @slave_system_rows_updated;
|
||||
select variable_value into @system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
||||
select @system_rows_deleted - @slave_system_rows_deleted;
|
||||
select variable_value into @system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
||||
select @system_rows_inserted - @slave_system_rows_inserted;
|
||||
|
||||
--connection master
|
|
@ -1,233 +0,0 @@
|
|||
include/master-slave.inc
|
||||
[connection master]
|
||||
connection master;
|
||||
select variable_value into @master_rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
||||
select variable_value into @master_rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
||||
select variable_value into @master_rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
||||
select variable_value into @master_rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
||||
select variable_value into @master_system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
||||
select variable_value into @master_system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
||||
select variable_value into @master_system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
||||
select variable_value into @master_system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
||||
connection slave;
|
||||
select variable_value into @slave_rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
||||
select variable_value into @slave_rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
||||
select variable_value into @slave_rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
||||
select variable_value into @slave_rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
||||
select variable_value into @slave_system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
||||
select variable_value into @slave_system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
||||
select variable_value into @slave_system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
||||
select variable_value into @slave_system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
||||
connection master;
|
||||
CREATE DATABASE testdb;
|
||||
USE testdb;
|
||||
CREATE TABLE testdb.t1 (i int NOT NULL PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO testdb.t1 VALUES (1);
|
||||
connection master;
|
||||
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
||||
select @rows_read - @master_rows_read;
|
||||
@rows_read - @master_rows_read
|
||||
0
|
||||
select variable_value into @rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
||||
select @rows_updated - @master_rows_updated;
|
||||
@rows_updated - @master_rows_updated
|
||||
0
|
||||
select variable_value into @rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
||||
select @rows_deleted - @master_rows_deleted;
|
||||
@rows_deleted - @master_rows_deleted
|
||||
0
|
||||
select variable_value into @rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
||||
select @rows_inserted - @master_rows_inserted;
|
||||
@rows_inserted - @master_rows_inserted
|
||||
1
|
||||
select variable_value into @system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
||||
select @system_rows_read - @master_system_rows_read;
|
||||
@system_rows_read - @master_system_rows_read
|
||||
0
|
||||
select variable_value into @system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
||||
select @system_rows_updated - @master_system_rows_updated;
|
||||
@system_rows_updated - @master_system_rows_updated
|
||||
0
|
||||
select variable_value into @system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
||||
select @system_rows_deleted - @master_system_rows_deleted;
|
||||
@system_rows_deleted - @master_system_rows_deleted
|
||||
0
|
||||
select variable_value into @system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
||||
select @system_rows_inserted - @master_system_rows_inserted;
|
||||
@system_rows_inserted - @master_system_rows_inserted
|
||||
0
|
||||
connection slave;
|
||||
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
||||
select @rows_read - @slave_rows_read;
|
||||
@rows_read - @slave_rows_read
|
||||
0
|
||||
select variable_value into @rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
||||
select @rows_updated - @slave_rows_updated;
|
||||
@rows_updated - @slave_rows_updated
|
||||
0
|
||||
select variable_value into @rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
||||
select @rows_deleted - @slave_rows_deleted;
|
||||
@rows_deleted - @slave_rows_deleted
|
||||
0
|
||||
select variable_value into @rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
||||
select @rows_inserted - @slave_rows_inserted;
|
||||
@rows_inserted - @slave_rows_inserted
|
||||
1
|
||||
select variable_value into @system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
||||
select @system_rows_read - @slave_system_rows_read;
|
||||
@system_rows_read - @slave_system_rows_read
|
||||
0
|
||||
select variable_value into @system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
||||
select @system_rows_updated - @slave_system_rows_updated;
|
||||
@system_rows_updated - @slave_system_rows_updated
|
||||
0
|
||||
select variable_value into @system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
||||
select @system_rows_deleted - @slave_system_rows_deleted;
|
||||
@system_rows_deleted - @slave_system_rows_deleted
|
||||
0
|
||||
select variable_value into @system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
||||
select @system_rows_inserted - @slave_system_rows_inserted;
|
||||
@system_rows_inserted - @slave_system_rows_inserted
|
||||
0
|
||||
connection master;
|
||||
UPDATE t1 SET i=2 WHERE i=1;
|
||||
connection slave;
|
||||
connection master;
|
||||
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
||||
select @rows_read - @master_rows_read;
|
||||
@rows_read - @master_rows_read
|
||||
1
|
||||
select variable_value into @rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
||||
select @rows_updated - @master_rows_updated;
|
||||
@rows_updated - @master_rows_updated
|
||||
1
|
||||
select variable_value into @rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
||||
select @rows_deleted - @master_rows_deleted;
|
||||
@rows_deleted - @master_rows_deleted
|
||||
0
|
||||
select variable_value into @rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
||||
select @rows_inserted - @master_rows_inserted;
|
||||
@rows_inserted - @master_rows_inserted
|
||||
1
|
||||
select variable_value into @system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
||||
select @system_rows_read - @master_system_rows_read;
|
||||
@system_rows_read - @master_system_rows_read
|
||||
0
|
||||
select variable_value into @system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
||||
select @system_rows_updated - @master_system_rows_updated;
|
||||
@system_rows_updated - @master_system_rows_updated
|
||||
0
|
||||
select variable_value into @system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
||||
select @system_rows_deleted - @master_system_rows_deleted;
|
||||
@system_rows_deleted - @master_system_rows_deleted
|
||||
0
|
||||
select variable_value into @system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
||||
select @system_rows_inserted - @master_system_rows_inserted;
|
||||
@system_rows_inserted - @master_system_rows_inserted
|
||||
0
|
||||
connection slave;
|
||||
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
||||
select @rows_read - @slave_rows_read;
|
||||
@rows_read - @slave_rows_read
|
||||
1
|
||||
select variable_value into @rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
||||
select @rows_updated - @slave_rows_updated;
|
||||
@rows_updated - @slave_rows_updated
|
||||
1
|
||||
select variable_value into @rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
||||
select @rows_deleted - @slave_rows_deleted;
|
||||
@rows_deleted - @slave_rows_deleted
|
||||
0
|
||||
select variable_value into @rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
||||
select @rows_inserted - @slave_rows_inserted;
|
||||
@rows_inserted - @slave_rows_inserted
|
||||
1
|
||||
select variable_value into @system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
||||
select @system_rows_read - @slave_system_rows_read;
|
||||
@system_rows_read - @slave_system_rows_read
|
||||
0
|
||||
select variable_value into @system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
||||
select @system_rows_updated - @slave_system_rows_updated;
|
||||
@system_rows_updated - @slave_system_rows_updated
|
||||
0
|
||||
select variable_value into @system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
||||
select @system_rows_deleted - @slave_system_rows_deleted;
|
||||
@system_rows_deleted - @slave_system_rows_deleted
|
||||
0
|
||||
select variable_value into @system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
||||
select @system_rows_inserted - @slave_system_rows_inserted;
|
||||
@system_rows_inserted - @slave_system_rows_inserted
|
||||
0
|
||||
connection master;
|
||||
DELETE FROM t1 WHERE i=2;
|
||||
connection master;
|
||||
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
||||
select @rows_read - @master_rows_read;
|
||||
@rows_read - @master_rows_read
|
||||
2
|
||||
select variable_value into @rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
||||
select @rows_updated - @master_rows_updated;
|
||||
@rows_updated - @master_rows_updated
|
||||
1
|
||||
select variable_value into @rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
||||
select @rows_deleted - @master_rows_deleted;
|
||||
@rows_deleted - @master_rows_deleted
|
||||
1
|
||||
select variable_value into @rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
||||
select @rows_inserted - @master_rows_inserted;
|
||||
@rows_inserted - @master_rows_inserted
|
||||
1
|
||||
select variable_value into @system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
||||
select @system_rows_read - @master_system_rows_read;
|
||||
@system_rows_read - @master_system_rows_read
|
||||
0
|
||||
select variable_value into @system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
||||
select @system_rows_updated - @master_system_rows_updated;
|
||||
@system_rows_updated - @master_system_rows_updated
|
||||
0
|
||||
select variable_value into @system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
||||
select @system_rows_deleted - @master_system_rows_deleted;
|
||||
@system_rows_deleted - @master_system_rows_deleted
|
||||
0
|
||||
select variable_value into @system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
||||
select @system_rows_inserted - @master_system_rows_inserted;
|
||||
@system_rows_inserted - @master_system_rows_inserted
|
||||
0
|
||||
connection slave;
|
||||
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
||||
select @rows_read - @slave_rows_read;
|
||||
@rows_read - @slave_rows_read
|
||||
2
|
||||
select variable_value into @rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
||||
select @rows_updated - @slave_rows_updated;
|
||||
@rows_updated - @slave_rows_updated
|
||||
1
|
||||
select variable_value into @rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
||||
select @rows_deleted - @slave_rows_deleted;
|
||||
@rows_deleted - @slave_rows_deleted
|
||||
1
|
||||
select variable_value into @rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
||||
select @rows_inserted - @slave_rows_inserted;
|
||||
@rows_inserted - @slave_rows_inserted
|
||||
1
|
||||
select variable_value into @system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
||||
select @system_rows_read - @slave_system_rows_read;
|
||||
@system_rows_read - @slave_system_rows_read
|
||||
0
|
||||
select variable_value into @system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
||||
select @system_rows_updated - @slave_system_rows_updated;
|
||||
@system_rows_updated - @slave_system_rows_updated
|
||||
0
|
||||
select variable_value into @system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
||||
select @system_rows_deleted - @slave_system_rows_deleted;
|
||||
@system_rows_deleted - @slave_system_rows_deleted
|
||||
0
|
||||
select variable_value into @system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
||||
select @system_rows_inserted - @slave_system_rows_inserted;
|
||||
@system_rows_inserted - @slave_system_rows_inserted
|
||||
0
|
||||
connection master;
|
||||
DROP TABLE t1;
|
||||
DROP DATABASE testdb;
|
||||
connection slave;
|
||||
include/rpl_end.inc
|
|
@ -1,53 +0,0 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/have_binlog_format_row.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
#
|
||||
# Bug#68220: innodb_rows_updated is misleading on slave when *info_repository=TABLE
|
||||
#
|
||||
|
||||
# created all the base variables at the beginning at the test
|
||||
--connection master
|
||||
select variable_value into @master_rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
||||
select variable_value into @master_rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
||||
select variable_value into @master_rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
||||
select variable_value into @master_rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
||||
select variable_value into @master_system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
||||
select variable_value into @master_system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
||||
select variable_value into @master_system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
||||
select variable_value into @master_system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
||||
|
||||
--connection slave
|
||||
select variable_value into @slave_rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
|
||||
select variable_value into @slave_rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
|
||||
select variable_value into @slave_rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
|
||||
select variable_value into @slave_rows_inserted from information_schema.global_status where variable_name = 'innodb_rows_inserted';
|
||||
select variable_value into @slave_system_rows_read from information_schema.global_status where variable_name = 'innodb_system_rows_read';
|
||||
select variable_value into @slave_system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
|
||||
select variable_value into @slave_system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
|
||||
select variable_value into @slave_system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
|
||||
|
||||
--connection master
|
||||
CREATE DATABASE testdb;
|
||||
USE testdb;
|
||||
CREATE TABLE testdb.t1 (i int NOT NULL PRIMARY KEY) ENGINE=InnoDB;
|
||||
|
||||
# insert a row and show counters on master and slave
|
||||
INSERT INTO testdb.t1 VALUES (1);
|
||||
--source suite/rpl/include/rpl_innodb_rows_counters.inc
|
||||
|
||||
# update the row and show counters on master and slave
|
||||
UPDATE t1 SET i=2 WHERE i=1;
|
||||
--sync_slave_with_master
|
||||
--source suite/rpl/include/rpl_innodb_rows_counters.inc
|
||||
|
||||
# delete the row and show counters on master and slave
|
||||
DELETE FROM t1 WHERE i=2;
|
||||
--source suite/rpl/include/rpl_innodb_rows_counters.inc
|
||||
|
||||
# clean the test
|
||||
DROP TABLE t1;
|
||||
DROP DATABASE testdb;
|
||||
--sync_slave_with_master
|
||||
|
||||
--source include/rpl_end.inc
|
|
@ -898,6 +898,8 @@ static MYSQL_THDVAR_STR(tmpdir,
|
|||
"Directory for temporary non-tablespace files.",
|
||||
innodb_tmpdir_validate, NULL, NULL);
|
||||
|
||||
static size_t truncated_status_writes;
|
||||
|
||||
static SHOW_VAR innodb_status_variables[]= {
|
||||
#ifdef BTR_CUR_HASH_ADAPT
|
||||
{"adaptive_hash_hash_searches", &export_vars.innodb_ahi_hit, SHOW_SIZE_T},
|
||||
|
@ -1006,19 +1008,8 @@ static SHOW_VAR innodb_status_variables[]= {
|
|||
{"row_lock_time_avg", &export_vars.innodb_row_lock_time_avg, SHOW_SIZE_T},
|
||||
{"row_lock_time_max", &export_vars.innodb_row_lock_time_max, SHOW_SIZE_T},
|
||||
{"row_lock_waits", &export_vars.innodb_row_lock_waits, SHOW_SIZE_T},
|
||||
{"rows_deleted", &export_vars.innodb_rows_deleted, SHOW_SIZE_T},
|
||||
{"rows_inserted", &export_vars.innodb_rows_inserted, SHOW_SIZE_T},
|
||||
{"rows_read", &export_vars.innodb_rows_read, SHOW_SIZE_T},
|
||||
{"rows_updated", &export_vars.innodb_rows_updated, SHOW_SIZE_T},
|
||||
{"system_rows_deleted", &export_vars.innodb_system_rows_deleted,SHOW_SIZE_T},
|
||||
{"system_rows_inserted", &export_vars.innodb_system_rows_inserted,
|
||||
SHOW_SIZE_T},
|
||||
{"system_rows_read", &export_vars.innodb_system_rows_read, SHOW_SIZE_T},
|
||||
{"system_rows_updated", &export_vars.innodb_system_rows_updated,
|
||||
SHOW_SIZE_T},
|
||||
{"num_open_files", &fil_system.n_open, SHOW_SIZE_T},
|
||||
{"truncated_status_writes", &export_vars.innodb_truncated_status_writes,
|
||||
SHOW_SIZE_T},
|
||||
{"truncated_status_writes", &truncated_status_writes, SHOW_SIZE_T},
|
||||
{"available_undo_logs", &srv_available_undo_logs, SHOW_ULONG},
|
||||
{"undo_truncations", &export_vars.innodb_undo_truncations, SHOW_ULONG},
|
||||
|
||||
|
@ -8995,13 +8986,6 @@ ha_innobase::index_read(
|
|||
case DB_SUCCESS:
|
||||
error = 0;
|
||||
table->status = 0;
|
||||
if (m_prebuilt->table->is_system_db) {
|
||||
srv_stats.n_system_rows_read.add(
|
||||
thd_get_thread_id(m_prebuilt->trx->mysql_thd), 1);
|
||||
} else {
|
||||
srv_stats.n_rows_read.add(
|
||||
thd_get_thread_id(m_prebuilt->trx->mysql_thd), 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case DB_RECORD_NOT_FOUND:
|
||||
|
@ -9256,13 +9240,6 @@ ha_innobase::general_fetch(
|
|||
case DB_SUCCESS:
|
||||
error = 0;
|
||||
table->status = 0;
|
||||
if (m_prebuilt->table->is_system_db) {
|
||||
srv_stats.n_system_rows_read.add(
|
||||
thd_get_thread_id(trx->mysql_thd), 1);
|
||||
} else {
|
||||
srv_stats.n_rows_read.add(
|
||||
thd_get_thread_id(trx->mysql_thd), 1);
|
||||
}
|
||||
break;
|
||||
case DB_RECORD_NOT_FOUND:
|
||||
error = HA_ERR_END_OF_FILE;
|
||||
|
@ -16231,7 +16208,7 @@ innodb_show_status(
|
|||
|
||||
if (flen > MAX_STATUS_SIZE) {
|
||||
usable_len = MAX_STATUS_SIZE;
|
||||
srv_truncated_status_writes++;
|
||||
truncated_status_writes++;
|
||||
} else {
|
||||
usable_len = flen;
|
||||
}
|
||||
|
|
|
@ -374,17 +374,6 @@ enum monitor_id_t {
|
|||
MONITOR_OVLD_SRV_DBLWR_PAGES_WRITTEN,
|
||||
MONITOR_OVLD_SRV_PAGE_SIZE,
|
||||
|
||||
/* Data DML related counters */
|
||||
MONITOR_MODULE_DML_STATS,
|
||||
MONITOR_OLVD_ROW_READ,
|
||||
MONITOR_OLVD_ROW_INSERTED,
|
||||
MONITOR_OLVD_ROW_DELETED,
|
||||
MONITOR_OLVD_ROW_UPDTATED,
|
||||
MONITOR_OLVD_SYSTEM_ROW_READ,
|
||||
MONITOR_OLVD_SYSTEM_ROW_INSERTED,
|
||||
MONITOR_OLVD_SYSTEM_ROW_DELETED,
|
||||
MONITOR_OLVD_SYSTEM_ROW_UPDATED,
|
||||
|
||||
/* Data DDL related counters */
|
||||
MONITOR_MODULE_DDL_STATS,
|
||||
MONITOR_BACKGROUND_DROP_INDEX,
|
||||
|
|
|
@ -116,30 +116,6 @@ struct srv_stats_t
|
|||
/** Number of data read in total (in bytes) */
|
||||
ulint_ctr_1_t data_read;
|
||||
|
||||
/** Number of rows read. */
|
||||
ulint_ctr_n_t n_rows_read;
|
||||
|
||||
/** Number of rows updated */
|
||||
ulint_ctr_n_t n_rows_updated;
|
||||
|
||||
/** Number of rows deleted */
|
||||
ulint_ctr_n_t n_rows_deleted;
|
||||
|
||||
/** Number of rows inserted */
|
||||
ulint_ctr_n_t n_rows_inserted;
|
||||
|
||||
/** Number of system rows read. */
|
||||
ulint_ctr_n_t n_system_rows_read;
|
||||
|
||||
/** Number of system rows updated */
|
||||
ulint_ctr_n_t n_system_rows_updated;
|
||||
|
||||
/** Number of system rows deleted */
|
||||
ulint_ctr_n_t n_system_rows_deleted;
|
||||
|
||||
/** Number of system rows inserted */
|
||||
ulint_ctr_n_t n_system_rows_inserted;
|
||||
|
||||
/** Number of times secondary index lookup triggered cluster lookup */
|
||||
ulint_ctr_n_t n_sec_rec_cluster_reads;
|
||||
|
||||
|
@ -399,7 +375,6 @@ extern bool srv_monitor_active;
|
|||
extern ulong srv_n_spin_wait_rounds;
|
||||
extern uint srv_spin_wait_delay;
|
||||
|
||||
extern ulint srv_truncated_status_writes;
|
||||
/** Number of initialized rollback segments for persistent undo log */
|
||||
extern ulong srv_available_undo_logs;
|
||||
/** Iterations of the loop bounded by 'srv_active' label. */
|
||||
|
@ -701,15 +676,6 @@ struct export_var_t{
|
|||
/ srv_n_lock_wait_count */
|
||||
ulint innodb_row_lock_time_max; /*!< srv_n_lock_max_wait_time
|
||||
/ 1000 */
|
||||
ulint innodb_rows_read; /*!< srv_n_rows_read */
|
||||
ulint innodb_rows_inserted; /*!< srv_n_rows_inserted */
|
||||
ulint innodb_rows_updated; /*!< srv_n_rows_updated */
|
||||
ulint innodb_rows_deleted; /*!< srv_n_rows_deleted */
|
||||
ulint innodb_system_rows_read; /*!< srv_n_system_rows_read */
|
||||
ulint innodb_system_rows_inserted; /*!< srv_n_system_rows_inserted */
|
||||
ulint innodb_system_rows_updated; /*!< srv_n_system_rows_updated */
|
||||
ulint innodb_system_rows_deleted; /*!< srv_n_system_rows_deleted*/
|
||||
ulint innodb_truncated_status_writes; /*!< srv_truncated_status_writes */
|
||||
|
||||
/** Number of undo tablespace truncation operations */
|
||||
ulong innodb_undo_truncations;
|
||||
|
|
|
@ -1393,12 +1393,6 @@ error_exit:
|
|||
}
|
||||
}
|
||||
|
||||
if (table->is_system_db) {
|
||||
srv_stats.n_system_rows_inserted.inc(size_t(trx->id));
|
||||
} else {
|
||||
srv_stats.n_rows_inserted.inc(size_t(trx->id));
|
||||
}
|
||||
|
||||
/* Not protected by dict_sys.latch or table->stats_mutex_lock()
|
||||
for performance
|
||||
reasons, we would rather get garbage in stat_n_rows (which is
|
||||
|
@ -1744,20 +1738,8 @@ row_update_for_mysql(row_prebuilt_t* prebuilt)
|
|||
with a latch. */
|
||||
dict_table_n_rows_dec(prebuilt->table);
|
||||
|
||||
if (table->is_system_db) {
|
||||
srv_stats.n_system_rows_deleted.inc(size_t(trx->id));
|
||||
} else {
|
||||
srv_stats.n_rows_deleted.inc(size_t(trx->id));
|
||||
}
|
||||
|
||||
update_statistics = !srv_stats_include_delete_marked;
|
||||
} else {
|
||||
if (table->is_system_db) {
|
||||
srv_stats.n_system_rows_updated.inc(size_t(trx->id));
|
||||
} else {
|
||||
srv_stats.n_rows_updated.inc(size_t(trx->id));
|
||||
}
|
||||
|
||||
update_statistics
|
||||
= !(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE);
|
||||
}
|
||||
|
@ -2010,8 +1992,6 @@ static dberr_t row_update_vers_insert(que_thr_t* thr, upd_node_t* node)
|
|||
goto exit;
|
||||
|
||||
case DB_SUCCESS:
|
||||
srv_stats.n_rows_inserted.inc(
|
||||
static_cast<size_t>(trx->id));
|
||||
dict_stats_update_if_needed(table, *trx);
|
||||
goto exit;
|
||||
}
|
||||
|
@ -2095,11 +2075,9 @@ row_update_cascade_for_mysql(
|
|||
dict_table_n_rows_dec(node->table);
|
||||
|
||||
stats = !srv_stats_include_delete_marked;
|
||||
srv_stats.n_rows_deleted.inc(size_t(trx->id));
|
||||
} else {
|
||||
stats = !(node->cmpl_info
|
||||
& UPD_NODE_NO_ORD_CHANGE);
|
||||
srv_stats.n_rows_updated.inc(size_t(trx->id));
|
||||
}
|
||||
|
||||
if (stats) {
|
||||
|
|
|
@ -1078,50 +1078,6 @@ static monitor_info_t innodb_counter_info[] =
|
|||
MONITOR_EXISTING | MONITOR_DEFAULT_ON | MONITOR_DISPLAY_CURRENT),
|
||||
MONITOR_DEFAULT_START, MONITOR_OVLD_SRV_PAGE_SIZE},
|
||||
|
||||
/* ========== Counters for DML operations ========== */
|
||||
{"module_dml", "dml", "Statistics for DMLs",
|
||||
MONITOR_MODULE,
|
||||
MONITOR_DEFAULT_START, MONITOR_MODULE_DML_STATS},
|
||||
|
||||
{"dml_reads", "dml", "Number of rows read",
|
||||
static_cast<monitor_type_t>(MONITOR_EXISTING),
|
||||
MONITOR_DEFAULT_START, MONITOR_OLVD_ROW_READ},
|
||||
|
||||
{"dml_inserts", "dml", "Number of rows inserted",
|
||||
static_cast<monitor_type_t>(
|
||||
MONITOR_EXISTING | MONITOR_DEFAULT_ON),
|
||||
MONITOR_DEFAULT_START, MONITOR_OLVD_ROW_INSERTED},
|
||||
|
||||
{"dml_deletes", "dml", "Number of rows deleted",
|
||||
static_cast<monitor_type_t>(
|
||||
MONITOR_EXISTING | MONITOR_DEFAULT_ON),
|
||||
MONITOR_DEFAULT_START, MONITOR_OLVD_ROW_DELETED},
|
||||
|
||||
{"dml_updates", "dml", "Number of rows updated",
|
||||
static_cast<monitor_type_t>(
|
||||
MONITOR_EXISTING | MONITOR_DEFAULT_ON),
|
||||
MONITOR_DEFAULT_START, MONITOR_OLVD_ROW_UPDTATED},
|
||||
|
||||
{"dml_system_reads", "dml", "Number of system rows read",
|
||||
static_cast<monitor_type_t>(
|
||||
MONITOR_EXISTING | MONITOR_DEFAULT_ON),
|
||||
MONITOR_DEFAULT_START, MONITOR_OLVD_SYSTEM_ROW_READ},
|
||||
|
||||
{"dml_system_inserts", "dml", "Number of system rows inserted",
|
||||
static_cast<monitor_type_t>(
|
||||
MONITOR_EXISTING | MONITOR_DEFAULT_ON),
|
||||
MONITOR_DEFAULT_START, MONITOR_OLVD_SYSTEM_ROW_INSERTED},
|
||||
|
||||
{"dml_system_deletes", "dml", "Number of system rows deleted",
|
||||
static_cast<monitor_type_t>(
|
||||
MONITOR_EXISTING | MONITOR_DEFAULT_ON),
|
||||
MONITOR_DEFAULT_START, MONITOR_OLVD_SYSTEM_ROW_DELETED},
|
||||
|
||||
{"dml_system_updates", "dml", "Number of system rows updated",
|
||||
static_cast<monitor_type_t>(
|
||||
MONITOR_EXISTING | MONITOR_DEFAULT_ON),
|
||||
MONITOR_DEFAULT_START, MONITOR_OLVD_SYSTEM_ROW_UPDATED},
|
||||
|
||||
/* ========== Counters for DDL operations ========== */
|
||||
{"module_ddl", "ddl", "Statistics for DDLs",
|
||||
MONITOR_MODULE,
|
||||
|
@ -1547,46 +1503,6 @@ srv_mon_process_existing_counter(
|
|||
value = srv_buf_pool_size;
|
||||
break;
|
||||
|
||||
/* innodb_rows_read */
|
||||
case MONITOR_OLVD_ROW_READ:
|
||||
value = srv_stats.n_rows_read;
|
||||
break;
|
||||
|
||||
/* innodb_rows_inserted */
|
||||
case MONITOR_OLVD_ROW_INSERTED:
|
||||
value = srv_stats.n_rows_inserted;
|
||||
break;
|
||||
|
||||
/* innodb_rows_deleted */
|
||||
case MONITOR_OLVD_ROW_DELETED:
|
||||
value = srv_stats.n_rows_deleted;
|
||||
break;
|
||||
|
||||
/* innodb_rows_updated */
|
||||
case MONITOR_OLVD_ROW_UPDTATED:
|
||||
value = srv_stats.n_rows_updated;
|
||||
break;
|
||||
|
||||
/* innodb_system_rows_read */
|
||||
case MONITOR_OLVD_SYSTEM_ROW_READ:
|
||||
value = srv_stats.n_system_rows_read;
|
||||
break;
|
||||
|
||||
/* innodb_system_rows_inserted */
|
||||
case MONITOR_OLVD_SYSTEM_ROW_INSERTED:
|
||||
value = srv_stats.n_system_rows_inserted;
|
||||
break;
|
||||
|
||||
/* innodb_system_rows_deleted */
|
||||
case MONITOR_OLVD_SYSTEM_ROW_DELETED:
|
||||
value = srv_stats.n_system_rows_deleted;
|
||||
break;
|
||||
|
||||
/* innodb_system_rows_updated */
|
||||
case MONITOR_OLVD_SYSTEM_ROW_UPDATED:
|
||||
value = srv_stats.n_system_rows_updated;
|
||||
break;
|
||||
|
||||
/* innodb_row_lock_current_waits */
|
||||
case MONITOR_OVLD_ROW_LOCK_CURRENT_WAIT:
|
||||
// dirty read without lock_sys.wait_mutex
|
||||
|
|
|
@ -327,16 +327,6 @@ ulong srv_n_spin_wait_rounds;
|
|||
/** innodb_spin_wait_delay */
|
||||
uint srv_spin_wait_delay;
|
||||
|
||||
static ulint srv_n_rows_inserted_old;
|
||||
static ulint srv_n_rows_updated_old;
|
||||
static ulint srv_n_rows_deleted_old;
|
||||
static ulint srv_n_rows_read_old;
|
||||
static ulint srv_n_system_rows_inserted_old;
|
||||
static ulint srv_n_system_rows_updated_old;
|
||||
static ulint srv_n_system_rows_deleted_old;
|
||||
static ulint srv_n_system_rows_read_old;
|
||||
|
||||
ulint srv_truncated_status_writes;
|
||||
/** Number of initialized rollback segments for persistent undo log */
|
||||
ulong srv_available_undo_logs;
|
||||
|
||||
|
@ -392,9 +382,6 @@ mysql_mutex_t srv_misc_tmpfile_mutex;
|
|||
/** Temporary file for miscellanous diagnostic output */
|
||||
FILE* srv_misc_tmpfile;
|
||||
|
||||
static ulint srv_main_thread_process_no;
|
||||
static ulint srv_main_thread_id;
|
||||
|
||||
/* The following counts are used by the srv_master_callback. */
|
||||
|
||||
/** Iterations of the loop bounded by 'srv_active' label. */
|
||||
|
@ -695,7 +682,7 @@ static void srv_refresh_innodb_monitor_stats(time_t current_time)
|
|||
mysql_mutex_lock(&srv_innodb_monitor_mutex);
|
||||
|
||||
if (difftime(current_time, srv_last_monitor_time) < 60) {
|
||||
/* We referesh InnoDB Monitor values so that averages are
|
||||
/* We refresh InnoDB Monitor values so that averages are
|
||||
printed from at most 60 last seconds */
|
||||
mysql_mutex_unlock(&srv_innodb_monitor_mutex);
|
||||
return;
|
||||
|
@ -712,16 +699,6 @@ static void srv_refresh_innodb_monitor_stats(time_t current_time)
|
|||
|
||||
buf_refresh_io_stats();
|
||||
|
||||
srv_n_rows_inserted_old = srv_stats.n_rows_inserted;
|
||||
srv_n_rows_updated_old = srv_stats.n_rows_updated;
|
||||
srv_n_rows_deleted_old = srv_stats.n_rows_deleted;
|
||||
srv_n_rows_read_old = srv_stats.n_rows_read;
|
||||
|
||||
srv_n_system_rows_inserted_old = srv_stats.n_system_rows_inserted;
|
||||
srv_n_system_rows_updated_old = srv_stats.n_system_rows_updated;
|
||||
srv_n_system_rows_deleted_old = srv_stats.n_system_rows_deleted;
|
||||
srv_n_system_rows_read_old = srv_stats.n_system_rows_read;
|
||||
|
||||
mysql_mutex_unlock(&srv_innodb_monitor_mutex);
|
||||
}
|
||||
|
||||
|
@ -889,68 +866,7 @@ srv_printf_innodb_monitor(
|
|||
n_reserved);
|
||||
}
|
||||
|
||||
fprintf(file,
|
||||
"Process ID=" ULINTPF
|
||||
", Main thread ID=" ULINTPF
|
||||
", state: %s\n",
|
||||
srv_main_thread_process_no,
|
||||
srv_main_thread_id,
|
||||
srv_main_thread_op_info);
|
||||
fprintf(file,
|
||||
"Number of rows inserted " ULINTPF
|
||||
", updated " ULINTPF
|
||||
", deleted " ULINTPF
|
||||
", read " ULINTPF "\n",
|
||||
(ulint) srv_stats.n_rows_inserted,
|
||||
(ulint) srv_stats.n_rows_updated,
|
||||
(ulint) srv_stats.n_rows_deleted,
|
||||
(ulint) srv_stats.n_rows_read);
|
||||
fprintf(file,
|
||||
"%.2f inserts/s, %.2f updates/s,"
|
||||
" %.2f deletes/s, %.2f reads/s\n",
|
||||
static_cast<double>(srv_stats.n_rows_inserted
|
||||
- srv_n_rows_inserted_old)
|
||||
/ time_elapsed,
|
||||
static_cast<double>(srv_stats.n_rows_updated
|
||||
- srv_n_rows_updated_old)
|
||||
/ time_elapsed,
|
||||
static_cast<double>(srv_stats.n_rows_deleted
|
||||
- srv_n_rows_deleted_old)
|
||||
/ time_elapsed,
|
||||
static_cast<double>(srv_stats.n_rows_read
|
||||
- srv_n_rows_read_old)
|
||||
/ time_elapsed);
|
||||
fprintf(file,
|
||||
"Number of system rows inserted " ULINTPF
|
||||
", updated " ULINTPF ", deleted " ULINTPF
|
||||
", read " ULINTPF "\n",
|
||||
(ulint) srv_stats.n_system_rows_inserted,
|
||||
(ulint) srv_stats.n_system_rows_updated,
|
||||
(ulint) srv_stats.n_system_rows_deleted,
|
||||
(ulint) srv_stats.n_system_rows_read);
|
||||
fprintf(file,
|
||||
"%.2f inserts/s, %.2f updates/s,"
|
||||
" %.2f deletes/s, %.2f reads/s\n",
|
||||
static_cast<double>(srv_stats.n_system_rows_inserted
|
||||
- srv_n_system_rows_inserted_old)
|
||||
/ time_elapsed,
|
||||
static_cast<double>(srv_stats.n_system_rows_updated
|
||||
- srv_n_system_rows_updated_old)
|
||||
/ time_elapsed,
|
||||
static_cast<double>(srv_stats.n_system_rows_deleted
|
||||
- srv_n_system_rows_deleted_old)
|
||||
/ time_elapsed,
|
||||
static_cast<double>(srv_stats.n_system_rows_read
|
||||
- srv_n_system_rows_read_old)
|
||||
/ time_elapsed);
|
||||
srv_n_rows_inserted_old = srv_stats.n_rows_inserted;
|
||||
srv_n_rows_updated_old = srv_stats.n_rows_updated;
|
||||
srv_n_rows_deleted_old = srv_stats.n_rows_deleted;
|
||||
srv_n_rows_read_old = srv_stats.n_rows_read;
|
||||
srv_n_system_rows_inserted_old = srv_stats.n_system_rows_inserted;
|
||||
srv_n_system_rows_updated_old = srv_stats.n_system_rows_updated;
|
||||
srv_n_system_rows_deleted_old = srv_stats.n_system_rows_deleted;
|
||||
srv_n_system_rows_read_old = srv_stats.n_system_rows_read;
|
||||
fprintf(file, ", state: %s\n", srv_main_thread_op_info);
|
||||
|
||||
fputs("----------------------------\n"
|
||||
"END OF INNODB MONITOR OUTPUT\n"
|
||||
|
@ -1088,28 +1004,6 @@ srv_export_innodb_status(void)
|
|||
/ export_vars.innodb_row_lock_waits)
|
||||
: 0;
|
||||
|
||||
export_vars.innodb_rows_read = srv_stats.n_rows_read;
|
||||
|
||||
export_vars.innodb_rows_inserted = srv_stats.n_rows_inserted;
|
||||
|
||||
export_vars.innodb_rows_updated = srv_stats.n_rows_updated;
|
||||
|
||||
export_vars.innodb_rows_deleted = srv_stats.n_rows_deleted;
|
||||
|
||||
export_vars.innodb_system_rows_read = srv_stats.n_system_rows_read;
|
||||
|
||||
export_vars.innodb_system_rows_inserted =
|
||||
srv_stats.n_system_rows_inserted;
|
||||
|
||||
export_vars.innodb_system_rows_updated =
|
||||
srv_stats.n_system_rows_updated;
|
||||
|
||||
export_vars.innodb_system_rows_deleted =
|
||||
srv_stats.n_system_rows_deleted;
|
||||
|
||||
export_vars.innodb_truncated_status_writes =
|
||||
srv_truncated_status_writes;
|
||||
|
||||
export_vars.innodb_page_compression_saved = srv_stats.page_compression_saved;
|
||||
export_vars.innodb_pages_page_compressed = srv_stats.pages_page_compressed;
|
||||
export_vars.innodb_page_compressed_trim_op = srv_stats.page_compressed_trim_op;
|
||||
|
|
|
@ -208,14 +208,6 @@ innodb_dict_lru_count_idle server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NU
|
|||
innodb_dblwr_writes server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of doublewrite operations that have been performed (innodb_dblwr_writes)
|
||||
innodb_dblwr_pages_written server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of pages that have been written for doublewrite operations (innodb_dblwr_pages_written)
|
||||
innodb_page_size server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value InnoDB page size in bytes (innodb_page_size)
|
||||
dml_reads dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of rows read
|
||||
dml_inserts dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of rows inserted
|
||||
dml_deletes dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of rows deleted
|
||||
dml_updates dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of rows updated
|
||||
dml_system_reads dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of system rows read
|
||||
dml_system_inserts dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of system rows inserted
|
||||
dml_system_deletes dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of system rows deleted
|
||||
dml_system_updates dml 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of system rows updated
|
||||
ddl_background_drop_indexes ddl 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of indexes waiting to be dropped after failed index creation
|
||||
ddl_online_create_index ddl 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of indexes being created online
|
||||
ddl_pending_alter_table ddl 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of ALTER TABLE, CREATE INDEX, DROP INDEX in progress
|
||||
|
|
Loading…
Add table
Reference in a new issue