{"id":939,"date":"2011-12-29T11:35:38","date_gmt":"2011-12-29T10:35:38","guid":{"rendered":"http:\/\/kudzia.eu\/b\/?p=939"},"modified":"2011-12-29T11:36:58","modified_gmt":"2011-12-29T10:36:58","slug":"excluding-some-mysql-queries-from-the-slow-query-log","status":"publish","type":"post","link":"https:\/\/kudzia.eu\/b\/2011\/12\/excluding-some-mysql-queries-from-the-slow-query-log\/","title":{"rendered":"excluding some mysql queries from the slow query log"},"content":{"rendered":"<p>i keep close eye on the mysql-slow.log log of queries that take more than 1s to execute. but at the same time i know about few house-keeping queries that are executed few times per day that by design take longer to execute [eg table checksums]. i don&#8217;t want those queries to &#8216;pollute&#8217; the slow query log. <\/p>\n<p>one approach was to &#8216;chop&#8217; the heavy\/planned queries into smaller ones; another &#8211; to temporarily disable slow query logging or change the minimum duration threshold needed for queries to enter mysql-slow.log. 2nd one sounded more reasonable; solution:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nSET @@session.long_query_time = 3;\r\n\r\n.. actual query;\r\n\r\nSET @@session.long_query_time=@@global.long_query_time;\r\n<\/pre>\n<p>[inspired by <a href=\"http:\/\/stackoverflow.com\/a\/8061234\/104398\">this<\/a> post]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>i keep close eye on the mysql-slow.log log of queries that take more than 1s to execute. but at the same time i know about few house-keeping queries that are executed few times per day that by design take longer to execute [eg table checksums]. i don&#8217;t want those queries to &#8216;pollute&#8217; the slow query [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,51],"tags":[12],"class_list":["post-939","post","type-post","status-publish","format-standard","hentry","category-tech","category-unimportant","tag-mysql"],"_links":{"self":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/939","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/comments?post=939"}],"version-history":[{"count":2,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/939\/revisions"}],"predecessor-version":[{"id":941,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/posts\/939\/revisions\/941"}],"wp:attachment":[{"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/media?parent=939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/categories?post=939"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kudzia.eu\/b\/wp-json\/wp\/v2\/tags?post=939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}