{"id":288,"date":"2017-02-17T19:50:38","date_gmt":"2017-02-17T17:50:38","guid":{"rendered":"http:\/\/catyellow.net\/blog\/?p=288"},"modified":"2018-06-02T21:08:08","modified_gmt":"2018-06-02T19:08:08","slug":"how-quickly-to-check-time-of-mysql-query-by-running-it-n-times","status":"publish","type":"post","link":"https:\/\/catyellow.net\/blog\/?p=288","title":{"rendered":"How quickly to check time of mysql query by running it N times"},"content":{"rendered":"<p>After query optimization I just needed to run query several times to check time and compare it with original query. Query code was placed into <em>query.sql<\/em> file.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">TIMEFORMAT=%R &amp;amp;&amp;amp; for i in {1..10}; do time mysql &amp;lt; query.sql &amp;gt; \/dev\/null; done<\/pre>\n<p><!--more--><br \/>\nThis is output:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n 1.913\r\n 1.152\r\n 1.421\r\n 1.460\r\n 1.409\r\n 1.421\r\n 0.937\r\n 1.255\r\n 1.376\r\n 1.220\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>After query optimization I just needed to run query several times to check time and compare it with original query. Query code was placed into query.sql file.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[3,64],"_links":{"self":[{"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/288"}],"collection":[{"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=288"}],"version-history":[{"count":8,"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/288\/revisions"}],"predecessor-version":[{"id":331,"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/288\/revisions\/331"}],"wp:attachment":[{"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/catyellow.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}