File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
aql/high-level-operations
release-notes/version-3.12 Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,20 @@ UPSERT { a: 1234 }
243243 OPTIONS { indexHint: … , forceIndexHint: true }
244244```
245245
246+ ### ` readOwnWrites `
247+
248+ The ` readOwnWrites ` option allows an ` UPSERT ` operation to process its inputs one
249+ by one. The default value is ` true ` . When enabled, the ` UPSERT ` operation can
250+ observe its own writes and can handle modifying the same target document multiple
251+ times in the same query.
252+
253+ When the option is set to ` false ` , an ` UPSERT ` operation processes its inputs
254+ in batches. Normally, a batch has 1000 inputs, which can lead to a faster execution.
255+ However, when using batches, the ` UPSERT ` operation can essentially not observe its own writes.
256+ You should only set the ` readOwnWrites ` option to ` false ` if you can
257+ guarantee that the input of the ` UPSERT ` leads to disjoint documents being
258+ inserted, updated, or replaced.
259+
246260## Returning documents
247261
248262` UPSERT ` statements can optionally return data. To do so, they need to be followed
Original file line number Diff line number Diff line change @@ -175,6 +175,21 @@ UPDATE { logins: OLD.logins + 1 } IN users
175175
176176Read more about [ ` UPSERT ` operations] ( ../../aql/high-level-operations/upsert.md ) in AQL.
177177
178+ ### ` readOwnWrites ` option for ` UPSERT ` operations
179+
180+ A ` readOwnWrites ` option has been added for ` UPSERT ` operations. The default
181+ value is ` true ` and the behavior is identical to previous versions of ArangoDB that
182+ do not have this option. When enabled, an ` UPSERT ` operation processes its
183+ inputs one by one. This way, the operation can observe its own writes and can
184+ handle modifying the same target document multiple times in the same query.
185+
186+ When the option is set to ` false ` , an ` UPSERT ` operation processes its inputs
187+ in batches. Normally, a batch has 1000 inputs, which can lead to a faster execution.
188+ However, when using batches, the ` UPSERT ` operation cannot observe its own writes.
189+ Therefore, you should only set the ` readOwnWrites ` option to ` false ` if you can
190+ guarantee that the input of the ` UPSERT ` leads to disjoint documents being
191+ inserted, updated, or replaced.
192+
178193### Added AQL functions
179194
180195The new ` PARSE_COLLECTION() ` and ` PARSE_KEY() ` let you more extract the
You can’t perform that action at this time.
0 commit comments