📣
TiDB Cloud Premium 开放公测中。为企业级工作负载提供无限扩展、即时弹性伸缩和高级安全保障。此页面由 AI 自动翻译,英文原文请见此处。

system.caches



对 TiDB Cloud Lake 中管理的各种缓存的概览,包括使用情况和命中率统计信息。

列

列描述
node节点名称
name缓存名称(与 system$set_cache_capacity 中的第一个参数相同)
num_items已缓存条目的数量
size已缓存条目的大小(根据 unit,单位为数量或字节)
capacity最大容量(根据 unit,单位为数量或字节)
unitsize 和 capacity 的单位:count 或 bytes
access缓存访问总次数
hit缓存命中次数
miss缓存未命中次数

缓存列表

缓存名称缓存对象单位说明
memory_cache_table_snapshot表快照count默认启用;默认容量通常已足够
memory_cache_table_statistics表统计信息count
memory_cache_compact_segment_info压缩表 segment 元信息bytes
memory_cache_segment_statisticssegment 级别统计信息bytes
memory_cache_column_oriented_segment_info列式 segment 元信息bytes
disk_cache_column_data磁盘上的列数据缓存bytes无法通过 system$set_cache_capacity 调整
memory_cache_bloom_index_filter布隆过滤器数据bytes每个 block 的每一列对应一个条目。内存占用较小。对于点查工作负载,请监控命中率。
memory_cache_bloom_index_file_meta_data布隆过滤器元信息count每张表最多可缓存与其 block 数量相同的条目数。内存占用较小。对于点查工作负载,请监控命中率。
memory_cache_inverted_index_file_meta_data倒排索引元信息count
memory_cache_inverted_index_file倒排索引数据bytes
memory_cache_vector_index_file_meta_data向量索引元信息count
memory_cache_vector_index_file向量索引数据bytes
memory_cache_spatial_index_file_meta_data空间索引元信息count
memory_cache_spatial_index_file空间索引数据bytes
memory_cache_virtual_column_file_meta_data虚拟列文件元信息count
memory_cache_prune_partitions分区裁剪缓存count默认启用。为确定性查询缓存裁剪结果。将容量设置为 0 可在分区裁剪测试中绕过该缓存。
memory_cache_parquet_meta_dataParquet 文件元信息count由 Hive 表和其他数据源使用
memory_cache_iceberg_tableIceberg 表元信息count

示例

SELECT * FROM system.caches;

检查所有缓存的利用率和命中率:

SELECT node, name, capacity, if(unit = 'count', (num_items + 1) / (capacity + 1), unit = 'bytes', (size + 1) / (capacity + 1), -1) AS utilization, if(access = 0, 0, hit / access) AS hit_rate, if(access = 0, 0, miss / access) AS miss_rate, num_items, size, unit, access, hit, miss FROM system.caches;

文档内容是否有帮助?