ArangoDB v3.12 is under development and not released yet.
This documentation is not final and potentially incomplete.
HTTP interface for the query cache
The query cache HTTP API lets you control the cache for AQL query results
List the entries of the AQL query results cache
GET /_api/query-cache/entries
Returns an array containing the AQL query results currently stored in the query results cache of the selected database. Each result is a JSON object with the following attributes:
hash
: the query result’s hashquery
: the query stringbindVars
: the query’s bind parameters. this attribute is only shown if tracking for bind variables was enabled at server startsize
: the size of the query result and bind parameters, in bytesresults
: number of documents/rows in the query resultstarted
: the date and time when the query was stored in the cachehits
: number of times the result was served from the cache (can be0
for queries that were only stored in the cache but were never accessed again afterwards)runTime
: the query’s run timedataSources
: an array of collections/Views the query was using
Responses
HTTP 200: Is returned when the list of results can be retrieved successfully.
HTTP 400: The server will respond with HTTP 400 in case of a malformed request,
Clear the AQL query results cache
DELETE /_api/query-cache
Clears all results stored in the AQL query results cache for the current database.
Responses
HTTP 200: The server will respond with HTTP 200 when the cache was cleared successfully.
HTTP 400: The server will respond with HTTP 400 in case of a malformed request.
Get the AQL query results cache configuration
GET /_api/query-cache/properties
Returns the global AQL query results cache configuration. The configuration is a JSON object with the following properties:
-
mode
: the mode the AQL query results cache operates in. The mode is one of the following values:off
,on
, ordemand
. -
maxResults
: the maximum number of query results that will be stored per database-specific cache. -
maxResultsSize
: the maximum cumulated size of query results that will be stored per database-specific cache. -
maxEntrySize
: the maximum individual result size of queries that will be stored per database-specific cache. -
includeSystem
: whether or not results of queries that involve system collections will be stored in the query results cache.
Responses
HTTP 200: Is returned if the properties can be retrieved successfully.
HTTP 400: The server will respond with HTTP 400 in case of a malformed request,
Set the AQL query results cache configuration
PUT /_api/query-cache/properties
Adjusts the global properties for the AQL query results cache.
After the properties have been changed, the current set of properties will be returned in the HTTP response.
Note: changing the properties may invalidate all results in the cache.
The properties need to be passed in the properties
attribute in the body
of the HTTP request. properties
needs to be a JSON object with the following
properties:
Request Body
-
mode (string, optional): the mode the AQL query cache should operate in. Possible values are
off
,on
, ordemand
. -
maxResults (integer, optional): the maximum number of query results that will be stored per database-specific cache.
-
maxResultsSize (integer, optional): the maximum cumulated size of query results that will be stored per database-specific cache.
-
maxEntrySize (integer, optional): the maximum individual size of query results that will be stored per database-specific cache.
-
includeSystem (boolean, optional): whether or not to store results of queries that involve system collections.
Responses
HTTP 200: Is returned if the properties were changed successfully.
HTTP 400: The server will respond with HTTP 400 in case of a malformed request,