Skip to content

make new/empty table range splitting consistent  #91087

@cucaroach

Description

@cucaroach

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-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

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions