create table t1 (start_date date, end_date date, filler char(100), key(start_date, end_date)) ;
|
source ~/fill-test.sql
|
create table t1 (start_date date, end_date date, filler char(100), key(start_date, end_date)) ;
|
insert into t1 select date_add(now(), interval a day), date_add(now(), interval (a+7) day), 'data' from one_k;
|
Query OK, 1000 rows affected, 2000 warnings (0.40 sec)
|
Records: 1000 Duplicates: 0 Warnings: 2000
|
mysql> set optimizer_trace=1;
|
mysql> explain format=json select * from t1 force index(start_date) where start_date >= '2019-02-10' and end_date <'2019-04-01';
|
| {
|
"query_block": {
|
"select_id": 1,
|
"table": {
|
"table_name": "t1",
|
"access_type": "range",
|
"possible_keys": ["start_date"],
|
"key": "start_date",
|
"key_length": "8",
|
"used_key_parts": ["start_date", "end_date"],
|
"rows": 1000,
|
"filtered": 100,
|
"index_condition": "t1.start_date >= '2019-02-10' and t1.end_date < '2019-04-01'"
|
}
|
}
|
}
|
Note that
"used_key_parts": ["start_date", "end_date"],
|
But due to a bug in append_range_all_keyparts near is_singlepoint() call the
printed range uses one key part:
"range_scan_alternatives": [
|
{
|
"index": "start_date",
|
"ranges": ["0x4ac60f <= start_date"],
|
"rowid_ordered": false,
|
"using_mrr": false,
|
"index_only": false,
|
"rows": 1000,
|
"cost": 1252.4,
|
"chosen": true
|
}
|
],
|
The fact that date is printed as 0x4ac60f is a separate bug and should also be
fixed.
{"report":{"fcp":914.4000005722046,"ttfb":271.20000076293945,"pageVisibility":"visible","entityId":72851,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"6105cd3f-de78-40dc-8f03-24c5c1592935","navigationType":0,"readyForUser":998.5,"redirectCount":0,"resourceLoadedEnd":602.5,"resourceLoadedStart":276.70000076293945,"resourceTiming":[{"duration":41,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":276.70000076293945,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":276.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":317.70000076293945,"responseStart":0,"secureConnectionStart":0},{"duration":41.09999942779541,"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":276.9000005722046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":276.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":318,"responseStart":0,"secureConnectionStart":0},{"duration":195.39999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":277.20000076293945,"connectEnd":277.20000076293945,"connectStart":277.20000076293945,"domainLookupEnd":277.20000076293945,"domainLookupStart":277.20000076293945,"fetchStart":277.20000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":319.80000019073486,"responseEnd":472.6000003814697,"responseStart":343,"secureConnectionStart":277.20000076293945},{"duration":325.19999980926514,"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":277.30000019073486,"connectEnd":277.30000019073486,"connectStart":277.30000019073486,"domainLookupEnd":277.30000019073486,"domainLookupStart":277.30000019073486,"fetchStart":277.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":322.9000005722046,"responseEnd":602.5,"responseStart":345.20000076293945,"secureConnectionStart":277.30000019073486},{"duration":77.90000057220459,"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":277.5,"connectEnd":277.5,"connectStart":277.5,"domainLookupEnd":277.5,"domainLookupStart":277.5,"fetchStart":277.5,"redirectEnd":0,"redirectStart":0,"requestStart":324.4000005722046,"responseEnd":355.4000005722046,"responseStart":348.4000005722046,"secureConnectionStart":277.5},{"duration":77.89999961853027,"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":277.70000076293945,"connectEnd":277.70000076293945,"connectStart":277.70000076293945,"domainLookupEnd":277.70000076293945,"domainLookupStart":277.70000076293945,"fetchStart":277.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":324.70000076293945,"responseEnd":355.6000003814697,"responseStart":351.30000019073486,"secureConnectionStart":277.70000076293945},{"duration":78,"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":277.9000005722046,"connectEnd":277.9000005722046,"connectStart":277.9000005722046,"domainLookupEnd":277.9000005722046,"domainLookupStart":277.9000005722046,"fetchStart":277.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":324.9000005722046,"responseEnd":355.9000005722046,"responseStart":351.80000019073486,"secureConnectionStart":277.9000005722046},{"duration":45.39999961853027,"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":278.1000003814697,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":278.1000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":323.5,"responseStart":0,"secureConnectionStart":0},{"duration":78.10000038146973,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":278.30000019073486,"connectEnd":278.30000019073486,"connectStart":278.30000019073486,"domainLookupEnd":278.30000019073486,"domainLookupStart":278.30000019073486,"fetchStart":278.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":327.30000019073486,"responseEnd":356.4000005722046,"responseStart":353.70000076293945,"secureConnectionStart":278.30000019073486},{"duration":45.70000076293945,"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":278.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":278.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":324.20000076293945,"responseStart":0,"secureConnectionStart":0},{"duration":80.30000019073486,"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":278.6000003814697,"connectEnd":278.6000003814697,"connectStart":278.6000003814697,"domainLookupEnd":278.6000003814697,"domainLookupStart":278.6000003814697,"fetchStart":278.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":327.9000005722046,"responseEnd":358.9000005722046,"responseStart":354.30000019073486,"secureConnectionStart":278.6000003814697},{"duration":316,"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":284,"connectEnd":284,"connectStart":284,"domainLookupEnd":284,"domainLookupStart":284,"fetchStart":284,"redirectEnd":0,"redirectStart":0,"requestStart":390.5,"responseEnd":600,"responseStart":593.6000003814697,"secureConnectionStart":284},{"duration":317.4000005722046,"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":284,"connectEnd":284,"connectStart":284,"domainLookupEnd":284,"domainLookupStart":284,"fetchStart":284,"redirectEnd":0,"redirectStart":0,"requestStart":434.5,"responseEnd":601.4000005722046,"responseStart":596.9000005722046,"secureConnectionStart":284},{"duration":90.59999942779541,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":623.2000007629395,"connectEnd":623.2000007629395,"connectStart":623.2000007629395,"domainLookupEnd":623.2000007629395,"domainLookupStart":623.2000007629395,"fetchStart":623.2000007629395,"redirectEnd":0,"redirectStart":0,"requestStart":677.8000001907349,"responseEnd":713.8000001907349,"responseStart":713,"secureConnectionStart":623.2000007629395},{"duration":233,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":833,"connectEnd":833,"connectStart":833,"domainLookupEnd":833,"domainLookupStart":833,"fetchStart":833,"redirectEnd":0,"redirectStart":0,"requestStart":1034.5,"responseEnd":1066,"responseStart":1065.2000007629395,"secureConnectionStart":833}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":75,"responseStart":271,"responseEnd":278,"domLoading":275,"domInteractive":1059,"domContentLoadedEventStart":1059,"domContentLoadedEventEnd":1107,"domComplete":1458,"loadEventStart":1458,"loadEventEnd":1459,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1038},{"name":"bigPipe.sidebar-id.end","time":1038.8000001907349},{"name":"bigPipe.activity-panel-pipe-id.start","time":1039},{"name":"bigPipe.activity-panel-pipe-id.end","time":1040.4000005722046},{"name":"activityTabFullyLoaded","time":1131.2000007629395}],"measures":[],"correlationId":"bd7ccf8a0a9e46","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":110,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Review feedback sent. There's still work to do.