Add tidb_max_estimated_cost to prevent very expensive queries to start executing
Open
type/enhancement
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Enhancement
Add a system variable `tidb_max_estimated_cost` in both GLOBAL and SESSION contex, as well as available in SET_VAR() optimizer hint. I would argue for also have it available as direct optimizer hint as well `TIDB_MAX_ESTIMATED_COST()`.
This would allow users to not waste resources on queries that would take too long time to execute. As well as returning an error if the generated plan is expensive, instead of running the expensive plan.
Contributor guide
Assessment
This issue has not been assessed yet.