Closed einhverfr closed 2 weeks ago
Hmm I just realized I am going about this in a way that is probably way too intrusive. I just came up with a better way.
@einhverfr SELECT /*+ MAX_EXECUTION_TIME(<seconds>) */ ...
can be sent as a native query
Right. Right now I have some things working but my test cases are not passing.
I am right now finishing up my test cases. I can have a PR by the end of the weekend
@StpMax I expect to have this done shortly, but if you want to take this over I can send you my work to date.
Hi @einhverfr Please continue working on this if you want. If not, i'll take care of it within next few weeks. I'll keep assign myself to this issue to ensure i don't forget about it. :)
Short description and motivation for the proposed feature
In MySQL, SQL statements timeout is the value of max_execution_time. By default it's 0 (no limit). I've seen companies that set a very low value, because it makes sense for most queries in an OLTP workload.
max_execution_time
can be overridden:We want to solve 2 problems:
We can use this solution:
We don't care about non-SELECT queries, they don't have good reasons to take a very long time.
We also don't care for queries that contain a comment after SELECT. Users who know MySQL well enough to add optimiser hints can also take care of MAX_EXECUTION_TIME.
Video or screenshots
No response
Describe some possible solutions
No response
Anything else?
I can work on a PR for this over the course of the next couple weeks.