help wantedtype/enhancementtype/performance
倉庫指標
- Star
- (40,090 star)
- PR 合併指標
- (平均合併 14天 4小時) (30 天內合併 346 個 PR)
描述
Feature Request
Is your feature request related to a problem? Please describe:
FindCols(https://github.com/pingcap/tidb/blob/c8d1ff7ca66f6e98d2002c429addf5ba34fd0416/table/column.go#L87)FindColumn(https://github.com/pingcap/tidb/blob/873d9514bc94be8e76c30c863a85155eafaa468a/expression/schema.go#L111)
will be frequently called when build query plan or build insert value list.
now it uses linear search to find column info match target name....
when the table has limitation columns it works well...
but when table got many columns (e.g. 200+ columns), upper logic will find 200 columns to do linear search in 200 items.

Describe the feature you'd like:
maybe we should adaptively replace a linear search with another method when table has many columns