Deterministic expression is an expression that doesn't use non-deterministic functions.
Non-deterministic function is a function that for equal input sets returns the same result set.
E.g.: LENGTH() function of VARCHAR fields.
'a' = 'a '
But
LENGTH('a') = 1 != 2 = LENGTH('a ')
So, for equal input variables LENGTH() function returns different results.
Therefore, LENGTH() of VARCHARs is non-deterministic.
This task is a subtask for MDEV-11588.
Non-deterministic expressions of GROUP BY fields are not functionally dependent on GROUP BY fields. Therefore, can't be used in SELECT list, HAVING and ORDER BY clauses.
Attachments
Issue Links
is part of
MDEV-11588Support for ONLY_FULL_GROUP_BY functional dependency
I don't think that's what "non-deterministic" usually means.
According to the SQL standard (2016, part 2, section 4.22 Determinism):
In general, an operation is deterministic if that operation assuredly computes identical results when repeated with identical input values.
"Identical" is stronger than "equal", in particular "a" and "a " are not identical, even if they compare as equal.
Being deterministic is an important property, used in generated columns (only deterministic expressions can be used, if the result is stored persistently) and in the optimizer (an index can be used only if the lookup value is deterministic).
Could you please find some other term for the property you're interested in?
Sergei Golubchik
added a comment - - edited I don't think that's what "non-deterministic" usually means.
According to the SQL standard (2016, part 2, section 4.22 Determinism):
In general, an operation is deterministic if that operation assuredly computes identical results when repeated with identical input values.
"Identical" is stronger than "equal", in particular "a" and "a " are not identical, even if they compare as equal.
Being deterministic is an important property, used in generated columns (only deterministic expressions can be used, if the result is stored persistently) and in the optimizer (an index can be used only if the lookup value is deterministic).
Could you please find some other term for the property you're interested in?
WIll you consider deterministic stored functions that are declared as DETERMINISTIC? Currently that flag is ignored in all contexts as far as I know.
Federico Razzoli
added a comment - WIll you consider deterministic stored functions that are declared as DETERMINISTIC? Currently that flag is ignored in all contexts as far as I know.
People
Sergei Golubchik
Galina Shalygina (Inactive)
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":781.7000000476837,"ttfb":168.90000009536743,"pageVisibility":"visible","entityId":78819,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"1c71d134-2a6b-450f-80a3-678efc245d37","navigationType":0,"readyForUser":841.7999999523163,"redirectCount":0,"resourceLoadedEnd":523,"resourceLoadedStart":178.70000004768372,"resourceTiming":[{"duration":9.200000047683716,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":178.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":178.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":187.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":9.400000095367432,"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":179,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":179,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":188.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":204.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":179.09999990463257,"connectEnd":179.09999990463257,"connectStart":179.09999990463257,"domainLookupEnd":179.09999990463257,"domainLookupStart":179.09999990463257,"fetchStart":179.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":193.59999990463257,"responseEnd":383.59999990463257,"responseStart":207.29999995231628,"secureConnectionStart":179.09999990463257},{"duration":343.2000000476837,"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":179.79999995231628,"connectEnd":179.79999995231628,"connectStart":179.79999995231628,"domainLookupEnd":179.79999995231628,"domainLookupStart":179.79999995231628,"fetchStart":179.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":195.29999995231628,"responseEnd":523,"responseStart":220.09999990463257,"secureConnectionStart":179.79999995231628},{"duration":41.700000047683716,"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":180,"connectEnd":180,"connectStart":180,"domainLookupEnd":180,"domainLookupStart":180,"fetchStart":180,"redirectEnd":0,"redirectStart":0,"requestStart":195.59999990463257,"responseEnd":221.70000004768372,"responseStart":215.70000004768372,"secureConnectionStart":180},{"duration":41.700000047683716,"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":180.09999990463257,"connectEnd":180.09999990463257,"connectStart":180.09999990463257,"domainLookupEnd":180.09999990463257,"domainLookupStart":180.09999990463257,"fetchStart":180.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":195.79999995231628,"responseEnd":221.79999995231628,"responseStart":216.70000004768372,"secureConnectionStart":180.09999990463257},{"duration":14.200000047683716,"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":180.20000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":180.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":194.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":41.89999985694885,"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":180.20000004768372,"connectEnd":180.20000004768372,"connectStart":180.20000004768372,"domainLookupEnd":180.20000004768372,"domainLookupStart":180.20000004768372,"fetchStart":180.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":195.90000009536743,"responseEnd":222.09999990463257,"responseStart":217.90000009536743,"secureConnectionStart":180.20000004768372},{"duration":43.200000047683716,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":180.29999995231628,"connectEnd":180.29999995231628,"connectStart":180.29999995231628,"domainLookupEnd":180.29999995231628,"domainLookupStart":180.29999995231628,"fetchStart":180.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":196,"responseEnd":223.5,"responseStart":219,"secureConnectionStart":180.29999995231628},{"duration":14.899999856948853,"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":180.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":180.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":195.29999995231628,"responseStart":0,"secureConnectionStart":0},{"duration":43.5,"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":180.5,"connectEnd":180.5,"connectStart":180.5,"domainLookupEnd":180.5,"domainLookupStart":180.5,"fetchStart":180.5,"redirectEnd":0,"redirectStart":0,"requestStart":197.09999990463257,"responseEnd":224,"responseStart":222.70000004768372,"secureConnectionStart":180.5},{"duration":302,"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":181.29999995231628,"connectEnd":181.29999995231628,"connectStart":181.29999995231628,"domainLookupEnd":181.29999995231628,"domainLookupStart":181.29999995231628,"fetchStart":181.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":231.5,"responseEnd":483.2999999523163,"responseStart":481,"secureConnectionStart":181.29999995231628},{"duration":303.10000014305115,"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":182.09999990463257,"connectEnd":182.09999990463257,"connectStart":182.09999990463257,"domainLookupEnd":182.09999990463257,"domainLookupStart":182.09999990463257,"fetchStart":182.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":231.90000009536743,"responseEnd":485.2000000476837,"responseStart":481.7000000476837,"secureConnectionStart":182.09999990463257},{"duration":86,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":523.4000000953674,"connectEnd":523.4000000953674,"connectStart":523.4000000953674,"domainLookupEnd":523.4000000953674,"domainLookupStart":523.4000000953674,"fetchStart":523.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":577.9000000953674,"responseEnd":609.4000000953674,"responseStart":608.5999999046326,"secureConnectionStart":523.4000000953674},{"duration":197,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":740.2999999523163,"connectEnd":740.2999999523163,"connectStart":740.2999999523163,"domainLookupEnd":740.2999999523163,"domainLookupStart":740.2999999523163,"fetchStart":740.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":904.9000000953674,"responseEnd":937.2999999523163,"responseStart":935.2999999523163,"secureConnectionStart":740.2999999523163},{"duration":161.09999990463257,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":774.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":774.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":935.7999999523163,"responseStart":0,"secureConnectionStart":0}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":31,"responseStart":169,"responseEnd":182,"domLoading":173,"domInteractive":923,"domContentLoadedEventStart":923,"domContentLoadedEventEnd":965,"domComplete":1189,"loadEventStart":1189,"loadEventEnd":1190,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":902.5999999046326},{"name":"bigPipe.sidebar-id.end","time":903.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.start","time":903.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":904.7000000476837},{"name":"activityTabFullyLoaded","time":984.5}],"measures":[],"correlationId":"4d6ee1238b50e8","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":81,"dbReadsTimeInMs":9,"dbConnsTimeInMs":16,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
I don't think that's what "non-deterministic" usually means.
According to the SQL standard (2016, part 2, section 4.22 Determinism):
"Identical" is stronger than "equal", in particular "a" and "a " are not identical, even if they compare as equal.
Being deterministic is an important property, used in generated columns (only deterministic expressions can be used, if the result is stored persistently) and in the optimizer (an index can be used only if the lookup value is deterministic).
Could you please find some other term for the property you're interested in?