Skip to main content

system.caches

An overview of various caches managed in Databend, including usage and hit rate statistics.

Columns​

ColumnDescription
nodeThe node name
nameCache name (see the disk target mapping below)
num_itemsNumber of cached entries
sizeSize of cached entries (count or bytes depending on unit)
capacityMaximum capacity (count or bytes depending on unit)
unitUnit of size and capacity: count or bytes
accessTotal number of cache accesses
hitNumber of cache hits
missNumber of cache misses

Cache List​

Cache NameCached ObjectUnitNotes
memory_cache_table_snapshotTable snapshotcountEnabled by default; default capacity is usually sufficient
memory_cache_table_statisticsTable statisticscount
memory_cache_compact_segment_infoCompressed table segment metadatabytes
memory_cache_segment_statisticsSegment-level statisticsbytes
memory_cache_column_oriented_segment_infoColumn-oriented segment metadatabytes
disk_cache_column_dataOn-disk column data cachebytesBefore the unified disk cache: not adjustable. See disk controls below.
memory_cache_bloom_index_filterBloom filter databytesOne entry per column per block. Memory usage is small. Monitor hit rate for point-lookup workloads.
memory_cache_bloom_index_file_meta_dataBloom filter metadatacountEach table can cache up to as many entries as it has blocks. Memory usage is small. Monitor hit rate for point-lookup workloads.
memory_cache_inverted_index_file_meta_dataInverted index metadatacount
memory_cache_inverted_index_fileInverted index databytes
memory_cache_vector_index_file_meta_dataVector index metadatacount
memory_cache_vector_index_fileVector index databytes
memory_cache_spatial_index_file_meta_dataSpatial index metadatacount
memory_cache_spatial_index_fileSpatial index databytes
memory_cache_virtual_column_file_meta_dataVirtual column file metadatacount
memory_cache_prune_partitionsPartition pruning cachecountEnabled by default. Caches pruning results for deterministic queries. Set capacity to 0 to bypass for pruning testing.
memory_cache_parquet_meta_dataParquet file metadatacountUsed by Parquet-based sources
memory_cache_iceberg_tableIceberg table metadatacount

Disk Cache Statistics

Introduced or updated: Unreleased

With the unified disk cache enabled, disk_cache_* rows show each kind's raw bytes on disk. They do not represent decoded memory values. Each kind's capacity is NULL because its disk pool sets the limit. Use size in bytes to inspect usage.

The __disk_pool:meta, __disk_pool:index, and __disk_pool:data rows show pool usage and byte capacities. Pool rows summarize their kinds. Do not add pool usage to kind usage: that counts the same disk bytes twice. Keep each node's budget separate.

SELECT node, name, num_items, size, capacity, access, hit
FROM system.caches
WHERE name LIKE 'disk_cache_%' OR name LIKE '__disk_pool:%';

For pool utilization, divide size by a nonzero pool capacity. The general utilization example below cannot produce a ratio for a NULL per-kind capacity.

Runtime controls use disk_pool:data, not __disk_pool:data. A disk-kind switch uses its memory_cache_* kind name prefixed with disk:. For example, the disk_cache_column_data row corresponds to disk:memory_cache_column_data.

Example​

SELECT * FROM system.caches;

Check utilization and hit rate for all 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;
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today