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 (same as the first parameter in system$set_cache_capacity)
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 cachebytesCannot be adjusted via system$set_cache_capacity
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 Hive tables and other sources
memory_cache_iceberg_tableIceberg table metadatacount

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