[MDEV-9144] JSON data type Created: 2015-11-17 Updated: 2017-09-27 Resolved: 2017-07-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data types, JSON |
| Fix Version/s: | 10.2.7 |
| Type: | Task | Priority: | Major |
| Reporter: | Sergei Golubchik | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 13 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Description |
|
JSON data type with validation. Assorted thoughts:
|
| Comments |
| Comment by Sergei Golubchik [ 2017-05-29 ] | |
|
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. | |
| Comment by Sergei Golubchik [ 2017-07-05 ] | |
|
added JSON as an alias for TEXT | |
| Comment by Steven WdV [ 2017-09-09 ] | |
|
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. | |
| Comment by Sergei Golubchik [ 2017-09-09 ] | |
|
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 | |
| Comment by Colin Charles [ 2017-09-10 ] | |
|
hi serg - these benchmarks, where are they published so others might repeat them? thanks | |
| Comment by Sergei Golubchik [ 2017-09-10 ] | |
|
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. |