Skip to content

splitTableRanges called for each batch in writePhysicalTableRecord #38436

@mjonss

Description

@mjonss

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Code inspection.

In ddl.Ctx.writePhysicalTableRecord
for each batch of kvRanges it starts over and calls splitTableRanges again (meaning it requests information of all ranges that would match a full table, from startKey of current batch.

This results in waste of resources, it should either do the query once before the loop, or limit the query to max batchsize + 1 ranges (since the last range is needed later to see if there are any remaining range left to do).

2. What did you expect to see? (Required)

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

Current master, as of 00791e7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions