@@ -314,3 +314,63 @@ query results cache, as queries on system collections are internal to ArangoDB a
314314only use space in the query results cache unnecessarily.
315315
316316The default value is * false* .
317+
318+
319+ ## AQL Query with spilling input data to disk
320+
321+ <small >Introduced in: v3.10.0 </small >
322+
323+ With the parameters mentioned below, queries can execute with storing input
324+ and intermediate results temporarily on disk to decrease the memory usage
325+ a specified threshold is reached.
326+
327+ {% hint 'info' %}
328+ This feature is experimental and is turned off by default.
329+ Also, the query results are still built up entirely in RAM on coordinators
330+ and single servers for non-streaming queries. To avoid the buildup of
331+ the entire query result in RAM, a streaming query should be used.
332+ {% endhint %}
333+
334+ The threshold value to start spilling data onto disk is either
335+ a number of rows in the query input or an amount of memory used in bytes,
336+ which are both set as query options.
337+
338+ The main parameter that must be provided for this feature to be active is
339+ ` --temp.intermediate-results-path ` . This parameter specifies a path to a directory
340+ used to store temporary data. If such path is not provided, the feature of spilling data
341+ onto the disk will not be activated.
342+
343+ Hence, the following parameters do not have any effect, unless the parameter
344+ mentioned above is provided with a directory path.
345+ The directory specified here must not be located underneath the instance's
346+ database directory.
347+
348+
349+ - ` --temp.-intermediate-results-encryption-hardware-acceleration `
350+
351+ Use Intel intrinsics-based encryption, requiring a CPU with the AES-NI
352+ instruction set. If turned off, then OpenSSL is used, which may use hardware-
353+ accelarated encryption too.
354+ Default: ` true ` .
355+
356+ - ` --temp.intermediate-results-capacity `
357+
358+ Maximum capacity, in bytes, to use for ephemeral, intermediate results, meaning
359+ the maximum size allowed for the mentioned temporary storage.
360+ Default: 0 (unlimited).
361+
362+ - ` --temp.intermediate-results-encryption `
363+
364+ Encrypt ephemeral, intermediate results on disk.
365+ Default: ` false ` .
366+
367+
368+ - ` --temp.intermediate-results-spillover-threshold-num-rows `
369+
370+ A number of result rows from which on a spillover from RAM to disk will happen.
371+ Default: 5000000.
372+
373+ - ` --temp.intermediate-results-spillover-threshold-memory-usage `
374+
375+ Memory usage, in bytes, after which a spillover from RAM to disk will happen.
376+ Default: 128MB.
0 commit comments