The InnoDB hash table implementation defines the macros HASH_SEARCH, HASH_INSERT, and HASH_DELETE. Often, a HASH_SEARCH operation would already navigate to the correct hash bucket and to the correct position for a subsequent insert or delete operation. This effort will be wasted, because there is no way for HASH_INSERT or HASH_DELETE to refer to that position.
Similar to what was done to buf_pool.page_hash in MDEV-26826, we had better replace these macros with something more efficient, basically passing some kind of "iterator" from a search operation to the insert or delete operations.
{"report":{"fcp":1653.6000000238419,"ttfb":530.9000000953674,"pageVisibility":"visible","entityId":131254,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"81b98b38-14fa-43d8-b747-66e5c228453d","navigationType":0,"readyForUser":1752.7000000476837,"redirectCount":0,"resourceLoadedEnd":2184.7000000476837,"resourceLoadedStart":537.1000000238419,"resourceTiming":[{"duration":531.1000000238419,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":537.1000000238419,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":537.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1068.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":531.2999999523163,"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":537.3000000715256,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":537.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1068.6000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":596.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":537.5,"connectEnd":537.5,"connectStart":537.5,"domainLookupEnd":537.5,"domainLookupStart":537.5,"fetchStart":537.5,"redirectEnd":0,"redirectStart":0,"requestStart":537.5,"responseEnd":1134,"responseStart":1134,"secureConnectionStart":537.5},{"duration":731.8999999761581,"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":537.7000000476837,"connectEnd":537.7000000476837,"connectStart":537.7000000476837,"domainLookupEnd":537.7000000476837,"domainLookupStart":537.7000000476837,"fetchStart":537.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":537.7000000476837,"responseEnd":1269.6000000238419,"responseStart":1269.6000000238419,"secureConnectionStart":537.7000000476837},{"duration":736.5999999046326,"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":537.9000000953674,"connectEnd":537.9000000953674,"connectStart":537.9000000953674,"domainLookupEnd":537.9000000953674,"domainLookupStart":537.9000000953674,"fetchStart":537.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":537.9000000953674,"responseEnd":1274.5,"responseStart":1274.5,"secureConnectionStart":537.9000000953674},{"duration":737,"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":538.1000000238419,"connectEnd":538.1000000238419,"connectStart":538.1000000238419,"domainLookupEnd":538.1000000238419,"domainLookupStart":538.1000000238419,"fetchStart":538.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":538.1000000238419,"responseEnd":1275.1000000238419,"responseStart":1275,"secureConnectionStart":538.1000000238419},{"duration":741.8999999761581,"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":538.3000000715256,"connectEnd":538.3000000715256,"connectStart":538.3000000715256,"domainLookupEnd":538.3000000715256,"domainLookupStart":538.3000000715256,"fetchStart":538.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":538.3000000715256,"responseEnd":1280.2000000476837,"responseStart":1280.2000000476837,"secureConnectionStart":538.3000000715256},{"duration":772,"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":538.4000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":538.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1310.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":742.6000000238419,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":538.6000000238419,"connectEnd":538.6000000238419,"connectStart":538.6000000238419,"domainLookupEnd":538.6000000238419,"domainLookupStart":538.6000000238419,"fetchStart":538.6000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":538.6000000238419,"responseEnd":1281.2000000476837,"responseStart":1281.2000000476837,"secureConnectionStart":538.6000000238419},{"duration":771.6999999284744,"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":538.8000000715256,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":538.8000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1310.5,"responseStart":0,"secureConnectionStart":0},{"duration":750.8999999761581,"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":538.9000000953674,"connectEnd":538.9000000953674,"connectStart":538.9000000953674,"domainLookupEnd":538.9000000953674,"domainLookupStart":538.9000000953674,"fetchStart":538.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":538.9000000953674,"responseEnd":1289.8000000715256,"responseStart":1289.8000000715256,"secureConnectionStart":538.9000000953674},{"duration":1219.8999999761581,"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":548.1000000238419,"connectEnd":548.1000000238419,"connectStart":548.1000000238419,"domainLookupEnd":548.1000000238419,"domainLookupStart":548.1000000238419,"fetchStart":548.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":548.1000000238419,"responseEnd":1768,"responseStart":1768,"secureConnectionStart":548.1000000238419},{"duration":1636.5,"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":548.2000000476837,"connectEnd":548.2000000476837,"connectStart":548.2000000476837,"domainLookupEnd":548.2000000476837,"domainLookupStart":548.2000000476837,"fetchStart":548.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":548.2000000476837,"responseEnd":2184.7000000476837,"responseStart":2184.7000000476837,"secureConnectionStart":548.2000000476837},{"duration":479.1999999284744,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1324.3000000715256,"connectEnd":1324.3000000715256,"connectStart":1324.3000000715256,"domainLookupEnd":1324.3000000715256,"domainLookupStart":1324.3000000715256,"fetchStart":1324.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":1324.3000000715256,"responseEnd":1803.5,"responseStart":1803.5,"secureConnectionStart":1324.3000000715256},{"duration":621.2999999523163,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1641.8000000715256,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1641.8000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2263.100000023842,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":374,"responseStart":531,"responseEnd":538,"domLoading":535,"domInteractive":2216,"domContentLoadedEventStart":2216,"domContentLoadedEventEnd":2260,"domComplete":3030,"loadEventStart":3030,"loadEventEnd":3031,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2187.9000000953674},{"name":"bigPipe.sidebar-id.end","time":2188.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":2189.100000023842},{"name":"bigPipe.activity-panel-pipe-id.end","time":2190.4000000953674},{"name":"activityTabFullyLoaded","time":2275.9000000953674}],"measures":[],"correlationId":"5a0c4c5ded4996","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":101,"dbReadsTimeInMs":17,"dbConnsTimeInMs":27,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
I am done reviewing the current patch. The changes look functionally correct to me and the improvement points are good.
One not so good observation is that we are losing our grip on hash table abstraction with hash operations being directly coded when one is using a hash table. I think the key improvement points can be incorporated with a better hash table abstraction.