Type:
Bug
Priority:
Major
Resolution:
Unresolved
Affects Version/s:
5.5(EOL) , 10.0(EOL) , 10.1(EOL) , 10.2(EOL) , 10.3(EOL) , 10.4(EOL)
create table ten(a int primary key );
insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table one_k(a int primary key );
insert into one_k select A.a + B.a* 10 + C.a * 100 from ten A, ten B, ten C;
create table t1 (a varchar (750), b varchar (750));
insert into t1 select a,a from one_k;
create table t2 as select a from t1 limit 10;
create ALGORITHM=TEMPTABLE view v1 as select a,b from t1;
set optimizer_switch= 'derived_with_keys=on' ;
set join_cache_level=4;
explain select * from t1, v1 where t1.a=v1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 1000 Using where
1 PRIMARY <derived2> hash_ALL key0 #hash#key0 753 test.t1.a 1000 Using join buffer (flat, BNLH join)
2 DERIVED t1 ALL NULL NULL NULL NULL 1000
In the explain output we see for <derived2> key #hash#key0 , where key0 is the key on the derived table created by the derived_with_keys optimization.
If the keys on derived table are created and it is the best choice plan then we will always do a ref access on the derived table with key0 (key on derived table).
If the hash join is preferred then we need to drop the derived keys, we cannot perform hash join with these keys
relates to
MDEV-16307
Incorrect results when using BNLH join instead of BNL join with views
Closed
Transition
Time In Source Status
Execution Times
Open
In Progress
1d 15h 31m
1
In Progress
Stalled
1974d 21h 21m
1
{"report":{"fcp":787.3000001907349,"ttfb":176.70000004768372,"pageVisibility":"visible","entityId":68609,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"55b88d3f-0f02-47d7-9c16-bc32ef7fa3c1","navigationType":0,"readyForUser":866.2000000476837,"redirectCount":0,"resourceLoadedEnd":509.5,"resourceLoadedStart":189,"resourceTiming":[{"duration":19.800000190734863,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":189,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":189,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":208.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":21.100000143051147,"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":189.20000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":189.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":210.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":197.29999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":189.40000009536743,"connectEnd":189.40000009536743,"connectStart":189.40000009536743,"domainLookupEnd":189.40000009536743,"domainLookupStart":189.40000009536743,"fetchStart":189.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":215.90000009536743,"responseEnd":386.7000000476837,"responseStart":245.30000019073486,"secureConnectionStart":189.40000009536743},{"duration":319.89999985694885,"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":189.60000014305115,"connectEnd":189.60000014305115,"connectStart":189.60000014305115,"domainLookupEnd":189.60000014305115,"domainLookupStart":189.60000014305115,"fetchStart":189.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":216.10000014305115,"responseEnd":509.5,"responseStart":246.80000019073486,"secureConnectionStart":189.60000014305115},{"duration":60.5,"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":189.80000019073486,"connectEnd":189.80000019073486,"connectStart":189.80000019073486,"domainLookupEnd":189.80000019073486,"domainLookupStart":189.80000019073486,"fetchStart":189.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":216.30000019073486,"responseEnd":250.30000019073486,"responseStart":248.10000014305115,"secureConnectionStart":189.80000019073486},{"duration":60.59999990463257,"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":189.90000009536743,"connectEnd":189.90000009536743,"connectStart":189.90000009536743,"domainLookupEnd":189.90000009536743,"domainLookupStart":189.90000009536743,"fetchStart":189.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":216.60000014305115,"responseEnd":250.5,"responseStart":248.70000004768372,"secureConnectionStart":189.90000009536743},{"duration":63.5,"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":189.90000009536743,"connectEnd":189.90000009536743,"connectStart":189.90000009536743,"domainLookupEnd":189.90000009536743,"domainLookupStart":189.90000009536743,"fetchStart":189.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":220.10000014305115,"responseEnd":253.40000009536743,"responseStart":250.80000019073486,"secureConnectionStart":189.90000009536743},{"duration":25.40000009536743,"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":190,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":190,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":215.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":63.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":190.10000014305115,"connectEnd":190.10000014305115,"connectStart":190.10000014305115,"domainLookupEnd":190.10000014305115,"domainLookupStart":190.10000014305115,"fetchStart":190.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":221.30000019073486,"responseEnd":253.60000014305115,"responseStart":251.5,"secureConnectionStart":190.10000014305115},{"duration":27.40000009536743,"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":190.20000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":190.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":217.60000014305115,"responseStart":0,"secureConnectionStart":0},{"duration":68.70000004768372,"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":190.20000004768372,"connectEnd":190.20000004768372,"connectStart":190.20000004768372,"domainLookupEnd":190.20000004768372,"domainLookupStart":190.20000004768372,"fetchStart":190.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":222.40000009536743,"responseEnd":258.90000009536743,"responseStart":254,"secureConnectionStart":190.20000004768372},{"duration":269.2000000476837,"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.90000009536743,"connectEnd":190.90000009536743,"connectStart":190.90000009536743,"domainLookupEnd":190.90000009536743,"domainLookupStart":190.90000009536743,"fetchStart":190.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":235.80000019073486,"responseEnd":460.10000014305115,"responseStart":456.30000019073486,"secureConnectionStart":190.90000009536743},{"duration":269.59999990463257,"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.90000009536743,"connectEnd":190.90000009536743,"connectStart":190.90000009536743,"domainLookupEnd":190.90000009536743,"domainLookupStart":190.90000009536743,"fetchStart":190.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":246.30000019073486,"responseEnd":460.5,"responseStart":458,"secureConnectionStart":190.90000009536743},{"duration":98.39999985694885,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":535.6000001430511,"connectEnd":535.6000001430511,"connectStart":535.6000001430511,"domainLookupEnd":535.6000001430511,"domainLookupStart":535.6000001430511,"fetchStart":535.6000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":605,"responseEnd":634,"responseStart":633.3000001907349,"secureConnectionStart":535.6000001430511},{"duration":93.29999995231628,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":780.9000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":780.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":874.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":115.60000014305115,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":787.5,"connectEnd":787.5,"connectStart":787.5,"domainLookupEnd":787.5,"domainLookupStart":787.5,"fetchStart":787.5,"redirectEnd":0,"redirectStart":0,"requestStart":874.6000001430511,"responseEnd":903.1000001430511,"responseStart":902.4000000953674,"secureConnectionStart":787.5}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":13,"responseStart":177,"responseEnd":182,"domLoading":187,"domInteractive":956,"domContentLoadedEventStart":956,"domContentLoadedEventEnd":1001,"domComplete":1201,"loadEventStart":1201,"loadEventEnd":1201,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":936.2000000476837},{"name":"bigPipe.sidebar-id.end","time":936.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":937},{"name":"bigPipe.activity-panel-pipe-id.end","time":938},{"name":"activityTabFullyLoaded","time":1019.9000000953674}],"measures":[],"correlationId":"e4e3590de0d52d","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":77,"dbReadsTimeInMs":20,"dbConnsTimeInMs":27,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}