pingcap / pingcap/tidb

Introduce LLM Access Point into TiDB

Open
#60,727 0 comments 1 reaction 1 assignee Claimed by @qw4990 View on GitHub
sig/planner type/enhancement
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.

![Image](https://github.com/user-attachments/assets/852a98f7-c0b6-453a-a269-97d55d11f3c8)

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.