What is the maximum length limit for JSON type storage? Will the JSON content be compressed when stored?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: JSON类型存储的最大长度限制是多少?JSON存储时是否会对JSON内容进行压缩存储?

| username: 很高兴遇见你

【TiDB Usage Environment】Production Environment / Testing / PoC
【TiDB Version】v5.4.0
【Encountered Issue: Maximum Length Limit for JSON Type Storage】
【Encountered Issue: Whether JSON Content is Compressed During Storage】

| username: tidb菜鸟一只 | Original post link

TiDB does not yet support JSON objects with key lengths >= 65536. It also does not perform automatic compression for JSON.

| username: zhanggame1 | Original post link

TiDB compresses all data.

| username: ealam_小羽 | Original post link

Reading the documentation will be serialized and stored.

| username: 很高兴遇见你 | Original post link

It only mentions serialization here, not whether it will be compressed.

| username: ealam_小羽 | Original post link

The document can be inferred to have been compressed from this:

| username: 很高兴遇见你 | Original post link

Haha, it seems like we’re concerned about different points. My point is whether a JSON string longer than 65535 can be stored after serialization, given that the maximum length for the JSON type is 65535.

| username: ealam_小羽 | Original post link

Oh, I misunderstood. It shouldn’t be possible, right? I haven’t seen JSON that supports multiple serialization methods. In this scenario, if there isn’t an internal query with JSON functions, you might consider using another type and then compressing it yourself.

| username: zhanggame1 | Original post link

Where did you see the 65535 limit?

| username: 很高兴遇见你 | Original post link

The person above mentioned that when using a custom handler, JdbcType used blob, which should be roughly correct.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.