-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
56007: opt: prune unnecessary check columns r=RaduBerinde a=mgartner This commit updates the optimizer to prune synthesized `CHECK` constraint columns for `UPDATES` when columns referenced in the constraints are not updated. This may also allow the optimizer to no longer fetch those referenced columns. This should provide a performance benefit for `UDPATE`s to tables with check constraints. Notably, tables that have been given many column families (in order to reduce contention) should see a significant reduction in contention for `UPDATE`s that mutate a subset of column families. Informs #51526 Release note (performance improvement): Previously, all `CHECK` constraints defined on a table would be tested for every `UPDATE` to the table. Now, a check constraint will not be tested for validity when the values of columns it references are not being updated. The referenced columns are no longer fetchecd in cases where they were only fetched to test `CHECK` constraints. Co-authored-by: Marcus Gartner <marcus@cockroachlabs.com>
- Loading branch information
Showing
6 changed files
with
289 additions
and
191 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.