docs(sql): TRUNCATE TYPE / TRUNCATE BUCKET document their transactional behaviour - #442
Merged
Conversation
…al behaviour (arcadedb#6220) Both pages described what the command deletes and said nothing about what a ROLLBACK after it does. Until v26.9.1 the answer was "almost nothing": the statement committed the caller's transaction from the inside - dropping the type's indexes, then committing once per arcadedb.truncateBatchSize records - so a rollback recovered at most the last uncommitted batch, and none of it when the type had any index. The behaviour now depends on whether a transaction is active when the command runs, which is worth stating because it is also how a user chooses between the two: inside a transaction the truncate is part of it and a ROLLBACK puts every record back; with none active the command owns one and takes the faster drop-indexes / batch-delete / rebuild path, which commits as it goes and cannot be undone. Over HTTP the request's auto-commit transaction decides, so "autoCommit": false selects the faster path. Each page also names the `transactional` field the result set now reports, and carries a note about the pre-26.9.1 behaviour for anyone reading against an older server.
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to ArcadeData/arcadedb#6225 (fixes ArcadeData/arcadedb#6220).
Both
TRUNCATEreference pages described what the command deletes and said nothing about what aROLLBACKafter it does. Until v26.9.1 the answer was "almost nothing": the statement committed the caller's transaction from the inside - dropping the type's indexes, then committing once perarcadedb.truncateBatchSizerecords - so a rollback recovered at most the records of the last uncommitted batch, and none at all when the type had any index.The behaviour now depends on whether a transaction is active when the command runs, and that is also how a user chooses between the two paths:
ROLLBACKputs every record back (transactional: true);transactional: false).Over HTTP the request's auto-commit transaction decides, so
"autoCommit": falseselects the faster path.Each page gains a Transactions section saying this, names the
transactionalfield the result set now reports, and carries aNOTEabout the pre-26.9.1 behaviour for anyone reading against an older server.