Cache distinct values
The Distinct Value Cache (DVC) lets you cache distinct values of one or more columns in a table, improving the performance of queries that return distinct tag and field values.
The DVC is an in-memory cache that stores distinct values for specific columns in a table. When you create a DVC, you can specify what columns’ distinct values to cache, the maximum number of distinct value combinations to cache, and the maximum age of cached values. A DVC is associated with a table, which can have multiple DVCs.
/api/v3/configure/distinct_cacheCreate distinct cache
Request body required
application/jsoncolumns
required
string[]db
required
stringmax_age
integermax_cardinality
integername
stringtable
required
string{
"columns": [
"tag1",
"tag2"
],
"db": "mydb",
"max_age": 3600,
"max_cardinality": 1000,
"table": "mytable"
}curl --request POST \
"https://localhost:8181/api/v3/configure/distinct_cache" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{"columns":["tag1","tag2"],"db":"mydb","max_age":3600,"max_cardinality":1000,"table":"mytable"}'Responses
Bad request.
The server responds with status 400 if the request would overwrite an existing cache with a different configuration.
/api/v3/configure/distinct_cacheDelete distinct cache
Parameters
Query parameters
db
required
stringtable
required
stringname
required
stringcurl --request DELETE \
"https://localhost:8181/api/v3/configure/distinct_cache?db=DB&table=TABLE&name=NAME" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
data
objecterror
stringWas this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB 3 Core and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.