In the procedure below, SELECT COUNT takes clearly longer that 1 millisecond, however it is not interrupted.
MariaDB [test]> create table t1 (i int) engine=InnoDB;
|
Query OK, 0 rows affected (0.52 sec)
|
|
MariaDB [test]> insert into t1 values (1),(2),(3),(4);
|
Query OK, 4 rows affected (0.03 sec)
|
Records: 4 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> insert into t1 select a.* from t1 a, t1 b, t1 c, t1 d, t1 e, t1 f, t1 g;
|
Query OK, 16384 rows affected (4.21 sec)
|
Records: 16384 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]>
|
MariaDB [test]> delimiter |
|
MariaDB [test]> create procedure pr()
|
-> begin
|
-> select 1;
|
-> select sql_no_cache count(*) from t1;
|
-> select sql_no_cache count(*) from t1;
|
-> end |
|
Query OK, 0 rows affected (0.08 sec)
|
|
MariaDB [test]> delimiter ;
|
MariaDB [test]>
|
MariaDB [test]> set max_statement_time = 0.001;
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [test]> call pr();
|
+---+
|
| 1 |
|
+---+
|
| 1 |
|
+---+
|
1 row in set (0.00 sec)
|
|
+----------+
|
| count(*) |
|
+----------+
|
| 16388 |
|
+----------+
|
1 row in set (0.18 sec)
|
|
+----------+
|
| count(*) |
|
+----------+
|
| 16388 |
|
+----------+
|
1 row in set (0.36 sec)
|
|
Query OK, 0 rows affected (0.36 sec)
|
Compare with this:
MariaDB [test]> delimiter |
|
MariaDB [test]> create procedure pr2()
|
-> begin
|
-> select sql_no_cache count(*) from t1;
|
-> select sql_no_cache count(*) from t1;
|
-> end |
|
Query OK, 0 rows affected (0.06 sec)
|
|
MariaDB [test]> delimiter ;
|
MariaDB [test]>
|
MariaDB [test]> set max_statement_time = 0.001;
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [test]> call pr2();
|
ERROR 1968 (70100): Query execution was interrupted (max_statement_time exceeded)
|
I saw a comment in KB which says
MariaDB's can kill any queries (excluding stored procedures).
https://mariadb.com/kb/en/mariadb/documentation/optimization-and-tuning/query-optimizations/aborting-statements-that-exceed-than-a-certain-time-to-execute/
I'm not sure what it means, i.e. whether the whole procedure can't be measured and compared to MAX_STATEMENT_TIME, or any individual statement in the procedure cannot; in any case, the above examples show that the behavior is inconsistent.
{"report":{"fcp":870.8000000715256,"ttfb":338,"pageVisibility":"visible","entityId":48514,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"c53baf13-e31c-432a-9681-3eeb5597c83b","navigationType":0,"readyForUser":962,"redirectCount":0,"resourceLoadedEnd":1150.1000000238419,"resourceLoadedStart":343.40000009536743,"resourceTiming":[{"duration":7.899999976158142,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":343.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":343.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":351.3000000715256,"responseStart":0,"secureConnectionStart":0},{"duration":8.600000023841858,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":343.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":343.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":352.3000000715256,"responseStart":0,"secureConnectionStart":0},{"duration":61.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":344,"connectEnd":344,"connectStart":344,"domainLookupEnd":344,"domainLookupStart":344,"fetchStart":344,"redirectEnd":0,"redirectStart":0,"requestStart":344,"responseEnd":405.90000009536743,"responseStart":405.90000009536743,"secureConnectionStart":344},{"duration":149,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":344.10000002384186,"connectEnd":344.10000002384186,"connectStart":344.10000002384186,"domainLookupEnd":344.10000002384186,"domainLookupStart":344.10000002384186,"fetchStart":344.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":344.10000002384186,"responseEnd":493.10000002384186,"responseStart":493.10000002384186,"secureConnectionStart":344.10000002384186},{"duration":153.19999992847443,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":344.3000000715256,"connectEnd":344.3000000715256,"connectStart":344.3000000715256,"domainLookupEnd":344.3000000715256,"domainLookupStart":344.3000000715256,"fetchStart":344.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":344.3000000715256,"responseEnd":497.5,"responseStart":497.5,"secureConnectionStart":344.3000000715256},{"duration":153.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":344.40000009536743,"connectEnd":344.40000009536743,"connectStart":344.40000009536743,"domainLookupEnd":344.40000009536743,"domainLookupStart":344.40000009536743,"fetchStart":344.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":344.40000009536743,"responseEnd":498,"responseStart":498,"secureConnectionStart":344.40000009536743},{"duration":153.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":344.7000000476837,"connectEnd":344.7000000476837,"connectStart":344.7000000476837,"domainLookupEnd":344.7000000476837,"domainLookupStart":344.7000000476837,"fetchStart":344.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":344.7000000476837,"responseEnd":498.40000009536743,"responseStart":498.40000009536743,"secureConnectionStart":344.7000000476837},{"duration":206.19999992847443,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":344.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":344.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":551.1000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":153.80000007152557,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":345.10000002384186,"connectEnd":345.10000002384186,"connectStart":345.10000002384186,"domainLookupEnd":345.10000002384186,"domainLookupStart":345.10000002384186,"fetchStart":345.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":345.10000002384186,"responseEnd":498.90000009536743,"responseStart":498.90000009536743,"secureConnectionStart":345.10000002384186},{"duration":206.10000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/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":345.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":345.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":551.3000000715256,"responseStart":0,"secureConnectionStart":0},{"duration":154.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/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":345.40000009536743,"connectEnd":345.40000009536743,"connectStart":345.40000009536743,"domainLookupEnd":345.40000009536743,"domainLookupStart":345.40000009536743,"fetchStart":345.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":345.40000009536743,"responseEnd":499.5,"responseStart":499.5,"secureConnectionStart":345.40000009536743},{"duration":798,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":351.10000002384186,"connectEnd":351.10000002384186,"connectStart":351.10000002384186,"domainLookupEnd":351.10000002384186,"domainLookupStart":351.10000002384186,"fetchStart":351.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":351.10000002384186,"responseEnd":1149.1000000238419,"responseStart":1149.1000000238419,"secureConnectionStart":351.10000002384186},{"duration":798.8999999761581,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":351.2000000476837,"connectEnd":351.2000000476837,"connectStart":351.2000000476837,"domainLookupEnd":351.2000000476837,"domainLookupStart":351.2000000476837,"fetchStart":351.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":351.2000000476837,"responseEnd":1150.1000000238419,"responseStart":1150.1000000238419,"secureConnectionStart":351.2000000476837},{"duration":586.3000000715256,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":563.1000000238419,"connectEnd":563.1000000238419,"connectStart":563.1000000238419,"domainLookupEnd":563.1000000238419,"domainLookupStart":563.1000000238419,"fetchStart":563.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":563.1000000238419,"responseEnd":1149.4000000953674,"responseStart":1149.4000000953674,"secureConnectionStart":563.1000000238419},{"duration":292.10000002384186,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":864.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":864.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1156.8000000715256,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":97,"responseStart":338,"responseEnd":351,"domLoading":342,"domInteractive":1228,"domContentLoadedEventStart":1228,"domContentLoadedEventEnd":1269,"domComplete":1413,"loadEventStart":1413,"loadEventEnd":1413,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1211.7000000476837},{"name":"bigPipe.sidebar-id.end","time":1212.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1212.7000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":1213.5},{"name":"activityTabFullyLoaded","time":1284.5}],"measures":[],"correlationId":"512b105d3aeffc","effectiveType":"4g","downlink":9,"rtt":0,"serverDuration":168,"dbReadsTimeInMs":15,"dbConnsTimeInMs":25,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
revision-id: 6efaf349adec30115bdb94b9a9927f7c5103ed99
parent(s): 3e55ef26d49a900782d2c2bb2c03470faed6ec9d
committer: Oleksandr Byelkin
branch nick: server
timestamp: 2015-05-21 16:31:24 +0200
message:
MDEV-7011: MAX_STATEMENT_TIME has no effect in a procedure after a previous successful statementDo not reset timer inside stored procedures and functions.
—