pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
https://pingcap.com
Apache License 2.0
36.89k stars 5.81k forks source link

lightning should not run duplicate detection on non-unique index #53669

Open lance6716 opened 3 months ago

lance6716 commented 3 months ago

by the KV format of non-unique index, there's no need to check non-unique index KV overwritten because values are always empty

https://github.com/pingcap/tidb/blob/afd8de1f62188516b8bdc50c292262a20b33bd0c/pkg/lightning/backend/local/duplicate.go#L721-L725

we can skip for non-unique index here

lance6716 commented 3 months ago

/cc @lyzx2001