Cache last value
The Last Value Cache (LVC) lets you cache the most recent values for specific fields in a table, improving the performance of queries that return the most recent value of a field for specific series or the last N values of a field.
The LVC is an in-memory cache that stores the last N number of values for specific fields of series in a table. When you create an LVC, you can specify what fields to cache, what tags to use to identify each series, and the number of values to cache for each unique series. An LVC is associated with a table, which can have multiple LVCs.
/api/v3/configure/last_cacheCreate last cache
Request body required
application/jsoncount
integerdb
required
stringkey_columns
string[]name
stringnode_spec
stringtable
required
stringttl
integervalue_columns
string[]{
"count": 100,
"db": "mydb",
"key_columns": [
"tag1"
],
"table": "mytable",
"ttl": 3600,
"value_columns": [
"field1"
]
}curl --request POST \
"https://localhost:8181/api/v3/configure/last_cache" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{"count":100,"db":"mydb","key_columns":["tag1"],"table":"mytable","ttl":3600,"value_columns":["field1"]}'Responses
data
objecterror
string/api/v3/configure/last_cacheDelete last cache
Parameters
Query parameters
db
required
stringtable
required
stringname
required
stringcurl --request DELETE \
"https://localhost:8181/api/v3/configure/last_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 Enterprise and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support. Customers using a trial license can email trial@influxdata.com for assistance.