Skip to content

Adding unique index using global sort is slow #61689

@CbcWestwolf

Description

@CbcWestwolf

In an internal 200T adding index testing, we found that adding a normal index costs 2h30m, while adding a unique index costs 3h24m.
The extra time cost is in checkDuplicateForUniqueIndex, which is unnecessary for global sort.
Besides, we can detect duplicate on step read index, merge sort and cloud import, which helps to report the error in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-8.1This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.component/ddlThis issue is related to DDL of TiDB.severity/majortype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions