ArangoDB v3.8 reached End of Life (EOL) and is no longer supported.

This documentation is outdated. Please see the most recent version at docs.arangodb.com

HTTP Interface for the AQL query results cache

This section describes the API methods for controlling the AQL query results cache.

Returns the currently cached query results

returns a list of the stored results in 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 hash

  • query: the query string

  • bindVars: the query’s bind parameters. this attribute is only shown if tracking for bind variables was enabled at server start

  • size: the size of the query result and bind parameters, in bytes

  • results: number of documents/rows in the query result

  • started: the date and time when the query was stored in the cache

  • hits: number of times the result was served from the cache (can be 0 for queries that were only stored in the cache but were never accessed again afterwards)

  • runTime: the query’s run time

  • dataSources: 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,

Clears any results in the AQL query results cache

clears the AQL query results cache

DELETE /_api/query-cache

clears the 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.

Returns the global properties for the AQL query results cache

returns the global configuration for the AQL query results cache

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 or demand.

  • 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,

Globally adjusts the AQL query results cache properties

changes the configuration for the AQL query results cache

PUT /_api/query-cache/properties

Request Body

  • mode (string, optional): the mode the AQL query cache should operate in. Possible values are off, on or demand.

  • 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.

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 global properties for AQL query cache. The properties need to be passed in the attribute properties in the body of the HTTP request. properties needs to be a JSON object with the following properties:

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,