[MDEV-28272] JSON functions should create compact format by default Created: 2022-04-09  Updated: 2023-04-02

Status: Open
Project: MariaDB Server
Component/s: JSON
Fix Version/s: None

Type: Task Priority: Major
Reporter: Thomas G. Jensen Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

It seems strange to me that JSON functions create loose/non-compact json by default. People would choose the compact format for maximum performance, and if you need to make an extra function call (JSON_COMPACT()), it will kill some of the advantage. Furthermore there should be a minor performance gain in not adding spaces in the first place.
JavaScript's JSON.stringify() also makes the compact format by default. For those who prefer "looser" formats, they still have the JSON_LOOSE and JSON_DETAILED functions, so why not make the JSON_COMPACT the default? At least there could be a server option to select the preferred format.



 Comments   
Comment by Weijun Huang [ 2023-04-02 ]

I do not think we should set JSON_COMPACT as default, because it is not necessay and unreadable.

Generated at Thu Feb 08 09:59:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.