Skip to main content
Last updated on

partitions

Overview

Show the Partition status of all tables in the database.

Database

information_schema

Table Information

Column NameTypeDescription
PARTITION_IDbigintPartitinon ID
TABLE_CATALOGvarchar(64)Catalog name
TABLE_SCHEMAvarchar(64)Database name
TABLE_NAMEvarchar(64)Table name
PARTITION_NAMEvarchar(64)Partition name
SUBPARTITION_NAMEvarchar(64)Always empty
PARTITION_ORDINAL_POSITIONintOrdinal position of the partition
SUBPARTITION_ORDINAL_POSITIONintAlways empty
PARTITION_METHODvarchar(13)Partition method
SUBPARTITION_METHODvarchar(13)Always empty
PARTITION_EXPRESSIONvarchar(2048)Partition expression
SUBPARTITION_EXPRESSIONvarchar(2048)Always empty
PARTITION_DESCRIPTIONtextPartition description
TABLE_ROWSbigint
AVG_ROW_LENGTHbigint
DATA_LENGTHbigint
MAX_DATA_LENGTHbigint
INDEX_LENGTHbigint
DATA_FREEbigint
CREATE_TIMEbigint
UPDATE_TIMEdatetime
CHECK_TIMEdatetime
CHECKSUMbigint
PARTITION_COMMENTtext
NODEGROUPvarchar(256)
TABLESPACE_NAMEvarchar(268)
LOCAL_DATA_SIZEtextPartition local data size. Usually 0 in compute-storage decoupled mode, see below
REMOTE_DATA_SIZEtextPartition remote data size (cloud)
STATEtextPartition state
REPLICA_ALLOCATIONtextdistribution of replicas of a tablet. NULL in compute-storage decoupled mode
REPLICA_NUMintreplicas num
STORAGE_POLICYtextStorage policy
STORAGE_MEDIUMtextStorage medium
COOLDOWN_TIME_MStextCooldown time
LAST_CONSISTENCY_CHECK_TIMEtextLast consistency check time
BUCKET_NUMintPartition bucket num
COMMITTED_VERSIONbigintLast commited version
VISIBLE_VERSIONbigintCurrent visible version
PARTITION_KEYtextPartition key
RANGEtextPartition range(min max value)
DISTRIBUTIONtextDistribution type

Data size semantics in compute-storage decoupled mode

Behavior change (4.0.8)

Starting from version 4.0.8, partition data size in compute-storage decoupled mode is consistently reported with remote semantics: data size that the replica statistics do not record as remote is counted into REMOTE_DATA_SIZE, and the corresponding LOCAL_DATA_SIZE is reported as 0. So in a decoupled cluster you usually see LOCAL_DATA_SIZE as 0, with the actual partition data size in REMOTE_DATA_SIZE.

Before 4.0.8, that data size was counted into LOCAL_DATA_SIZE, which made information_schema.partitions, SHOW TABLETS, and information_schema.backend_tablets contradict each other on local versus remote. The change only adjusts how the size is reported; it does not change where the data is stored or how much there is.

The same change makes REPLICA_ALLOCATION in information_schema.partitions display as NULL in decoupled mode (previously the internal placeholder \N). Replica placement is managed by the decoupled architecture itself and no longer follows the replica allocation semantics of the integrated mode.

When computing the actual space a partition occupies, use REMOTE_DATA_SIZE in decoupled mode:

SELECT
TABLE_SCHEMA,
TABLE_NAME,
PARTITION_NAME,
LOCAL_DATA_SIZE,
REMOTE_DATA_SIZE
FROM information_schema.partitions
WHERE TABLE_SCHEMA = 'your_db';