According to https://dev.mysql.com/doc/refman/5.6/en/innodb-sys-tablestats-table.html (can't find the corresponding MariaDB documentation), the MODIFIED_COUNTER value in information_schema.INNODB_SYS_TABLESTATS is supposed to change on all DML operations. However, the value doesn't change when I issue an UPDATE on an InnoDB table:
MariaDB [baz]> SELECT `name`, `num_rows`, `modified_counter` FROM `information_schema`.`innodb_sys_tablestats` WHERE `name` = 'baz/foo';
|
+---------+----------+------------------+
|
| name | num_rows | modified_counter |
|
+---------+----------+------------------+
|
| baz/foo | 8 | 3 |
|
+---------+----------+------------------+
|
1 row in set (0.00 sec)
|
|
MariaDB [baz]> insert into foo (id, bar) values (1, '');
|
Query OK, 1 row affected (0.00 sec)
|
|
MariaDB [baz]> SELECT `name`, `num_rows`, `modified_counter` FROM `information_schema`.`innodb_sys_tablestats` WHERE `name` = 'baz/foo';
|
+---------+----------+------------------+
|
| name | num_rows | modified_counter |
|
+---------+----------+------------------+
|
| baz/foo | 9 | 4 |
|
+---------+----------+------------------+
|
1 row in set (0.00 sec)
|
|
MariaDB [baz]> update foo set bar='A' where id=1;
|
Query OK, 1 row affected (0.01 sec)
|
Rows matched: 1 Changed: 1 Warnings: 0
|
|
MariaDB [baz]> SELECT `name`, `num_rows`, `modified_counter` FROM `information_schema`.`innodb_sys_tablestats` WHERE `name` = 'baz/foo';
|
+---------+----------+------------------+
|
| name | num_rows | modified_counter |
|
+---------+----------+------------------+
|
| baz/foo | 9 | 4 |
|
+---------+----------+------------------+
|
1 row in set (0.00 sec)
|
|
MariaDB [baz]> update foo set bar='B' where id=1;
|
Query OK, 1 row affected (0.01 sec)
|
Rows matched: 1 Changed: 1 Warnings: 0
|
|
MariaDB [baz]> SELECT `name`, `num_rows`, `modified_counter` FROM `information_schema`.`innodb_sys_tablestats` WHERE `name` = 'baz/foo';
|
+---------+----------+------------------+
|
| name | num_rows | modified_counter |
|
+---------+----------+------------------+
|
| baz/foo | 9 | 4 |
|
+---------+----------+------------------+
|
1 row in set (0.00 sec)
|
|
MariaDB [baz]> delete from foo where id=1;
|
Query OK, 1 row affected (0.01 sec)
|
|
MariaDB [baz]> SELECT `name`, `num_rows`, `modified_counter` FROM `information_schema`.`innodb_sys_tablestats` WHERE `name` = 'baz/foo';
|
+---------+----------+------------------+
|
| name | num_rows | modified_counter |
|
+---------+----------+------------------+
|
| baz/foo | 8 | 5 |
|
+---------+----------+------------------+
|
1 row in set (0.00 sec)
|
I was expecting modified_counter to also change on the UPDATE statements.
I'm trying to use these two values to emulate CHECKSUM TABLE foo QUICK; from MyISAM, to monitor for data changes to an InnoDB table.
{"report":{"fcp":649.9000000953674,"ttfb":182.29999995231628,"pageVisibility":"visible","entityId":51683,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"c5466f4e-b2f0-4eb3-92f9-c0c8e690a7b7","navigationType":0,"readyForUser":712.1000001430511,"redirectCount":0,"resourceLoadedEnd":642.7999999523163,"resourceLoadedStart":187.79999995231628,"resourceTiming":[{"duration":3.9000000953674316,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":187.79999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":187.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":191.70000004768372,"responseStart":0,"secureConnectionStart":0},{"duration":3.6999998092651367,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":188.10000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":188.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":191.79999995231628,"responseStart":0,"secureConnectionStart":0},{"duration":60.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":188.20000004768372,"connectEnd":188.20000004768372,"connectStart":188.20000004768372,"domainLookupEnd":188.20000004768372,"domainLookupStart":188.20000004768372,"fetchStart":188.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":188.20000004768372,"responseEnd":248.60000014305115,"responseStart":248.60000014305115,"secureConnectionStart":188.20000004768372},{"duration":135.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":188.29999995231628,"connectEnd":188.29999995231628,"connectStart":188.29999995231628,"domainLookupEnd":188.29999995231628,"domainLookupStart":188.29999995231628,"fetchStart":188.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":188.29999995231628,"responseEnd":323.7000000476837,"responseStart":323.7000000476837,"secureConnectionStart":188.29999995231628},{"duration":139.39999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":188.40000009536743,"connectEnd":188.40000009536743,"connectStart":188.40000009536743,"domainLookupEnd":188.40000009536743,"domainLookupStart":188.40000009536743,"fetchStart":188.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":188.40000009536743,"responseEnd":327.7999999523163,"responseStart":327.7999999523163,"secureConnectionStart":188.40000009536743},{"duration":139.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":188.40000009536743,"connectEnd":188.40000009536743,"connectStart":188.40000009536743,"domainLookupEnd":188.40000009536743,"domainLookupStart":188.40000009536743,"fetchStart":188.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":188.40000009536743,"responseEnd":328.2000000476837,"responseStart":328.2000000476837,"secureConnectionStart":188.40000009536743},{"duration":140,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":188.5,"connectEnd":188.5,"connectStart":188.5,"domainLookupEnd":188.5,"domainLookupStart":188.5,"fetchStart":188.5,"redirectEnd":0,"redirectStart":0,"requestStart":188.5,"responseEnd":328.5,"responseStart":328.5,"secureConnectionStart":188.5},{"duration":140.29999995231628,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":188.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":188.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":329,"responseStart":0,"secureConnectionStart":0},{"duration":140.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":188.70000004768372,"connectEnd":188.70000004768372,"connectStart":188.70000004768372,"domainLookupEnd":188.70000004768372,"domainLookupStart":188.70000004768372,"fetchStart":188.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":188.70000004768372,"responseEnd":329,"responseStart":329,"secureConnectionStart":188.70000004768372},{"duration":140.39999985694885,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":188.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":188.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":329.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":140.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":189,"connectEnd":189,"connectStart":189,"domainLookupEnd":189,"domainLookupStart":189,"fetchStart":189,"redirectEnd":0,"redirectStart":0,"requestStart":189,"responseEnd":329.5,"responseStart":329.40000009536743,"secureConnectionStart":189},{"duration":442.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":190.20000004768372,"connectEnd":190.20000004768372,"connectStart":190.20000004768372,"domainLookupEnd":190.20000004768372,"domainLookupStart":190.20000004768372,"fetchStart":190.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":190.20000004768372,"responseEnd":633.1000001430511,"responseStart":633.1000001430511,"secureConnectionStart":190.20000004768372},{"duration":452.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":190.29999995231628,"connectEnd":190.29999995231628,"connectStart":190.29999995231628,"domainLookupEnd":190.29999995231628,"domainLookupStart":190.29999995231628,"fetchStart":190.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":190.29999995231628,"responseEnd":642.7999999523163,"responseStart":642.7000000476837,"secureConnectionStart":190.29999995231628},{"duration":177.79999995231628,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":459.60000014305115,"connectEnd":459.60000014305115,"connectStart":459.60000014305115,"domainLookupEnd":459.60000014305115,"domainLookupStart":459.60000014305115,"fetchStart":459.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":459.60000014305115,"responseEnd":637.4000000953674,"responseStart":637.4000000953674,"secureConnectionStart":459.60000014305115},{"duration":18.59999990463257,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":628.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":628.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":647.5,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":21,"responseStart":182,"responseEnd":184,"domLoading":186,"domInteractive":824,"domContentLoadedEventStart":824,"domContentLoadedEventEnd":865,"domComplete":1864,"loadEventStart":1864,"loadEventEnd":1866,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":806.6000001430511},{"name":"bigPipe.sidebar-id.end","time":807.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.start","time":807.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":809.7999999523163},{"name":"activityTabFullyLoaded","time":873.2000000476837}],"measures":[],"correlationId":"bff8d6698cb9a8","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":82,"dbReadsTimeInMs":22,"dbConnsTimeInMs":28,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}