Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Decrease Crucible resources in a CTE (#4290)
`decrease_crucible_resource_count_and_soft_delete_volume` is currently implemented as a rather heavy weight transaction. This commit changes that to a CTE. What enabled this was learning that Cockroach can emit JSON through some built-in functions: part of what made the transaction heavy weight was that it was serializing the Crucible resources to clean up and recording that in a column for the soft-deleted Volume. The fact that this can occur in Cockroach means that the entire transaction can be converted into a CTE.
- Loading branch information