mirror of https://gitee.com/bigwinds/arangodb
50 lines
1.8 KiB
Plaintext
50 lines
1.8 KiB
Plaintext
arangosh> db._create("test");
|
|
[ArangoCollection 64681, "test" (type document, status loaded)]
|
|
arangosh> for (i = 0; i < 100; ++i) { db.test.save({ value: i }); }
|
|
arangosh> db.test.ensureIndex({ type: "skiplist", fields: [ "value" ] });
|
|
{
|
|
"deduplicate" : true,
|
|
"fields" : [
|
|
"value"
|
|
],
|
|
"id" : "test/64886",
|
|
"isNewlyCreated" : true,
|
|
"name" : "idx_1646382032803069956",
|
|
"selectivityEstimate" : 1,
|
|
"sparse" : false,
|
|
"type" : "skiplist",
|
|
"unique" : false,
|
|
"code" : 201
|
|
}
|
|
arangosh> var explain = require("@arangodb/aql/explainer").explain;
|
|
arangosh> explain("FOR i IN test FILTER i.value > 97 SORT i.value RETURN i.value", {colors:false});
|
|
Query String (61 chars, cacheable: true):
|
|
FOR i IN test FILTER i.value > 97 SORT i.value RETURN i.value
|
|
|
|
Execution plan:
|
|
Id NodeType Est. Comment
|
|
1 SingletonNode 1 * ROOT
|
|
9 IndexNode 50 - FOR i IN test /* skiplist index scan, index only, projections: `value` */
|
|
5 CalculationNode 50 - LET #3 = i.`value` /* attribute expression */ /* collections used: i : test */
|
|
8 ReturnNode 50 - RETURN #3
|
|
|
|
Indexes used:
|
|
By Name Type Collection Unique Sparse Selectivity Fields Ranges
|
|
9 idx_1646382032803069956 skiplist test false false 100.00 % [ `value` ] (i.`value` > 97)
|
|
|
|
Optimization rules applied:
|
|
Id RuleName
|
|
1 move-calculations-up
|
|
2 move-filters-up
|
|
3 remove-redundant-calculations
|
|
4 remove-unnecessary-calculations
|
|
5 move-calculations-up-2
|
|
6 move-filters-up-2
|
|
7 use-indexes
|
|
8 remove-filter-covered-by-index
|
|
9 use-index-for-sort
|
|
10 remove-unnecessary-calculations-2
|
|
11 reduce-extraction-to-projection
|
|
|
|
|