How to Set Table Compression Algorithm in TiDB

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

Original topic: TiDB如何设置表压缩算法

| username: 我是咖啡哥

Requirement: Some historical tables, hoping to set a higher compression rate algorithm to save some storage space.

Is this reply reliable? :grinning:


Official website: CREATE TABLE | PingCAP 文档中心
It states that the compression parameter will be ignored.

TiDB supports the following table_option. TiDB will parse and ignore other table_option parameters, such as AVG_ROW_LENGTH, CHECKSUM, COMPRESSION, CONNECTION, DELAY_KEY_WRITE, ENGINE, KEY_BLOCK_SIZE, MAX_ROWS, MIN_ROWS, ROW_FORMAT, and STATS_PERSISTENT.

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

TiDB probably doesn’t support it. Don’t believe the nonsense from ChatGPT.

| username: Jellybean | Original post link

Currently, TiDB only offers compression options for different levels in RocksDB, and does not have compression configuration capabilities at the library or table level.

TiKV sets the compression for different levels through the configuration parameter compression-per-level:

  • Default compression algorithm for each level.
  • Default values for defaultcf: [“no”, “no”, “lz4”, “lz4”, “lz4”, “zstd”, “zstd”]
  • Default values for writecf: [“no”, “no”, “lz4”, “lz4”, “lz4”, “zstd”, “zstd”]
  • Default values for lockcf: [“no”, “no”, “no”, “no”, “no”, “no”, “no”]
| username: Jellybean | Original post link

Just take a look.

| username: 裤衩儿飞上天 | Original post link

ChatGPT is really going to be ruined by you guys.

| username: 我是咖啡哥 | Original post link

ChatGPT can’t resist the interrogation :joy:

| username: xingzhenxiang | Original post link

ChatGPT was taken down by you just like that?

| username: xingzhenxiang | Original post link

| username: 孤君888 | Original post link

Read the documentation. You’re asking ChatGPT for this?

| username: maokl | Original post link

It might still be a bit challenging for ChatGPT to handle technical issues, right?

| username: xingzhenxiang | Original post link

The image you provided is not accessible. Please provide the text you need translated.