8000 sql/schemachanger: add optional syntax for ADD COLUMN to store new column in existing secondary indexes · Issue #111380 · cockroachdb/cockroach · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
sql/schemachanger: add optional syntax for ADD COLUMN to store new column in existing secondary indexes #111380
Open
@fqazi

Description

@fqazi

Adding a new column when nullable is relatively cheap and only involves modifying the primary index to add a new storing column without any backfill. Unfortunately, there can be side effects for existing queries that use SELECT *, since they will now need to join between the primary and secondary index to resolve a row (i.e. finding columns not stored in the secondary index via the primary index).

One good alternative would be to add a new clause on ADD COLUMN so that indexes with STORING columns are all updated to include this column (or a user-selectable subset). This new syntax would update existing secondary indexes to add this new nullable column.

related: #98777

Jira issue: CRDB-31878

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-schema-changesC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0