Add a framework for disabling plans during optimization.
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
Problem
There is no universal way to disable the plan cache for a query during optimization. The two existing methods have limitations:
1. `SetSkipPlanCache` disables the plan cache preemptively, even if the problematic plan is not ultimately selected.
2. `isPhysicalPlanCacheable` walks the final plan to check cacheability, but not all conditions can be discovered at this stage since context from earlier optimization phases (e.g., access path selection) may be lost.
Enhancement
Add support to both base.Plan and util.AccessPath to track whether a plan can be cached along with the reason. This allows:
• Marking paths as non-cacheable early during path generation
• Propagating the non-cacheable reason through plan construction
• Checking the reason during plan cache validation without needing type-specific logic
Contributor guide
Assessment
This issue has not been assessed yet.