This might be helpful. Search for "max_execution_time" in this doc. https://dev.mysql.com/doc/refman/8.0/en/optimizer-hints.html#optimizer-hints-execution-time