我正在阅读有关 PostgreSql 文档中 JSON 和 JSONB 数据类型之间差异的信息 https://www.postgresql.org/docs/13/datatype-json.html .
有这条线
The json data type stores an exact copy of the input text, which processing functions must reparse on each execution; while jsonb data is stored in a decomposed binary format that makes it slightly slower to input due to added conversion overhead, but significantly faster to process, since no reparsing is needed
我无法理解以文本格式存储和以二进制格式存储之间的区别是什么,字符串本身将存储为 0 和 1 的序列。
有人可以澄清一下吗?另外,它们之间会有大小差异吗?
最佳答案
json
本质上是作为文本存储的,每次operate都需要解析在上面。这意味着它确实保留了空白格式并允许对象中的重复属性键等特性。
jsonb
是一种优化的二进制格式,表示嵌套数组和对象的树结构,可能更小 (idk) 存储稍大但访问和访问速度更快操作。
关于postgresql - JSON 与 JSONB Postgresql,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68820299/