Is there a relationship between region and SST files?

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

Original topic: region 与 sst 文件有关系吗?

| username: KaiNiao

【TiDB Usage Environment】Testing
【TiDB Version】6.5.0
【Reproduction Path】/data1/tikv-20160/db
【Encountered Issues: Problem Phenomenon and Impact】

  1. Are regions related to SST files?
  2. Are SST files related to tables? For example, does an SST file correspond to only one table?
  3. Are both table data and index data stored in SST files?
    【Resource Configuration】
    【Attachments: Screenshots/Logs/Monitoring】

| username: h5n1 | Original post link

  1. There is a bit of a relationship. TiKV has a compaction_guard that tries to ensure that the region and SST boundaries are aligned to a certain size. You can use tikv-ctl region properties to view the SST files under the region, which may contain SSTs from other regions.

  2. SST is a RocksDB thing and does not correspond to the upper-level TiDB tables.

  3. TiDB uses RocksDB as the storage engine, and all table index data is in RocksDB’s SST.

| username: TiDBer_jYQINSnf | Original post link

SST is a concept from RocksDB.
Region is a logical concept. TiKV divides a segment of the key domain into several ranges.
Table is a concept from TiDB.

Any table in TiDB will eventually be converted into key-value pairs stored in TiKV, and any data in TiKV will ultimately be stored on disk in the form of SST files through RocksDB.
Further: You can also say that SST files are stored as file blocks in the file system, and then stored on disk in the form of 0s and 1s.

They have a top-down relationship.

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

You can simply understand a region as an Oracle tablespace (this might not be very accurate). SST can be understood as a datafile in Oracle. By corresponding the relationship between region and SST, and the storage of table index data with SST, it becomes easier to understand.

| username: KaiNiao | Original post link

:+1: :+1: :+1:

| username: KaiNiao | Original post link

Thank you, boss.

| username: KaiNiao | Original post link

Okay, thank you, boss.

| username: system | Original post link

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