Introduce LLM Access Point into TiDB
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement
Based on some internal tests, LLM can make good judgements in some scenarios, especially in troubleshooting, SQL tuning and etc.
Below are 2 possible scenarios that LLM can benefit:
1. Index Advisor: although our Optimizer has already supported [Index Advisor](https://docs.pingcap.com/tidb/stable/index-advisor/), we can still leverage LLM to improve our capability of Index Advisor further, for example, if our Index Advisor can't recommend any index, we can fall back to use LLM to give some recommendations.
2. SPM: see https://github.com/pingcap/tidb/issues/60148 for more details, but briefly speaking, we'll use SPM to help users solve slow queries, and in this scenarios, we can leverage LLM to give us some recommendations, for example, here are 5 plans of a certain SQL in `statement_stats`, we can ask LLM to tell us which plan is the best for now and guide the user to create a binding based on that.
So it's time to introduce LLM Access Point into TiDB, and leverage its capability to make TiDB more intelligent.

Contributor guide
Assessment
This issue has not been assessed yet.