Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Commit 2232d13

Browse files
committed
Refine template, add special example generation code
1 parent 6311518 commit 2232d13

7 files changed

+44
-23
lines changed

3.11/release-notes-new-features311.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ which means you cannot use `RETURN NEW` or similar to access the new documents
296296
including their document keys. Additionally, all preceding calculations must be
297297
constant, which excludes any subqueries that read documents.
298298

299-
See the [List of optimizer rules](aql/execution-and-performance-optimizer.html#list-of-optimizer-rules)
299+
See the list of [optimizer rules](aql/execution-and-performance-optimizer.html#optimizer-rules)
300300
for details.
301301

302302
### Index cache refilling

3.12/aql/examples-upsert-repsert.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ the same way as the `INSERT` AQL operation can do.
318318

319319
AQL `INSERT` queries with the `optimize-cluster-multiple-document-operations`
320320
optimization applied perform similarly well in cluster deployments, but it
321-
cannot be applied in all cases (see the
322-
[List of optimizer rules](execution-and-performance-optimizer.html#list-of-optimizer-rules)
321+
cannot be applied in all cases (see the list of
322+
[optimizer rules](execution-and-performance-optimizer.html#optimizer-rules)
323323
for details).
324324

325325
## Summary

3.12/aql/execution-and-performance-explaining-queries.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ The result object also contains a `warnings` attribute, which is an array of
8282
warnings that occurred during optimization or execution plan creation.
8383

8484
Each plan in the result is an object with the following attributes:
85-
- `nodes`: the array of execution nodes of the plan. See the
86-
[list of execution nodes](execution-and-performance-optimizer.html#list-of-execution-nodes)
85+
- `nodes`: the array of execution nodes of the plan. See the list of
86+
[execution nodes](execution-and-performance-optimizer.html#execution-nodes)
8787
- `estimatedCost`: the total estimated cost for the plan. If there are multiple
8888
plans, the optimizer chooses the plan with the lowest total cost.
8989
- `collections`: an array of collections used in the query
90-
- `rules`: an array of rules the optimizer applied. See the
91-
[list of optimizer rules](execution-and-performance-optimizer.html#list-of-optimizer-rules)
90+
- `rules`: an array of rules the optimizer applied. See the list of
91+
[optimizer rules](execution-and-performance-optimizer.html#optimizer-rules)
9292
- `variables`: array of variables used in the query (note: this may contain
9393
internal variables created by the optimizer)
9494

3.12/aql/execution-and-performance-optimizer.md

+26-9
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ As you can see, the result details are very verbose. They are not covered in
6868
detail for brevity in the next sections. Instead, let's take a closer look at
6969
the results step by step.
7070

71-
#### Execution nodes
71+
#### Execution nodes of a query
7272

7373
In general, an execution plan can be considered to be a pipeline of processing steps.
7474
Each processing step is carried out by a so-called *execution node*
@@ -116,7 +116,7 @@ Here is a summary:
116116
- CalculationNode: calculates return value `i.value`
117117
- ReturnNode: returns data to the caller
118118

119-
#### Optimizer rules
119+
#### Optimizer rules used for a query
120120

121121
Note that in the example, the optimizer has optimized the `SORT` statement away.
122122
It can do it safely because there is a sorted persistent index on `i.value`, which it has
@@ -162,7 +162,7 @@ Note that some rules may appear multiple times in the list, with number suffixes
162162
This is due to the same rule being applied multiple times, at different positions
163163
in the optimizer pipeline.
164164

165-
Also see the full [List of optimizer rules](#list-of-optimizer-rules) below.
165+
Also see the full list of [optimizer rules](#optimizer-rules) below.
166166

167167
#### Collections used in a query
168168

@@ -490,12 +490,29 @@ Optimizer rules
490490

491491
### List of optimizer rules
492492

493-
The following optimizer rules may appear in the `rules` attribute of a plan.
494-
495-
Some rules may appear multiple times in the list of applied optimizations, with
496-
number suffixes like `-2`, (e.g. `remove-unnecessary-calculations-2`). This is
497-
due to the same rule being applied multiple times at different optimization stages.
498-
493+
The following user-facing optimizer rules exist and are enabled by default
494+
unless noted otherwise. You can
495+
[enable and disable optimizer rules](#turning-specific-optimizer-rules-off)
496+
except for a few required rules.
497+
498+
Some rules exist multiple times with number suffixes like `-2`,
499+
(e.g. `remove-unnecessary-calculations-2`). This is due to the same rule being
500+
applied multiple times at different optimization stages.
501+
502+
{% comment %} Execute code but exclude its output from rendering
503+
504+
@startDocuBlockInline 00_dumpOptimizerRules_cluster
505+
@EXAMPLE_ARANGOSH_RUN{00_dumpOptimizerRules_cluster}
506+
var url = "/_api/query/rules";
507+
var rules = internal.arango.GET(url);
508+
assert(Array.isArray(rules));
509+
assert(rules.some(e => e.clusterOnly));
510+
var outfile = "Documentation/optimizer-rules.json"
511+
assert(fs.write(outfile, JSON.stringify(rules, undefined, 2)));
512+
@END_EXAMPLE_ARANGOSH_RUN
513+
@endDocuBlock 00_dumpOptimizerRules_cluster
514+
515+
{% endcomment %}
499516
{% assign rulesFile = page.version.version | remove: "." | append: "-optimizer-rules" -%}
500517
{% assign options = site.data[rulesFile] -%}
501518
{% include aql-optimizer-rules.md options=options %}

3.12/release-notes-new-features35.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ If the optimization is applied, it will show as "sort-limit" rule in the query e
171171
plan.
172172

173173
Also see:
174-
- [AQL Optimizer Rules](aql/execution-and-performance-optimizer.html#list-of-optimizer-rules)
174+
- [AQL Optimizer Rules](aql/execution-and-performance-optimizer.html#optimizer-rules)
175175
(`sort-limit` rule)
176176
- [Sort-Limit Optimization in AQL](https://www.arangodb.com/2019/03/sort-limit-optimization-aql/){:target="_blank"}
177177
(blog post)

3.12/release-notes-new-features36.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ FOR d IN myView
269269
The respective optimizer rules are called `late-document-materialization`
270270
(collection source) and `late-document-materialization-arangosearch`
271271
(ArangoSearch View source). If applied, you will find `MaterializeNode`s
272-
in [execution plans](aql/execution-and-performance-optimizer.html#list-of-execution-nodes).
272+
in [execution plans](aql/execution-and-performance-optimizer.html#execution-nodes).
273273

274274
### Parallelization of cluster AQL queries
275275

_includes/aql-optimizer-rules.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
{% assign rules=include.options -%}
22
{% for rule in rules -%}
3-
{% if rule.hidden == false -%}
3+
{% if rule.flags.hidden == false -%}
44
#### `{{ rule.name }}`
55

6-
{% if rule.enterpriseOnly %}
6+
{% if rule.flags.enterpriseOnly %}
77
_Enterprise Edition only_
88
{% endif %}
99

1010
{{ rule.description }}
1111

12-
{% if rule.disabledByDefault == false %}
13-
Default: enabled
12+
{% if rule.flags.disabledByDefault -%}
13+
This rule is disabled by default.
1414
{% endif %}
1515

16-
{% if rule.clusterOnly %}
16+
{% if rule.flags.canBeDisabled == false -%}
17+
This is not an optimization and cannot be turned off.
18+
{% endif %}
19+
20+
{% if rule.flags.clusterOnly -%}
1721
Only available in cluster deployments.
1822
{% endif %}
1923

0 commit comments

Comments
 (0)