Will TiDB Implement Execution Plan Caching in the Future?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TIDB 后续是否实现 执行计划缓存 功能

| username: DBAER

Will future versions implement the execution plan caching feature? For example, both Oracle and Oceanbase have this feature.

| username: WalterWj | Original post link

This? Prepare 语句执行计划缓存 | PingCAP 文档中心

| username: DBAER | Original post link

No, this is for prepared statements, similar to this.

| username: 托马斯滑板鞋 | Original post link

This? (Non-Prepared Statement Execution Plan Cache)

| username: WalterWj | Original post link

I think it’s possible :thinking:

| username: tidb菜鸟一只 | Original post link

Non-prepared statements can also be cached; it just depends on whether you think caching is worthwhile.

| username: YuchongXU | Original post link

This will probably come gradually.

| username: TiDBer_ok0VXN1s | Original post link

There is now, but each time the parsing doesn’t work very well.

| username: Eason | Original post link

Non-prepared plan cache is already supported, and there are plans to extend this support to the instance level (currently it is at the session level). All of this is on the roadmap.