JSON data type directly contradicts SQL standard, that says, that JSON_* functions take a string as an argument.
Also, speed-wise MariaDB does not need binary JSON, according to our benchmarks, our JSON parser is as fast on text JSON as MySQL on binary JSON.
That is, in MariaDB one could VARCHAR or TEXT for JSON. If a validation is needed, one can do it with a CHECK constraint:
my_json_column TEXT CHECK (JSON_VALID(my_json_column))
We'll add JSON "type" for MySQL compatibility, though.
Sergei Golubchik
added a comment - JSON data type directly contradicts SQL standard, that says, that JSON_* functions take a string as an argument.
Also, speed-wise MariaDB does not need binary JSON, according to our benchmarks, our JSON parser is as fast on text JSON as MySQL on binary JSON.
That is, in MariaDB one could VARCHAR or TEXT for JSON. If a validation is needed, one can do it with a CHECK constraint:
my_json_column TEXT CHECK (JSON_VALID(my_json_column))
We'll add JSON "type" for MySQL compatibility, though.
Wouldn't a binary JSON type be even faster and additionally more efficiënt when it comes to storage? It just seems more clean to me.
Steven WdV
added a comment - Wouldn't a binary JSON type be even faster and additionally more efficiënt when it comes to storage? It just seems more clean to me.
Yes, it might be faster (or not, you never know). But see above — our json functions are already fast (MySQL got ~50x speedup on binary vs text json, our json functions are as fast on text as MySQL json functions on binary *)); and binary json type directly violates the SQL standard.
We've used SQL standard approach to JSON, and implemented it to be fast without resorting to binary format.
*) results from our entirely non-scientific benchmarks
Sergei Golubchik
added a comment - Yes, it might be faster (or not, you never know). But see above — our json functions are already fast (MySQL got ~50x speedup on binary vs text json, our json functions are as fast on text as MySQL json functions on binary *) ); and binary json type directly violates the SQL standard.
We've used SQL standard approach to JSON, and implemented it to be fast without resorting to binary format.
*) results from our entirely non-scientific benchmarks
I'm afraid not, they were very ad-hoc, the point was not to get exact numbers, but to steer the development-in-progress.
I've created MDEV-13777, to do proper benchmarks that can be published.
Sergei Golubchik
added a comment - I'm afraid not, they were very ad-hoc, the point was not to get exact numbers, but to steer the development-in-progress.
I've created MDEV-13777 , to do proper benchmarks that can be published.
People
Sergei Golubchik
Sergei Golubchik
Votes:
13Vote for this issue
Watchers:
13Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":1376.1999998092651,"ttfb":455.90000009536743,"pageVisibility":"visible","entityId":54220,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"29ee5136-7b13-4e35-b84a-6a8236c6da8a","navigationType":0,"readyForUser":1469.0999999046326,"redirectCount":0,"resourceLoadedEnd":1685.1999998092651,"resourceLoadedStart":491.7999997138977,"resourceTiming":[{"duration":301.30000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":491.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":491.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":793.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":302,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":492.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":492.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":794.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":366.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":492.19999980926514,"connectEnd":492.19999980926514,"connectStart":492.19999980926514,"domainLookupEnd":492.19999980926514,"domainLookupStart":492.19999980926514,"fetchStart":492.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":492.19999980926514,"responseEnd":858.6999998092651,"responseStart":858.6999998092651,"secureConnectionStart":492.19999980926514},{"duration":491.2999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/s/c32eb0da7ad9831253f8397e6cc26afd-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":492.5,"connectEnd":492.5,"connectStart":492.5,"domainLookupEnd":492.5,"domainLookupStart":492.5,"fetchStart":492.5,"redirectEnd":0,"redirectStart":0,"requestStart":492.5,"responseEnd":983.7999997138977,"responseStart":983.7999997138977,"secureConnectionStart":492.5},{"duration":495.2000002861023,"initiatorType":"script","name":"https://jira.mariadb.org/s/bc0bcb146314416123c992714ee00ff7-CDN/lu2bv2/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":492.69999980926514,"connectEnd":492.69999980926514,"connectStart":492.69999980926514,"domainLookupEnd":492.69999980926514,"domainLookupStart":492.69999980926514,"fetchStart":492.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":492.69999980926514,"responseEnd":987.9000000953674,"responseStart":987.9000000953674,"secureConnectionStart":492.69999980926514},{"duration":495.2999997138977,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":493,"connectEnd":493,"connectStart":493,"domainLookupEnd":493,"domainLookupStart":493,"fetchStart":493,"redirectEnd":0,"redirectStart":0,"requestStart":493,"responseEnd":988.2999997138977,"responseStart":988.2999997138977,"secureConnectionStart":493},{"duration":495.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":493.09999990463257,"connectEnd":493.09999990463257,"connectStart":493.09999990463257,"domainLookupEnd":493.09999990463257,"domainLookupStart":493.09999990463257,"fetchStart":493.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":493.09999990463257,"responseEnd":988.6999998092651,"responseStart":988.6999998092651,"secureConnectionStart":493.09999990463257},{"duration":516.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bv2/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":493.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":493.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1009.7999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":495.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":493.5,"connectEnd":493.5,"connectStart":493.5,"domainLookupEnd":493.5,"domainLookupStart":493.5,"fetchStart":493.5,"redirectEnd":0,"redirectStart":0,"requestStart":493.5,"responseEnd":989.1999998092651,"responseStart":989.1999998092651,"secureConnectionStart":493.5},{"duration":516.3000001907349,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bv2/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":493.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":493.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1010,"responseStart":0,"secureConnectionStart":0},{"duration":496,"initiatorType":"script","name":"https://jira.mariadb.org/s/719848dd97ebe0663199f49a3936487a-CDN/lu2bv2/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":493.7999997138977,"connectEnd":493.7999997138977,"connectStart":493.7999997138977,"domainLookupEnd":493.7999997138977,"domainLookupStart":493.7999997138977,"fetchStart":493.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":493.7999997138977,"responseEnd":989.7999997138977,"responseStart":989.7999997138977,"secureConnectionStart":493.7999997138977},{"duration":644.6999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":495.09999990463257,"connectEnd":495.09999990463257,"connectStart":495.09999990463257,"domainLookupEnd":495.09999990463257,"domainLookupStart":495.09999990463257,"fetchStart":495.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":495.09999990463257,"responseEnd":1139.7999997138977,"responseStart":1139.7999997138977,"secureConnectionStart":495.09999990463257},{"duration":1181.1999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":495.09999990463257,"connectEnd":495.09999990463257,"connectStart":495.09999990463257,"domainLookupEnd":495.09999990463257,"domainLookupStart":495.09999990463257,"fetchStart":495.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":495.09999990463257,"responseEnd":1676.2999997138977,"responseStart":1676.2999997138977,"secureConnectionStart":495.09999990463257},{"duration":108.39999961853027,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1031.9000000953674,"connectEnd":1031.9000000953674,"connectStart":1031.9000000953674,"domainLookupEnd":1031.9000000953674,"domainLookupStart":1031.9000000953674,"fetchStart":1031.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1031.9000000953674,"responseEnd":1140.2999997138977,"responseStart":1140.2999997138977,"secureConnectionStart":1031.9000000953674},{"duration":359.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bv2/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":1317.7999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1317.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1677.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":358.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":1318.9000000953674,"connectEnd":1318.9000000953674,"connectStart":1318.9000000953674,"domainLookupEnd":1318.9000000953674,"domainLookupStart":1318.9000000953674,"fetchStart":1318.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1318.9000000953674,"responseEnd":1677.5,"responseStart":1677.5,"secureConnectionStart":1318.9000000953674},{"duration":365.90000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/53a43b6764f587426c7bb9a150184c00-CDN/lu2bv2/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":1319.2999997138977,"connectEnd":1319.2999997138977,"connectStart":1319.2999997138977,"domainLookupEnd":1319.2999997138977,"domainLookupStart":1319.2999997138977,"fetchStart":1319.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":1319.2999997138977,"responseEnd":1685.1999998092651,"responseStart":1685.1999998092651,"secureConnectionStart":1319.2999997138977}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":285,"responseStart":456,"responseEnd":458,"domLoading":489,"domInteractive":1750,"domContentLoadedEventStart":1750,"domContentLoadedEventEnd":1792,"domComplete":2662,"loadEventStart":2662,"loadEventEnd":2663,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1684.5999999046326},{"name":"bigPipe.sidebar-id.end","time":1685.5},{"name":"bigPipe.activity-panel-pipe-id.start","time":1685.5999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":1687.7999997138977},{"name":"activityTabFullyLoaded","time":1817.4000000953674}],"measures":[],"correlationId":"76904b110321fa","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":114,"dbReadsTimeInMs":18,"dbConnsTimeInMs":28,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
JSON data type directly contradicts SQL standard, that says, that JSON_* functions take a string as an argument.
Also, speed-wise MariaDB does not need binary JSON, according to our benchmarks, our JSON parser is as fast on text JSON as MySQL on binary JSON.
That is, in MariaDB one could VARCHAR or TEXT for JSON. If a validation is needed, one can do it with a CHECK constraint:
We'll add JSON "type" for MySQL compatibility, though.