@@ -46,22 +46,32 @@ type DatabaseQuery interface {
4646}
4747
4848type QuerySubOptions struct {
49- // ShardId query option
50- ShardIds []string `json:"shardIds,omitempty"`
49+ // If you set this option to true and execute the query against a cluster deployment, then the Coordinator is
50+ // allowed to read from any shard replica and not only from the leader.
51+ // You may observe data inconsistencies (dirty reads) when reading from followers, namely obsolete revisions of
52+ // documents because changes have not yet been replicated to the follower, as well as changes to documents before
53+ // they are officially committed on the leader.
54+ //
55+ //This feature is only available in the Enterprise Edition.
56+ AllowDirtyReads bool `json:"allowDirtyReads,omitempty"`
5157
52- // Profile If set to 1, then the additional query profiling information is returned in the profile sub-attribute
53- // of the extra return attribute, unless the query result is served from the query cache.
54- // If set to 2, the query includes execution stats per query plan node in stats.nodes
55- // sub-attribute of the extra return attribute.
56- // Additionally, the query plan is returned in the extra.plan sub-attribute.
57- Profile uint `json:"profile,omitempty"`
58-
59- // Optimizer contains options related to the query optimizer.
60- Optimizer QuerySubOptionsOptimizer `json:"optimizer,omitempty"`
58+ // AllowRetry If set to `true`, ArangoDB will store cursor results in such a way
59+ // that batch reads can be retried in the case of a communication error.
60+ AllowRetry bool `json:"allowRetry,omitempty"`
6161
62- // This Enterprise Edition parameter allows to configure how long a DBServer will have time to bring the satellite collections
63- // involved in the query into sync. The default value is 60.0 (seconds). When the max time has been reached the query will be stopped.
64- SatelliteSyncWait float64 `json:"satelliteSyncWait,omitempty"`
62+ // When set to true, the query will throw an exception and abort instead of producing a warning.
63+ // This option should be used during development to catch potential issues early.
64+ // When the attribute is set to false, warnings will not be propagated to exceptions and will be returned
65+ // with the query result. There is also a server configuration option --query.fail-on-warning for setting
66+ // the default value for failOnWarning so it does not need to be set on a per-query level.
67+ FailOnWarning * bool `json:"failOnWarning,omitempty"`
68+
69+ // If set to true or not specified, this will make the query store the data it reads via the RocksDB storage engine
70+ // in the RocksDB block cache. This is usually the desired behavior. The option can be set to false for queries that
71+ // are known to either read a lot of data which would thrash the block cache, or for queries that read data which
72+ // are known to be outside of the hot set. By setting the option to false, data read by the query will not make it
73+ // into the RocksDB block cache if not already in there, thus leaving more room for the actual hot set.
74+ FillBlockCache bool `json:"fillBlockCache,omitempty"`
6575
6676 // if set to true and the query contains a LIMIT clause, then the result will have an extra attribute with the sub-attributes
6777 // stats and fullCount, { ... , "extra": { "stats": { "fullCount": 123 } } }. The fullCount attribute will contain the number
@@ -72,28 +82,106 @@ type QuerySubOptions struct {
7282 // and the LIMIT clause is actually used in the query.
7383 FullCount bool `json:"fullCount,omitempty"`
7484
85+ // The maximum number of operations after which an intermediate commit is performed automatically.
86+ IntermediateCommitCount * int `json:"intermediateCommitCount,omitempty"`
87+
88+ // The maximum total size of operations after which an intermediate commit is performed automatically.
89+ IntermediateCommitSize * int `json:"intermediateCommitSize,omitempty"`
90+
91+ // A threshold for the maximum number of OR sub-nodes in the internal representation of an AQL FILTER condition.
92+ // Yon can use this option to limit the computation time and memory usage when converting complex AQL FILTER
93+ // conditions into the internal DNF (disjunctive normal form) format. FILTER conditions with a lot of logical
94+ // branches (AND, OR, NOT) can take a large amount of processing time and memory. This query option limits
95+ // the computation time and memory usage for such conditions.
96+ //
97+ // Once the threshold value is reached during the DNF conversion of a FILTER condition, the conversion is aborted,
98+ // and the query continues with a simplified internal representation of the condition,
99+ // which cannot be used for index lookups.
100+ //
101+ // You can set the threshold globally instead of per query with the --query.max-dnf-condition-members startup option.
102+ MaxDNFConditionMembers * int `json:"maxDNFConditionMembers,omitempty"`
103+
104+ // The number of execution nodes in the query plan after that stack splitting is performed to avoid a potential
105+ // stack overflow. Defaults to the configured value of the startup option `--query.max-nodes-per-callstack`.
106+ // This option is only useful for testing and debugging and normally does not need any adjustment.
107+ MaxNodesPerCallstack * int `json:"maxNodesPerCallstack,omitempty"`
108+
75109 // Limits the maximum number of plans that are created by the AQL query optimizer.
76- MaxPlans int `json:"maxPlans,omitempty"`
110+ MaxNumberOfPlans * int `json:"maxNumberOfPlans,omitempty"`
111+
112+ // MaxRuntime specify the timeout which can be used to kill a query on the server after the specified
113+ // amount in time. The timeout value is specified in seconds. A value of 0 means no timeout will be enforced.
114+ MaxRuntime float64 `json:"maxRuntime,omitempty"`
115+
116+ // The transaction size limit in bytes.
117+ MaxTransactionSize * int `json:"maxTransactionSize,omitempty"`
118+
119+ // Limits the maximum number of warnings a query will return. The number of warnings a query will return is limited
120+ // to 10 by default, but that number can be increased or decreased by setting this attribute.
121+ MaxWarningCount * int `json:"maxWarningCount,omitempty"`
122+
123+ // Optimizer contains options related to the query optimizer.
124+ Optimizer QuerySubOptionsOptimizer `json:"optimizer,omitempty"`
125+
126+ // Profile If set to 1, then the additional query profiling information is returned in the profile sub-attribute
127+ // of the extra return attribute, unless the query result is served from the query cache.
128+ // If set to 2, the query includes execution stats per query plan node in stats.nodes
129+ // sub-attribute of the extra return attribute.
130+ // Additionally, the query plan is returned in the extra.plan sub-attribute.
131+ Profile uint `json:"profile,omitempty"`
132+
133+ // This Enterprise Edition parameter allows to configure how long a DBServer will have time to bring the satellite collections
134+ // involved in the query into sync. The default value is 60.0 (seconds). When the max time has been reached the query will be stopped.
135+ SatelliteSyncWait float64 `json:"satelliteSyncWait,omitempty"`
136+
137+ // Let AQL queries (especially graph traversals) treat collection to which a user has no access rights for as if
138+ // these collections are empty. Instead of returning a forbidden access error, your queries execute normally.
139+ // This is intended to help with certain use-cases: A graph contains several collections and different users
140+ // execute AQL queries on that graph. You can naturally limit the accessible results by changing the access rights
141+ // of users on collections.
142+ //
143+ // This feature is only available in the Enterprise Edition.
144+ SkipInaccessibleCollections * bool `json:"skipInaccessibleCollections,omitempty"`
145+
146+ // This option allows queries to store intermediate and final results temporarily on disk if the amount of memory
147+ // used (in bytes) exceeds the specified value. This is used for decreasing the memory usage during the query execution.
148+ //
149+ // This option only has an effect on queries that use the SORT operation but without a LIMIT, and if you enable
150+ //the spillover feature by setting a path for the directory to store the temporary data in with
151+ // the --temp.intermediate-results-path startup option.
152+ //
153+ // Default value: 128MB.
154+ SpillOverThresholdMemoryUsage * int `json:"spillOverThresholdMemoryUsage,omitempty"`
155+
156+ // This option allows queries to store intermediate and final results temporarily on disk if the number of rows
157+ // produced by the query exceeds the specified value. This is used for decreasing the memory usage during the query
158+ // execution. In a query that iterates over a collection that contains documents, each row is a document, and in
159+ // a query that iterates over temporary values (i.e. FOR i IN 1..100), each row is one of such temporary values.
160+ //
161+ // This option only has an effect on queries that use the SORT operation but without a LIMIT, and if you enable
162+ // the spillover feature by setting a path for the directory to store the temporary data in with
163+ // the --temp.intermediate-results-path startup option.
164+ //
165+ // Default value: 5000000 rows.
166+ SpillOverThresholdNumRows * int `json:"spillOverThresholdNumRows,omitempty"`
77167
78168 // Specify true and the query will be executed in a streaming fashion. The query result is not stored on
79169 // the server, but calculated on the fly. Beware: long-running queries will need to hold the collection
80170 // locks for as long as the query cursor exists. When set to false a query will be executed right away in
81171 // its entirety.
82172 Stream bool `json:"stream,omitempty"`
83173
84- // MaxRuntime specify the timeout which can be used to kill a query on the server after the specified
85- // amount in time. The timeout value is specified in seconds. A value of 0 means no timeout will be enforced.
86- MaxRuntime float64 `json:"maxRuntime,omitempty"`
174+ /* Not officially documented options, please use them with care. */
87175
88- // FillBlockCache if is set to true or not specified, this will make the query store the data it reads via the RocksDB storage engine in the RocksDB block cache.
89- // This is usually the desired behavior. The option can be set to false for queries that are known to either read a lot of data which would thrash the block cache,
90- // or for queries that read data which are known to be outside of the hot set. By setting the option to false, data read by the query will not make it into
91- // the RocksDB block cache if not already in there, thus leaving more room for the actual hot set.
92- FillBlockCache bool `json:"fillBlockCache,omitempty"`
176+ // [unofficial] Limits the maximum number of plans that are created by the AQL query optimizer.
177+ MaxPlans int `json:"maxPlans,omitempty"`
93178
94- // AllowRetry If set to `true`, ArangoDB will store cursor results in such a way
95- // that batch reads can be retried in the case of a communication error.
96- AllowRetry bool `json:"allowRetry,omitempty"`
179+ // [unofficial] ShardId query option
180+ ShardIds []string `json:"shardIds,omitempty"`
181+
182+ // [unofficial] This query option can be used in complex queries in case the query optimizer cannot
183+ // automatically detect that the query can be limited to only a single server (e.g. in a disjoint smart graph case).
184+ ForceOneShardAttributeValue * string `json:"forceOneShardAttributeValue,omitempty"`
97185}
98186
99187type QueryOptions struct {
0 commit comments