Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 请问如何看到表和sst文件的对应关系呢?
[TiDB Usage Environment] Production Environment / Testing / POC
[TiDB Version] 5.3
[Encountered Problem] How can I view the corresponding .sst file of table data in RocksDB? I want to check the storage status of each table in the .sst file, but after exporting with the sst_dump tool, I found that the file readability is very poor… Does TiDB provide an interface to obtain such data?
Is there any requirement to check this?
It seems that there is no direct table or view to query.
There is no SST file corresponding to a single table. Each TiKV has two RocksDB instances, which store data in four ColumnFamilies: raft, lock, default, and write. Each ColumnFamily has its own Memtable and SST files, while all ColumnFamilies share WAL, Current, and Manifest files.
It seems that there is no corresponding view to check, right?
In other words, you can’t see the file information corresponding to tables and indexes like in MySQL.
I want to use it for research, to look at the correspondence between table data and SST, or the key range of a specific SST file, just like (mysql-myrocks).
Yes, I just want to see the correspondence between tables and SSTs like MyRocks, or the key range of SSTs.
Alright, thank you for your response.
Currently, you can only view the SST files involved in the region, but not at the table level.
How should I look at this~ Please guide me.
$ tiup ctl:v5.4.2 tikv --host 172.160.65.225:20160 region-properties -r 2868
Starting component ctl
: /data/tidb/.tiup/components/ctl/v5.4.2/ctl tikv --host 61.160.36.225:20160 region-properties -r 2868
mvcc.min_ts: 435458936770396161
mvcc.max_ts: 435495141727272965
mvcc.num_rows: 4505715
mvcc.num_puts: 4522529
mvcc.num_deletes: 0
mvcc.num_versions: 4522529
mvcc.max_row_versions: 6
writecf.num_entries: 4522529
writecf.num_deletes: 0
writecf.num_files: 3
writecf.sst_files: 036328.sst, 037538.sst, 036762.sst
defaultcf.num_entries: 0
defaultcf.num_files: 0
defaultcf.sst_files:
region.start_key: 7480000000000000ff515f698000000000ff0000010380000000ff0000031403800000ff0000004e21000000fc
region.end_key: 7480000000000000ff515f698000000000ff0000010380000000ff0000031d03800000ff0000013881000000fc
region.middle_key_by_approximate_size: 7480000000000000ff515f698000000000ff0000010380000000ff0000031903800000ff0000004033000000fcf9f4f056326ffffe
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.