Type:
Task
Priority:
Major
Resolution:
Unresolved
Fix Version/s:
None
Implicit system versioning (with implicit system fields) is almost unusable because versioned queries doe full table scan and there is no way to index them. F.ex. this:
create table t1(x int primary key ) with system versioning;
explain select * from t1 for system_time as of '2021-01-01 00:00:00' ;
explain select * from t1 for system_time from '2020-01-01 00:00:00' to '2021-01-01 00:00:00' ;
explain select * from t1 for system_time between '2020-01-01 00:00:00' and '2021-01-01 00:00:00' ;
drop table t1;
results in
explain select * from t1 for system_time as of '2021-01-01 00:00:00' ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using where
explain select * from t1 for system_time from '2020-01-01 00:00:00' to '2021-01-01 00:00:00' ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using where
explain select * from t1 for system_time between '2020-01-01 00:00:00' and '2021-01-01 00:00:00' ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using where
And when we add indexes:
create table t1(
x int primary key ,
row_start timestamp (6) as row start invisible,
row_end timestamp (6) as row end invisible,
index (row_start),
index (row_end),
period for system_time (row_start, row_end)
) with system versioning;
explain select * from t1 for system_time as of '2021-01-01 00:00:00' ;
explain select * from t1 for system_time from '2020-01-01 00:00:00' to '2021-01-01 00:00:00' ;
explain select * from t1 for system_time between '2020-01-01 00:00:00' and '2021-01-01 00:00:00' ;
drop table t1;
explain select * from t1 for system_time as of '2021-01-01 00:00:00' ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range row_start,row_end row_start 7 NULL 1 Using index condition; Using where
explain select * from t1 for system_time from '2020-01-01 00:00:00' to '2021-01-01 00:00:00' ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range row_start,row_end row_start 7 NULL 1 Using index condition; Using where
explain select * from t1 for system_time between '2020-01-01 00:00:00' and '2021-01-01 00:00:00' ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range row_start,row_end row_start 7 NULL 1 Using index condition; Using where
So adding default indexes by (row_start) and (row_end) actually is a good thing for any system versioned tables. While they are easily added in the second example it is may be not evident to a user, so probably CREATE TABLE should print a warning when no such indexes specified or maybe it should add them implicitly in any case.
No workflow transitions have been executed yet.
{"report":{"fcp":914.4000000953674,"ttfb":189.2999997138977,"pageVisibility":"visible","entityId":106077,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"3199a984-5e7c-4d8a-845e-c1a9faebcf50","navigationType":0,"readyForUser":985.5,"redirectCount":0,"resourceLoadedEnd":553.4000000953674,"resourceLoadedStart":202.69999980926514,"resourceTiming":[{"duration":15.099999904632568,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":202.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":202.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":217.7999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":15.199999809265137,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":202.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":202.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":218.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":273.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/b09d0d077992e4331b5f9ec0d3ec448c-CDN/lu2bsh/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":203.09999990463257,"connectEnd":203.09999990463257,"connectStart":203.09999990463257,"domainLookupEnd":203.09999990463257,"domainLookupStart":203.09999990463257,"fetchStart":203.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":221.90000009536743,"responseEnd":476.40000009536743,"responseStart":257.59999990463257,"secureConnectionStart":203.09999990463257},{"duration":349,"initiatorType":"script","name":"https://jira.mariadb.org/s/b47ab3df14096803b180217eb8482517-CDN/lu2bsh/820016/12ta74/eb142f92e4bd16bd1ef8b08c1b9d5d56/_/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":204.40000009536743,"connectEnd":204.40000009536743,"connectStart":204.40000009536743,"domainLookupEnd":204.40000009536743,"domainLookupStart":204.40000009536743,"fetchStart":204.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":222.2999997138977,"responseEnd":553.4000000953674,"responseStart":256.90000009536743,"secureConnectionStart":204.40000009536743},{"duration":55.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/6c569cbf8087ab04e40d0bef98627457-CDN/lu2bsh/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":204.5,"connectEnd":204.5,"connectStart":204.5,"domainLookupEnd":204.5,"domainLookupStart":204.5,"fetchStart":204.5,"redirectEnd":0,"redirectStart":0,"requestStart":222.5,"responseEnd":259.90000009536743,"responseStart":258.7999997138977,"secureConnectionStart":204.5},{"duration":65.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":204.5,"connectEnd":204.5,"connectStart":204.5,"domainLookupEnd":204.5,"domainLookupStart":204.5,"fetchStart":204.5,"redirectEnd":0,"redirectStart":0,"requestStart":222.69999980926514,"responseEnd":270.19999980926514,"responseStart":259.19999980926514,"secureConnectionStart":204.5},{"duration":74.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":204.69999980926514,"connectEnd":204.69999980926514,"connectStart":204.69999980926514,"domainLookupEnd":204.69999980926514,"domainLookupStart":204.69999980926514,"fetchStart":204.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":224.5,"responseEnd":279.2999997138977,"responseStart":277.7999997138977,"secureConnectionStart":204.69999980926514},{"duration":17.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bsh/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":204.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":204.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":222.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":110.39999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":204.90000009536743,"connectEnd":204.90000009536743,"connectStart":204.90000009536743,"domainLookupEnd":204.90000009536743,"domainLookupStart":204.90000009536743,"fetchStart":204.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":227.69999980926514,"responseEnd":315.2999997138977,"responseStart":314.09999990463257,"secureConnectionStart":204.90000009536743},{"duration":21.59999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bsh/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":205,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":205,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":226.59999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":75,"initiatorType":"script","name":"https://jira.mariadb.org/s/81b5d7c27af3ebc078cc4a36383678ba-CDN/lu2bsh/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":205.09999990463257,"connectEnd":205.09999990463257,"connectStart":205.09999990463257,"domainLookupEnd":205.09999990463257,"domainLookupStart":205.09999990463257,"fetchStart":205.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":228.19999980926514,"responseEnd":280.09999990463257,"responseStart":278.2999997138977,"secureConnectionStart":205.09999990463257},{"duration":31.199999809265137,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":207,"connectEnd":207,"connectStart":207,"domainLookupEnd":207,"domainLookupStart":207,"fetchStart":207,"redirectEnd":0,"redirectStart":0,"requestStart":207,"responseEnd":238.19999980926514,"responseStart":238.19999980926514,"secureConnectionStart":207},{"duration":40.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bsh/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":207,"connectEnd":207,"connectStart":207,"domainLookupEnd":207,"domainLookupStart":207,"fetchStart":207,"redirectEnd":0,"redirectStart":0,"requestStart":207,"responseEnd":247.59999990463257,"responseStart":247.59999990463257,"secureConnectionStart":207},{"duration":183.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":667.4000000953674,"connectEnd":667.4000000953674,"connectStart":667.4000000953674,"domainLookupEnd":667.4000000953674,"domainLookupStart":667.4000000953674,"fetchStart":667.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":818.5999999046326,"responseEnd":851,"responseStart":850.1999998092651,"secureConnectionStart":667.4000000953674}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":27,"responseStart":190,"responseEnd":207,"domLoading":193,"domInteractive":1046,"domContentLoadedEventStart":1046,"domContentLoadedEventEnd":1084,"domComplete":2268,"loadEventStart":2268,"loadEventEnd":2268,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1030.0999999046326},{"name":"bigPipe.sidebar-id.end","time":1030.7999997138977},{"name":"bigPipe.activity-panel-pipe-id.start","time":1031},{"name":"bigPipe.activity-panel-pipe-id.end","time":1031.5},{"name":"activityTabFullyLoaded","time":1090.7999997138977}],"measures":[],"correlationId":"aff1996c0d4ea4","effectiveType":"4g","downlink":9.3,"rtt":0,"serverDuration":69,"dbReadsTimeInMs":9,"dbConnsTimeInMs":15,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}