Skip to main content

SYSTEM$SET_CACHE_CAPACITY

Sets the maximum capacity for a named cache at runtime. Changes take effect immediately but are not persisted — the cache reverts to the value in the configuration file after a restart.

See also: system.caches

Syntax

CALL system$set_cache_capacity('<cache_name>', <new_capacity>)
ParameterDescription
cache_nameThe name of the cache (see the cache list in system.caches)
new_capacityNew capacity value. Unit (count or bytes) depends on the cache type.

Notes

  • If the new capacity is larger than the current value, existing cache entries are retained.
  • If the new capacity is smaller, entries may be evicted according to the LRU policy.
  • Changes are not persisted. After a restart, the capacity reverts to the configuration file value.
  • disk_cache_column_data cannot be adjusted with this command.

Examples

Set the bloom index metadata cache to 5000 entries:

CALL system$set_cache_capacity('memory_cache_bloom_index_file_meta_data', 5000);

┌────────────────────────┬────────┐
│ node │ result │
├────────────────────────┼────────┤
│ Gwo2DYOLZ9zAdYbGTWY9y6 │ Ok │
└────────────────────────┴────────┘

Disable partition pruning cache for testing:

CALL system$set_cache_capacity('memory_cache_prune_partitions', 0);
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