cockroachdb / cockroachdb/cockroach

sql/schemachanger: CREATE INDEX / ADD COLUMN can be optimized for empty relations

Open
#106,301 1 comment 0 reactions 0 assignees View on GitHub
C-enhancement E-starter O-support P-3 T-sql-foundations
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

When executing schema changes against empty tables, we run many extra operations, which can be skipped. This can make specific DDL scripting for users slow since they may have implicit transactions of the form:

```
CREATE TABLE...
CREATE INDEX.... <---- each one can take a few seconds
CREATE INDEX....
CREATE INDEX....
```

Users can workaround this problem by adding a BEGIN/END for transactions since that will skip unnecessary steps.

Jira issue: CRDB-29495

Epic CRDB-60938

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.