From eb221d97e6cb74eda46c8670b09cef0c55e7cf80 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Wed, 13 Sep 2017 17:45:45 +0200 Subject: [PATCH] mention howto use indices for joins (#3229) --- Documentation/Books/AQL/Examples/Join.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/Books/AQL/Examples/Join.md b/Documentation/Books/AQL/Examples/Join.md index e7f6543dbf..a4cd13da29 100644 --- a/Documentation/Books/AQL/Examples/Join.md +++ b/Documentation/Books/AQL/Examples/Join.md @@ -220,6 +220,16 @@ So, for each user we pick the list of their friends and count them. The ones whe count equals zero are the lonely people. Using *RETURN 1* in the subquery saves even more precious CPU cycles and gives the optimizer more alternatives. +### Index usage + +Especially on joins you should [make sure indices can be used to speed up your query.](../../ExecutionAndPerformance/ExplainingQueries.md) +Please note that sparse indices don't qualify for joins: + +In joins you typically would also want to join documents not containing the property +you join with. However sparse indices don't contain references to documents that +don't contain the indexed attributes - thus they would be missing from the join operation. +For that reason you should provide non-sparse indices. + ### Pitfalls Since we're free of schemata, there is by default no way to tell the format of the