-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
77630: descs: improve validation performance when reading descriptors r=postamar a=postamar catkv: allow ValidationDereferencer injection This commit adds a new dependency injection entry point to the descriptor lookup functions in the catkv functions. In itself, this change does not alter the current functionality at all. In a subsequent commit it will allow descriptor reads in the descriptor collection to leverage the latter for cross-reference descriptor validation. Release justification: low-risk update Release note: None descs: refine uncommitted descriptors layer When reading a descriptor from storage via the collection, we perform cross-reference validation on it. This implies reading all referenced descriptors from storage as well. Prior to this commit, these referenced descriptors were simply discarded. We now store them in the uncommitted descriptors layer of the descriptors collection. This can dramatically dramatically reduce the number of round-trips to storage when doing a sequence of descriptor lookups in the same transaction. This happens for instance when the declarative schema changer does a DROP DATABASE CASCADE on a large database. This commit adds qualifiers to the uncommitted descriptors stored in the descriptors collection to effectively use it as a cache. We now distinguish between: 1. descriptors which have been read from storage and have since possibly been modified; 2. descriptors which have been read from storage and validated but which we know haven't yet been modified in this transaction; 3. descriptors which have been read from storage but only for the purpose of cross-reference validation of another descriptor. In this commit, right before attempting to read a descriptor from storage we look for it in (3). If we find it, we validate it (with cross-reference validation) and promote it to (2). When validating cross-references for a descriptor, we previously systematically read the referenced descriptors from storage. In this commit, we instead use any we can find in (2) or (3). Any of which we do end up reading from storage we then add to (3). The rest of the time, the descriptors in (3) are ignored. Release justification: low-risk high-benefit performance improvement Release note: None Co-authored-by: Marius Posta <[email protected]>
- Loading branch information
Showing
14 changed files
with
351 additions
and
236 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
36 changes: 18 additions & 18 deletions
36
pkg/ccl/benchccl/rttanalysisccl/testdata/benchmark_expectations
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
exp,benchmark | ||
21,AlterPrimaryRegion/alter_empty_database_alter_primary_region | ||
25-26,AlterPrimaryRegion/alter_empty_database_set_initial_primary_region | ||
21,AlterPrimaryRegion/alter_populated_database_alter_primary_region | ||
26,AlterPrimaryRegion/alter_populated_database_set_initial_primary_region | ||
20,AlterRegions/alter_empty_database_add_region | ||
21,AlterRegions/alter_empty_database_drop_region | ||
20,AlterRegions/alter_populated_database_add_region | ||
21,AlterRegions/alter_populated_database_drop_region | ||
21,AlterSurvivalGoals/alter_empty_database_from_region_to_zone | ||
21,AlterSurvivalGoals/alter_empty_database_from_zone_to_region | ||
41,AlterSurvivalGoals/alter_populated_database_from_region_to_zone | ||
41,AlterSurvivalGoals/alter_populated_database_from_zone_to_region | ||
25,AlterTableLocality/alter_from_global_to_rbr | ||
27,AlterTableLocality/alter_from_global_to_regional_by_table | ||
23,AlterTableLocality/alter_from_rbr_to_global | ||
23,AlterTableLocality/alter_from_rbr_to_regional_by_table | ||
27,AlterTableLocality/alter_from_regional_by_table_to_global | ||
25,AlterTableLocality/alter_from_regional_by_table_to_rbr | ||
17,AlterPrimaryRegion/alter_empty_database_alter_primary_region | ||
23,AlterPrimaryRegion/alter_empty_database_set_initial_primary_region | ||
17,AlterPrimaryRegion/alter_populated_database_alter_primary_region | ||
24,AlterPrimaryRegion/alter_populated_database_set_initial_primary_region | ||
17,AlterRegions/alter_empty_database_add_region | ||
17,AlterRegions/alter_empty_database_drop_region | ||
17,AlterRegions/alter_populated_database_add_region | ||
17,AlterRegions/alter_populated_database_drop_region | ||
17,AlterSurvivalGoals/alter_empty_database_from_region_to_zone | ||
17,AlterSurvivalGoals/alter_empty_database_from_zone_to_region | ||
37,AlterSurvivalGoals/alter_populated_database_from_region_to_zone | ||
37,AlterSurvivalGoals/alter_populated_database_from_zone_to_region | ||
15,AlterTableLocality/alter_from_global_to_rbr | ||
17,AlterTableLocality/alter_from_global_to_regional_by_table | ||
14,AlterTableLocality/alter_from_rbr_to_global | ||
14,AlterTableLocality/alter_from_rbr_to_regional_by_table | ||
17,AlterTableLocality/alter_from_regional_by_table_to_global | ||
15,AlterTableLocality/alter_from_regional_by_table_to_rbr |
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.