From 13b702cc3f6920bc34524aa2a9200d05b2e96cc3 Mon Sep 17 00:00:00 2001 From: Simran Spiller Date: Thu, 4 Jan 2024 08:29:51 +0100 Subject: [PATCH] Async prefetching AQL optimizer rule --- .../version-3.12/whats-new-in-3-12.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/site/content/3.12/release-notes/version-3.12/whats-new-in-3-12.md b/site/content/3.12/release-notes/version-3.12/whats-new-in-3-12.md index 7bd2e11843..c08d95c46a 100644 --- a/site/content/3.12/release-notes/version-3.12/whats-new-in-3-12.md +++ b/site/content/3.12/release-notes/version-3.12/whats-new-in-3-12.md @@ -182,6 +182,31 @@ less overhead. See [Document and object functions in AQL](../../aql/functions/document-object.md#parse_collection). +### Parallel execution within an AQL query + +The new `async-prefetch` optimizer rule allows certain operations of a query to +asynchronously prefetch the next batch of data while processing the current batch, +allowing parts of the query to run in parallel. This can lead to performance +improvements if there is still reserve (scheduler) capacity. + +The new `Par` column in a query explain output shows which nodes of a query are +eligible for asynchronous prefetching. Write queries, graph execution nodes, +nodes inside subqueries, and query parts involving remote execution are not +eligible. + +```aql +Execution plan: + Id NodeType Par Est. Comment + 1 SingletonNode 1 * ROOT + 2 EnumerateCollectionNode ✓ 18 - FOR doc IN places /* full collection scan */ FILTER (doc.`label` IN [ "Glasgow", "Aberdeen" ]) /* early pruning */ + 5 CalculationNode ✓ 18 - LET #2 = doc.`label` /* attribute expression */ /* collections used: doc : places */ + 6 SortNode ✓ 18 - SORT #2 ASC /* sorting strategy: standard */ + 7 ReturnNode 18 - RETURN doc +``` + +The profiling output for queries includes a new `Par` column as well, but it +shows the number of successful parallel asynchronous prefetch calls. + ## Indexing ### Stored values can contain the `_id` attribute