Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spanconfig: de-dup configs in system.span_configurations #82073

Open
irfansharif opened this issue May 30, 2022 · 1 comment
Open

spanconfig: de-dup configs in system.span_configurations #82073

irfansharif opened this issue May 30, 2022 · 1 comment
Labels
A-zone-configs C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@irfansharif
Copy link
Contributor

irfansharif commented May 30, 2022

Is your feature request related to a problem? Please describe.

We currently store the full config protobuf for each index in system.span_configurations. The unique set of configs you'd generally expect is going to an order of magnitude smaller than the number of tables/indexes. Storing a single copy of unique configs would likely save a lot of space for this system table and possibly speed up a class of operations around the table.

> show create table system.span_configurations;
             table_name             |                    create_statement
------------------------------------+----------------------------------------------------------
  system.public.span_configurations | CREATE TABLE public.span_configurations (
                                    |     start_key BYTES NOT NULL,
                                    |     end_key BYTES NOT NULL,
                                    |     config BYTES NOT NULL,
                                    |     CONSTRAINT "primary" PRIMARY KEY (start_key ASC),
                                    |     CONSTRAINT check_bounds CHECK (start_key < end_key)
                                    | )

Additional context

We use a similar optimization in the in-memory data structures constructed off this table state: 3b0df85. This de-duping was also left as future work in the original RFC. This might raise in importance as we continue adding more fields to span configs: #70614.

+cc @cockroachdb/sql-schema.

Jira issue: CRDB-16198

@irfansharif irfansharif added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-zone-configs labels May 30, 2022
@blathers-crl blathers-crl bot added the T-sql-schema-deprecated Use T-sql-foundations instead label May 30, 2022
@ajwerner
Copy link
Contributor

This seems unimportant in that it is unlikely that the total span config size is larger than the descriptors. Until the size of this table turns out to be a problem, this is going to a backlog.

@exalate-issue-sync exalate-issue-sync bot added T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) and removed T-sql-schema-deprecated Use T-sql-foundations instead labels May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-zone-configs C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

No branches or pull requests

2 participants