📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

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);

Was this page helpful?