File tree Expand file tree Collapse file tree 2 files changed +72
-0
lines changed
3.12/release-notes/version-3.12
3.13/release-notes/version-3.12 Expand file tree Collapse file tree 2 files changed +72
-0
lines changed Original file line number Diff line number Diff line change @@ -1257,6 +1257,42 @@ to some extent.
1257
1257
See the [ ` COLLECT ` operation] ( ../../aql/high-level-operations/collect.md#disableindex )
1258
1258
for details.
1259
1259
1260
+ ---
1261
+
1262
+ <small >Introduced in: v3.12.5</small >
1263
+
1264
+ The ` use-index-for-collect ` optimizer rule has been further extended.
1265
+ Queries where a ` COLLECT ` operation has an ` AGGREGATE ` clause that exclusively
1266
+ refers to attributes covered by a persistent index (and no other variables nor
1267
+ contains calls of aggregation functions with constant values) can now utilize
1268
+ this index. The index must not be sparse.
1269
+
1270
+ Reading the data from the index instead of the stored documents for aggregations
1271
+ can increase the performance by a factor of two.
1272
+
1273
+ ``` aql
1274
+ FOR doc IN coll
1275
+ COLLECT a = doc.a AGGREGATE b = MAX(doc.b)
1276
+ RETURN { a, b }
1277
+ ```
1278
+
1279
+ If there is a persistent index over the attributes ` a ` and ` b ` , then the above
1280
+ example query has an ` IndexCollectNode ` in the explain output and the index
1281
+ usage is indicated if the optimization is applied:
1282
+
1283
+ ``` aql
1284
+ Execution plan:
1285
+ Id NodeType Par Est. Comment
1286
+ 1 SingletonNode 1 * ROOT
1287
+ 10 IndexCollectNode 4999 - FOR doc IN coll COLLECT a = doc.`a` AGGREGATE b = MAX(doc.`b`) /* full index scan */
1288
+ 6 CalculationNode ✓ 4999 - LET #5 = { "a" : a, "b" : b } /* simple expression */
1289
+ 7 ReturnNode 4999 - RETURN #5
1290
+
1291
+ Indexes used:
1292
+ By Name Type Collection Unique Sparse Cache Selectivity Fields Stored values Ranges
1293
+ 10 idx_1836452431376941056 persistent coll
1294
+ ```
1295
+
1260
1296
## Indexing
1261
1297
1262
1298
### Multi-dimensional indexes
Original file line number Diff line number Diff line change @@ -1257,6 +1257,42 @@ to some extent.
1257
1257
See the [ ` COLLECT ` operation] ( ../../aql/high-level-operations/collect.md#disableindex )
1258
1258
for details.
1259
1259
1260
+ ---
1261
+
1262
+ <small >Introduced in: v3.12.5</small >
1263
+
1264
+ The ` use-index-for-collect ` optimizer rule has been further extended.
1265
+ Queries where a ` COLLECT ` operation has an ` AGGREGATE ` clause that exclusively
1266
+ refers to attributes covered by a persistent index (and no other variables nor
1267
+ contains calls of aggregation functions with constant values) can now utilize
1268
+ this index. The index must not be sparse.
1269
+
1270
+ Reading the data from the index instead of the stored documents for aggregations
1271
+ can increase the performance by a factor of two.
1272
+
1273
+ ``` aql
1274
+ FOR doc IN coll
1275
+ COLLECT a = doc.a AGGREGATE b = MAX(doc.b)
1276
+ RETURN { a, b }
1277
+ ```
1278
+
1279
+ If there is a persistent index over the attributes ` a ` and ` b ` , then the above
1280
+ example query has an ` IndexCollectNode ` in the explain output and the index
1281
+ usage is indicated if the optimization is applied:
1282
+
1283
+ ``` aql
1284
+ Execution plan:
1285
+ Id NodeType Par Est. Comment
1286
+ 1 SingletonNode 1 * ROOT
1287
+ 10 IndexCollectNode 4999 - FOR doc IN coll COLLECT a = doc.`a` AGGREGATE b = MAX(doc.`b`) /* full index scan */
1288
+ 6 CalculationNode ✓ 4999 - LET #5 = { "a" : a, "b" : b } /* simple expression */
1289
+ 7 ReturnNode 4999 - RETURN #5
1290
+
1291
+ Indexes used:
1292
+ By Name Type Collection Unique Sparse Cache Selectivity Fields Stored values Ranges
1293
+ 10 idx_1836452431376941056 persistent coll
1294
+ ```
1295
+
1260
1296
## Indexing
1261
1297
1262
1298
### Multi-dimensional indexes
You can’t perform that action at this time.
0 commit comments