Company
Date Published
Author
Scott Anderson
Word count
1416
Language
-
Hacker News points
None

Summary

The Distinct Value Cache (DVC) in InfluxDB 3, available in both the Core and Enterprise versions, is an in-memory cache designed to efficiently store and quickly retrieve distinct values from specific columns in under 30 milliseconds. It enhances query performance by caching distinct tag or field values, which is particularly useful for populating selectable options in web applications like Grafana dashboards. Users can specify the columns to cache, set maximum cardinality limits, and define time-to-live (TTL) parameters to optimize cache size and memory usage. The DVC supports SQL-based queries for retrieving distinct values, but not InfluxQL, and is especially beneficial for creating dynamic user interfaces by listing unique column values. However, because the cache is stored in memory, it is flushed when the server restarts, necessitating data rewrites to repopulate it. The DVC is a valuable tool for improving the performance of time series data workloads by minimizing the need for resource-intensive full table scans.