gpt4 book ai didi

mysql - JSONB在mysql中可用的数据类型?

转载 作者:太空宇宙 更新时间:2023-11-03 10:32:40 25 4
gpt4 key购买 nike

我似乎无法确定这是否在 mysql 中实现?我只能找到与postgresql相关的信息。

那么,你可以在 mysql 中使用 JSONB 还是只是 JSON?

最佳答案

Postgres 中jsonjsonb 类型的主要区别是后者以压缩二进制格式存储。来自 MySQL documentation , 似乎 MySQL 的 JSON 类型至少已经具有 Postgres 的 jsonb 的一些行为:

The JSON data type provides these advantages over storing JSON-format strings in a string column:

Optimized storage format. JSON documents stored in JSON columns are converted to an internal format that permits quick read access to document elements. When the server later must read a JSON value stored in this binary format, the value need not be parsed from a text representation. The binary format is structured to enable the server to look up subobjects or nested values directly by key or array index without reading all values before or after them in the document.

如果我没记错的话,MySQL JSON 函数仍然可以在 JSON 文本上正常工作(例如存储为 varchar),所以 MySQL 与 Postgres 的 json 的类比可能只是将 JSON 内容存储为纯文本。

关于mysql - JSONB在mysql中可用的数据类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54868819/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com