The attached lcase-discrepancies.sql shows characters for which the condition
(t1.a=t2.a) = (LCASE(t1.a)=LCASE(t2.a))
is not fulfilled. That means it is not possible to remove LCASE() for strings containing those characters.
Oleg Smirnov
added a comment - The attached lcase-discrepancies.sql shows characters for which the condition
(t1.a=t2.a) = (LCASE(t1.a)=LCASE(t2.a))
is not fulfilled. That means it is not possible to remove LCASE() for strings containing those characters.
bar suggested looking into the UCA 1400 collation. The attached script uca_1400_ucase.sql shows there are discrepancies in UCASE() comparisons while there are none for LCASE().
Since there are no discrepancies for LCASE(), it is possible to implement the optimization for columns having the uca_1400_ai_ci collation.
Another suggestion is having a constraint
CHECK(a=LCASE(a))
on the target column. The optimizer might check if there is such a constraint and apply the optimization. So the users willing this optimization applied must first add the constraints for target columns.
Oleg Smirnov
added a comment - - edited bar suggested looking into the UCA 1400 collation. The attached script uca_1400_ucase.sql shows there are discrepancies in UCASE() comparisons while there are none for LCASE().
Since there are no discrepancies for LCASE(), it is possible to implement the optimization for columns having the uca_1400_ai_ci collation.
Another suggestion is having a constraint
CHECK(a=LCASE(a))
on the target column. The optimizer might check if there is such a constraint and apply the optimization. So the users willing this optimization applied must first add the constraints for target columns.
One more complication: it is not enough for UCA 1400 to run one-character checks as they are in the script. Two- or three-character combinations may produce different weights for a single character depending on its position, so additional checks are required.
Oleg Smirnov
added a comment - One more complication: it is not enough for UCA 1400 to run one-character checks as they are in the script. Two- or three-character combinations may produce different weights for a single character depending on its position, so additional checks are required.
People
Oleg Smirnov
Sergei Golubchik
Votes:
0Vote for this issue
Watchers:
5Start watching this issue
Dates
Created:
Updated:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":971.8999996185303,"ttfb":253.69999980926514,"pageVisibility":"visible","entityId":124340,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"e86c4ee9-4b89-48f3-80a1-fa9414c64987","navigationType":0,"readyForUser":1114.2999992370605,"redirectCount":0,"resourceLoadedEnd":788.3999996185303,"resourceLoadedStart":266.3999996185303,"resourceTiming":[{"duration":50.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":266.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":266.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":317.0999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":50.69999980926514,"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":266.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":266.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":317.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":311.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":267.0999994277954,"connectEnd":267.0999994277954,"connectStart":267.0999994277954,"domainLookupEnd":267.0999994277954,"domainLookupStart":267.0999994277954,"fetchStart":267.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":319.3999996185303,"responseEnd":578.8999996185303,"responseStart":342.19999980926514,"secureConnectionStart":267.0999994277954},{"duration":428.69999980926514,"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":268.0999994277954,"connectEnd":268.0999994277954,"connectStart":268.0999994277954,"domainLookupEnd":268.0999994277954,"domainLookupStart":268.0999994277954,"fetchStart":268.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":319.79999923706055,"responseEnd":696.7999992370605,"responseStart":336,"secureConnectionStart":268.0999994277954},{"duration":81.60000038146973,"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":268.3999996185303,"connectEnd":268.3999996185303,"connectStart":268.3999996185303,"domainLookupEnd":268.3999996185303,"domainLookupStart":268.3999996185303,"fetchStart":268.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":319.8999996185303,"responseEnd":350,"responseStart":341.5,"secureConnectionStart":268.3999996185303},{"duration":93.5,"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":268.5,"connectEnd":268.5,"connectStart":268.5,"domainLookupEnd":268.5,"domainLookupStart":268.5,"fetchStart":268.5,"redirectEnd":0,"redirectStart":0,"requestStart":320.19999980926514,"responseEnd":362,"responseStart":354.19999980926514,"secureConnectionStart":268.5},{"duration":74.80000019073486,"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":268.69999980926514,"connectEnd":268.69999980926514,"connectStart":268.69999980926514,"domainLookupEnd":268.69999980926514,"domainLookupStart":268.69999980926514,"fetchStart":268.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":320.5,"responseEnd":343.5,"responseStart":340.79999923706055,"secureConnectionStart":268.69999980926514},{"duration":50.19999980926514,"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":268.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":268.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":319.0999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":92.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":269,"connectEnd":269,"connectStart":269,"domainLookupEnd":269,"domainLookupStart":269,"fetchStart":269,"redirectEnd":0,"redirectStart":0,"requestStart":320.5999994277954,"responseEnd":361.69999980926514,"responseStart":353,"secureConnectionStart":269},{"duration":50.30000019073486,"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":269.29999923706055,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":269.29999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":319.5999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":93,"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":269.3999996185303,"connectEnd":269.3999996185303,"connectStart":269.3999996185303,"domainLookupEnd":269.3999996185303,"domainLookupStart":269.3999996185303,"fetchStart":269.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":323.5999994277954,"responseEnd":362.3999996185303,"responseStart":356.0999994277954,"secureConnectionStart":269.3999996185303},{"duration":518.1000003814697,"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":270.29999923706055,"connectEnd":270.29999923706055,"connectStart":270.29999923706055,"domainLookupEnd":270.29999923706055,"domainLookupStart":270.29999923706055,"fetchStart":270.29999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":387.29999923706055,"responseEnd":788.3999996185303,"responseStart":777.5,"secureConnectionStart":270.29999923706055},{"duration":509.30000019073486,"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":270.3999996185303,"connectEnd":270.3999996185303,"connectStart":270.3999996185303,"domainLookupEnd":270.3999996185303,"domainLookupStart":270.3999996185303,"fetchStart":270.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":432.0999994277954,"responseEnd":779.6999998092651,"responseStart":772.7999992370605,"secureConnectionStart":270.3999996185303},{"duration":123.10000038146973,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":722.0999994277954,"connectEnd":722.0999994277954,"connectStart":722.0999994277954,"domainLookupEnd":722.0999994277954,"domainLookupStart":722.0999994277954,"fetchStart":722.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":804.0999994277954,"responseEnd":845.1999998092651,"responseStart":842.8999996185303,"secureConnectionStart":722.0999994277954},{"duration":229.9000005722046,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":964.7999992370605,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":964.7999992370605,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1194.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":262.19999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":987.5,"connectEnd":987.5,"connectStart":987.5,"domainLookupEnd":987.5,"domainLookupStart":987.5,"fetchStart":987.5,"redirectEnd":0,"redirectStart":0,"requestStart":1214.1999998092651,"responseEnd":1249.6999998092651,"responseStart":1249,"secureConnectionStart":987.5}],"fetchStart":0,"domainLookupStart":41,"domainLookupEnd":51,"connectStart":51,"connectEnd":71,"secureConnectionStart":60,"requestStart":72,"responseStart":254,"responseEnd":265,"domLoading":257,"domInteractive":1219,"domContentLoadedEventStart":1219,"domContentLoadedEventEnd":1284,"domComplete":1795,"loadEventStart":1795,"loadEventEnd":1795,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1172.3999996185303},{"name":"bigPipe.sidebar-id.end","time":1173.1999998092651},{"name":"bigPipe.activity-panel-pipe-id.start","time":1173.2999992370605},{"name":"bigPipe.activity-panel-pipe-id.end","time":1175},{"name":"activityTabFullyLoaded","time":1304.7999992370605}],"measures":[],"correlationId":"b2bfe61f657a8","effectiveType":"4g","downlink":9.3,"rtt":0,"serverDuration":106,"dbReadsTimeInMs":15,"dbConnsTimeInMs":24,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The attached lcase-discrepancies.sql shows characters for which the condition
(t1.a=t2.a) = (LCASE(t1.a)=LCASE(t2.a))
is not fulfilled. That means it is not possible to remove LCASE() for strings containing those characters.