Skip to content

Commit

Permalink
Decrease Crucible resources in a CTE (#4290)
Browse files Browse the repository at this point in the history
`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
jmpesp authored Oct 20, 2023
1 parent 1beda0b commit 36e0470
Show file tree
Hide file tree
Showing 6 changed files with 822 additions and 355 deletions.
Loading

0 comments on commit 36e0470

Please sign in to comment.