11--- 
22layout : default 
3- description : Introduced in 
3+ description : SmartJoins allow to execute co-located join operations among identically sharded collections. 
4+ title : SmartJoins for ArangoDB Clusters 
5+ redirect_from :
6+  - /3.4/smart-joins.html 
47--- 
5- Smart Joins 
6- ===========  
8+ SmartJoins 
9+ ========== 
710
811<small >Introduced in: v3.4.5, v3.5.0</small >
912
@@ -12,8 +15,12 @@ This feature is only available in the
1215[ ** Enterprise Edition** ] ( https://www.arangodb.com/why-arangodb/arangodb-enterprise/ ) {: target ="_ blank"}
1316{% endhint %}
1417
15- When doing joins in an ArangoDB cluster, data has to be exchanged between different servers.
18+ SmartJoins allow to execute co-located join operations among identically sharded collections.
19+ 
20+ Cluster joins without being smart
21+ --------------------------------- 
1622
23+ When doing joins in an ArangoDB cluster, data has to be exchanged between different servers.
1724Joins between different collections in a cluster normally require roundtrips between the 
1825shards of these collections for fetching the data. Requests are routed through an extra
1926coordinator hop.
@@ -140,8 +147,8 @@ This is a precondition for running joins locally, and thanks to the effects of
140147` distributeShardsLike `  it is now satisfied!
141148
142149
143- Smart joins  using distributeShardsLike
144- --------------------------------------  
150+ SmartJoins  using distributeShardsLike
151+ ------------------------------------- 
145152
146153With the two collections in place like this, an AQL query that uses a FILTER condition
147154that refers from the shard key of the one collection to the shard key of the other collection
@@ -166,7 +173,7 @@ As can be seen above, the extra hop via the coordinator is gone here, which will
166173less cluster-internal traffic and a faster response time.
167174
168175
169- Smart joins  will also work if the shard key of the second collection is not * _ key* ,
176+ SmartJoins  will also work if the shard key of the second collection is not * _ key* ,
170177and even for non-unique shard key values, e.g.:
171178
172179 arangosh> db._create("c1", {numberOfShards: 4, shardKeys: ["_key"]}); 
@@ -194,13 +201,13 @@ and even for non-unique shard key values, e.g.:
194201  6 ReturnNode COOR 2000 - RETURN doc1 
195202
196203{% hint 'tip' %}
197- All above examples used two collections only. Smart joins  will also work when joining
204+ All above examples used two collections only. SmartJoins  will also work when joining
198205more than two collections which have the same data distribution enforced via their
199206` distributeShardsLike `  attribute and using the shard keys as the join criteria as shown above.
200207{% endhint %}
201208
202- Smart joins  using smartJoinAttribute
203- ------------------------------------  
209+ SmartJoins  using smartJoinAttribute
210+ ----------------------------------- 
204211
205212In case the join on the second collection must be performed on a non-shard key
206213attribute, there is the option to specify a * smartJoinAttribute*  for the collection.
@@ -252,8 +259,8 @@ The join can now be performed via the collection's *smartJoinAttribute*:
252259  6 ReturnNode COOR 101 - RETURN doc1 
253260
254261
255- Restricting smart joins  to a single shard
256- -----------------------------------------  
262+ Restricting SmartJoins  to a single shard
263+ ---------------------------------------- 
257264
258265If a FILTER condition is used on one of the shard keys, the optimizer will also try
259266to restrict the queries to just the required shards:
@@ -277,12 +284,12 @@ to restrict the queries to just the required shards:
277284Limitations
278285----------- 
279286
280- In ArangoDB 3.4, the smart join  optimization must explicitly be turned on in the
287+ In ArangoDB 3.4, the SmartJoin  optimization must explicitly be turned on in the
281288server configuration, using the startup option ` --query.smart-joins true ` . If that 
282- configuration is not set, the smart join  optimization will not be performed.
289+ configuration is not set, the SmartJoin  optimization will not be performed.
283290Future versions ArangoDB will lift that requirement.
284291
285- The smart join  optimization is currently triggered only for data selection queries,
292+ The SmartJoin  optimization is currently triggered only for data selection queries,
286293but not for any data-manipulation operations such as INSERT, UPDATE, REPLACE, REMOVE
287294or UPSERT, neither traversals or subqueries.
288295
@@ -294,5 +301,5 @@ It is restricted to be used with simple shard key attributes (such as `_key`, `p
294301but not with nested attributes (e.g. ` name.first ` ). There should be exactly one shard
295302key attribute defined for each collection.
296303
297- Finally, the smart join  optimization requires that the collections are joined on their
304+ Finally, the SmartJoin  optimization requires that the collections are joined on their
298305shard key attributes (or smartJoinAttribute) using an equality comparison.
0 commit comments