# Collect incremental data generated during cluster compactions
Description
You can query the incremental data generated during compactions of a cluster.
Statement
OceanBase Database of a version earlier than V4.0.0:
SELECT svr_ip, svr_port, SUM(size)/1024/1024/1024 data_size_gb
FROM __all_virtual_table_mgr
WHERE table_type > 1
GROUP BY svr_ip, svr_port
ORDER BY data_size_gb DESC
OceanBase Database V4.0.0 and later:
SELECT svr_ip, svr_port, SUM(size)/1024/1024/1024 data_size_gb
FROM __all_virtual_table_mgr
WHERE table_type > 10
GROUP BY svr_ip, svr_port
ORDER BY data_size_gb DESC
Possible impact
Generally, each compaction processes incremental data and intermediate temporary data, which increases the disk usage. You can measure the amount of the data.
Valid values of table_type in OceanBase Database V3.x
enum TableType {
MEMTABLE = 0,
MAJOR_SSTABLE = 1,
MINOR_SSTABLE = 2, // obsoleted type after 2.2
TRANS_SSTABLE = 3, // new table type from 3.1
MULTI_VERSION_MINOR_SSTABLE = 4,
COMPLEMENT_MINOR_SSTABLE = 5, // new table type from 3.1
MULTI_VERSION_SPARSE_MINOR_SSTABLE = 6, // reserved table type
MINI_MINOR_SSTABLE = 7,
RESERVED_MINOR_SSTABLE = 8,
MAX_TABLE_TYPE
};
Valid values of table_type in OceanBase Database V4.x
enum TableType : unsigned char
{
// < memtable start from here
DATA_MEMTABLE = 0,
TX_DATA_MEMTABLE = 1,
TX_CTX_MEMTABLE = 2,
LOCK_MEMTABLE = 3,
// < add new memtable here
// < sstable start from here
MAJOR_SSTABLE = 10,
MINOR_SSTABLE = 11,
MINI_SSTABLE = 12,
META_MAJOR_SSTABLE = 13,
DDL_DUMP_SSTABLE = 14,
REMOTE_LOGICAL_MINOR_SSTABLE = 15,
DDL_MEM_SSTABLE = 16,
// < add new sstable before here, See is_sstable()
MAX_TABLE_TYPE
};