cockroachdb / cockroachdb/cockroach
sql/schemachanger: CREATE INDEX / ADD COLUMN can be optimized for empty relations
Open
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
Assessment
This issue has not been assessed yet.