-
Notifications
You must be signed in to change notification settings - Fork 4.1k
make new/empty table range splitting consistent #91087
Description
If you create a table and add indexes in same transaction no backfill is needed and as a side affect no range splits are issued. If you create a table and add indexes in a separate transaction a backfill is required and even if no rows exist yet range splits are issued for the index boundaries. This has huge implications for performance of batch inserts (including COPY) into the table, the range splitting unlocks concurrency at the kvcoord level and instead of all the inserts happening serially on one goroutine we split them across into per range concurrency. Anecdotally the result is a 2x speedup in data ingestion for the TPCH lineitem table (~15 or so columns and 8 secondary indexes).
Ideally both approaches would result in the better performance.
Jira issue: CRDB-21102
Epic CRDB-60948