Skip to content

Commit

Permalink
descs: refactor GetAll* methods
Browse files Browse the repository at this point in the history
This commit refactors the descs.Collection's GetAll* methods, which
return descriptors and other catalog metadata in bulk, to share a common
access path in which the descriptor's layers are properly aggregated.
This is non-trivial as there are numerous edge cases:
  - virtual schemas and objects exist for all databases and their
    descriptors don't reference the parent database at all,
  - descriptorless public schemas and temporary schemas only exist as
    namespace entries,
  - functions don't have namespace entries,
  - and so forth.

These new methods are delegated to by the existing methods which are now
deprecated.

Informs cockroachdb#64089.

Release note: None
  • Loading branch information
Marius Posta committed Dec 13, 2022
1 parent 7939ba8 commit 10648d7
Show file tree
Hide file tree
Showing 7 changed files with 397 additions and 203 deletions.
44 changes: 22 additions & 22 deletions pkg/bench/rttanalysis/testdata/benchmark_expectations
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,29 @@ exp,benchmark
14,CreateRole/create_role_with_no_options
10,DropDatabase/drop_database_0_tables
11,DropDatabase/drop_database_1_table
12,DropDatabase/drop_database_2_tables
13,DropDatabase/drop_database_3_tables
11,DropDatabase/drop_database_2_tables
11,DropDatabase/drop_database_3_tables
18,DropRole/drop_1_role
26,DropRole/drop_2_roles
34,DropRole/drop_3_roles
11,DropSequence/drop_1_sequence
12,DropSequence/drop_2_sequences
13,DropSequence/drop_3_sequences
12,DropSequence/drop_3_sequences
11,DropTable/drop_1_table
12,DropTable/drop_2_tables
13,DropTable/drop_3_tables
12,DropTable/drop_3_tables
12,DropView/drop_1_view
13,DropView/drop_2_views
13,DropView/drop_3_views
10,Grant/grant_all_on_1_table
11,Grant/grant_all_on_2_tables
11,Grant/grant_all_on_3_tables
10,Grant/grant_all_on_2_tables
10,Grant/grant_all_on_3_tables
11,GrantRole/grant_1_role
15,GrantRole/grant_2_roles
3,ORMQueries/activerecord_type_introspection_query
6,ORMQueries/django_table_introspection_1_table
6,ORMQueries/django_table_introspection_4_tables
6,ORMQueries/django_table_introspection_8_tables
4,ORMQueries/activerecord_type_introspection_query
8,ORMQueries/django_table_introspection_1_table
8,ORMQueries/django_table_introspection_4_tables
8,ORMQueries/django_table_introspection_8_tables
2,ORMQueries/has_column_privilege_using_attnum
2,ORMQueries/has_column_privilege_using_column_name
1,ORMQueries/has_schema_privilege_1
Expand All @@ -69,19 +69,19 @@ exp,benchmark
6,ORMQueries/has_table_privilege_5
85,ORMQueries/hasura_column_descriptions
85,ORMQueries/hasura_column_descriptions_8_tables
6,ORMQueries/hasura_column_descriptions_modified
4,ORMQueries/information_schema._pg_index_position
3,ORMQueries/pg_attribute
3,ORMQueries/pg_class
7,ORMQueries/pg_is_other_temp_schema
7,ORMQueries/pg_is_other_temp_schema_multiple_times
4,ORMQueries/pg_my_temp_schema
4,ORMQueries/pg_my_temp_schema_multiple_times
4,ORMQueries/pg_namespace
3,ORMQueries/pg_type
8,ORMQueries/hasura_column_descriptions_modified
6,ORMQueries/information_schema._pg_index_position
5,ORMQueries/pg_attribute
5,ORMQueries/pg_class
9,ORMQueries/pg_is_other_temp_schema
9,ORMQueries/pg_is_other_temp_schema_multiple_times
6,ORMQueries/pg_my_temp_schema
6,ORMQueries/pg_my_temp_schema_multiple_times
6,ORMQueries/pg_namespace
5,ORMQueries/pg_type
10,Revoke/revoke_all_on_1_table
11,Revoke/revoke_all_on_2_tables
11,Revoke/revoke_all_on_3_tables
10,Revoke/revoke_all_on_2_tables
10,Revoke/revoke_all_on_3_tables
9,RevokeRole/revoke_1_role
11,RevokeRole/revoke_2_roles
1,SystemDatabaseQueries/select_system.users_with_empty_database_Name
Expand Down
Loading

0 comments on commit 10648d7

Please sign in to comment.