Set a Max Execution Time in Your MYSQL Query

Sometimes I need to run a long query.
Or sometimes when running one using TablePlus and it is taking a long time the kill process doesn’t always work.
You can set a timeout with this syntax in your select /*+ MAX_EXECUTION_TIME(2000) */. The time is in milliseconds.
This is a part of the mysql optimizer hints and there’s lots more to set.
Something like this:

  /*+ MAX_EXECUTION_TIME(2000) */ -- in milliseconds
  JOIN prescription_model ON = prescription_model.prescription_id
WHERE < 1000000
  and prescription_model.model LIKE "%Distal Finger Spring%"

Leave a Reply

Your email address will not be published. Required fields are marked *