cockroachdb / cockroachdb/cockroach

sql: don't emit manual split points at the start/end of table indexes when range coalescing is enabled

Open
#103,669 2 comments 0 reactions 0 assignees View on GitHub
C-bug S-3-ux-surprise
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Epic: CRDB-28121

**Describe the problem**

Now that #81008 is addressed and range coalescing is enabled by default, we get into a UX papercut:

- when a table is created together with its indexes, they get merged together in 1 range (e.g `CREATE TABLE t (x INT, INDEX(x))`
- if the index is created separately with CREATE INDEX, it gets a manual split point with a 1 hour expiry. See the function `MaybeSplitIndexSpans`.

This assymmetry of behavior is confusing and undesirable.

**Expected behavior**

1) FOREMOST, the behavior should be the same in both cases
2) EITHER:
- There is no manual split point when CREATE INDEX is issued separately from CREATE TABLE and when range coalescing is enabled.
- OR, we find these temporary split points desirable, AND in that case we also introduce them in the first syntax (index creation as part of table creation)

NB: this should work properly in secondary tenants too.

There's also possibly a discussion of whether 1 hour is a suitable default for the split point expiry.

Jira issue: CRDB-28122

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.