CACHE BEHAVIOR in ParadeDB lets you fine-tune how vector-search results are cached, trading speed for freshness.
ParadeDB’s CACHE BEHAVIOR setting tells the extension whether to store vector-search results in shared memory, keep them for a period, or bypass the cache entirely. Tuning it speeds up repeated semantic searches while avoiding stale reads.
Enable AUTO for dashboards or APIs that repeat similar queries. Use DISABLED for data that changes each request, like real-time inventory. Choose MANUAL when you want explicit control through TRUNCATE CACHE statements.
Pass the index name and policy (AUTO, MANUAL, DISABLED) to paradedb_cache_behavior()
. Optional EXPIRY decides how long entries live. Each index can have its own policy.
Yes—re-run paradedb_cache_behavior()
with a new EXPIRY. Existing cached items adopt the new limit instantly, so no restart is needed.
No. ParadeDB keeps cache pages in shared memory, which is cleared after a restart. Re-run heavy queries once to warm the cache.
Create a Prometheus scrape on paradedb_cache_stats()
and alert when hit_ratio < 0.7. Adjust behavior or expiry to reach optimal levels.
Ten-minute expiry balances speed and accuracy for rapidly updating tables like Orders and OrderItems. Longer periods risk showing outdated totals.
Yes. Roll back the transaction to undo any cache-policy change.
AUTO incurs a small overhead to invalidate entries, usually <1 ms per write.
Run SELECT paradedb_truncate_cache('products_name_vec_idx');
to purge specific entries.