pingcap / pingcap/tidb

`Recommend Index` statements may be slow and can't be killed

Open
#64,345 1 comment 0 reactions 0 assignees View on GitHub
affects-8.5 report/customer sig/planner type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement
In a `Recommend Index` statement, for all related DBs in the queries, it will fetch all the table metadata in those DBs. When there are a lot of queries (1000 by default) or the user has lots of tables, this process costs many resources and time, especially with infoschema v2 now.

Image

What's worse, during this process, there is no checkpoint for the timeout option or `kill` signal, so the user is not able to `kill` it, and the timeout option is also ineffective.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.