tencent cloud

TDSQL Boundless

Enabling KV Separation

Unduh
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-05-26 11:28:34
Note:
All parameters related to KV separation are exclusive to SUPER permissions, and regular business accounts cannot configure them on their own. All commands shown in this section are intended only to help business parties understand the enabling process and its implications. To actually enable and tune these parameters, you need to contact a Tencent Cloud DBA for assistance.
Future plans: Future editions will provide an automatic tuning solution. This solution automatically selects key parameters such as min_blob_size, compression algorithms, and GC policies based on business loads, eliminating the need for manual DBA intervention. At the current stage, it is recommended that you submit an Ops ticket for DBA evaluation regarding whether to enable KV separation.

Enabling KV Separation

The granularity for enabling or disabling KV separation is at the Column Family level. For the user CF, which is the most commonly used CF for customer business data (where user table data resides), the minimum viable configuration requires only three parameters (to be executed by a DBA):
-- 1. Enable the master switch for KV separation in the user CF
SET PERSIST tdstore_user_cf_enable_blob_files = ON;

-- 2. Set the Value threshold for writing to Blob (unit: bytes, recommended range: 1024–4096)
SET PERSIST tdstore_user_cf_min_blob_size = 1024;

-- 3. (Strongly recommended) Enable garbage collection to prevent overwritten/deleted Blobs from occupying disk space for extended periods.
SET PERSIST tdstore_user_cf_enable_blob_garbage_collection = ON;
Note:
Permission Requirements: All the aforementioned parameters require SUPER privileges.
Scope of Effect: The changes take effect dynamically without requiring an instance restart. They apply immediately to newly written data. Existing data is migrated to Blob files according to the new rules during the next Compaction.
Persistence Notes: Use SET PERSIST to write to mysqld-auto.cnf. The configuration persists after an instance restart. If you only want to test temporarily, use SET GLOBAL instead (the setting is lost after a restart).

Disabling KV Separation

SET PERSIST tdstore_user_cf_enable_blob_files = OFF;
Note:
Behavior After the Feature is Disabled: Newly written large Values are no longer separated. However, existing Blob files remain valid and are automatically recognized by the read path. Blob files are gradually merged back into SST files during subsequent Compaction operations, or they are reclaimed after all references to them disappear.

Verify if it is in effect

-- 1. Check the switch status
SHOW GLOBAL VARIABLES LIKE 'tdstore_user_cf_%blob%';

-- 2. Check whether the Blob write volume is increasing (observe continuously)
SHOW GLOBAL STATUS LIKE 'rocksdb_blobdb_blob_file_bytes_written';
SHOW GLOBAL STATUS LIKE 'rocksdb_blobdb_num_keys_written';
When it is functioning normally, the rocksdb_blobdb_* series of metrics continuously increase with writes (see Monitoring Metrics for details).

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan