title: Slow query at one DB, but fast at his copy
body: <p>We have a Laravel application (version 5.4.18) which is connected to MySQL (5.6.38) database (300k rows totally), MyISAM type.
  And we have api-response like <code>Model::with('anothermodel')-&gt;paginate(25)</code>, and at some point the execution time of this query has reached 18 seconds, which is very big value. I created a sandbox with a copy of the live laravel environment that uses a copy of the exaclty same database (at the same server), and now this api-response is executed in 2,5 seconds. If we trying to connect sandbox laravel to the live DB, then api execution is 18s again. Please check the image.</p>
  <p><a href="https://i.stack.imgur.com/YE4Qu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/YE4Qu.png" alt="api demo" /></a></p>
  <p>So if we assume that the problem is in the DB table of live website, but if we try to measure this query with <code>microtime</code>, then it will show that time required to generate this query and grab the data from database is just 0.7 sec.</p>
  <p>So if we assume that problem is in API routes or in the Laravel code, but exaclty same code is executed without any problem if I just copy it into the subdirectory (as a sandbox).</p>
  <p>Any ideas?</p>
  <p>Also some server info: PHP 7.0.29 at Linux server with 32gb RAM.</p>