{"id":165241,"date":"2013-01-10T09:49:02","date_gmt":"2013-01-10T05:49:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=165241"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=165241","title":{"rendered":"<span class=\"post_title\">\u041a\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043f\u043e\u043f\u0430\u043b\u0438 \u0432 QUERY CACHE<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0412\u0441\u0435 \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u043f\u0440\u043e \u0442\u043e, \u0447\u0442\u043e <code>QUERY CACHE<\/code> \u0431\u044b\u0432\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u0435\u043d, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043d\u0438\u0437\u043a\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 DML \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 (\u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"http:\/\/habrahabr.ru\/post\/41166\/\">\u0442\u0443\u0442<\/a>). \u041f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441, \u0430 \u0447\u0442\u043e \u0436\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 <code>QUERY CACHE<\/code>&#8216;\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u041f\u043e\u0438\u0441\u043a \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432 \u0441\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043c\u0435\u043d\u044f \u0432 \u0442\u0443\u043f\u0438\u043a. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0432\u0435\u0440\u043d\u044b\u043c, \u044f \u043d\u0430\u0448\u0435\u043b <a href=\"http:\/\/stackoverflow.com\/questions\/4187794\/how-to-list-cached-queries-in-mysql-qcache-queries-in-cache\">\u0442\u0443\u0442<\/a>. \u041e\u0442\u0432\u0435\u0442 \u0433\u043b\u0430\u0441\u0438\u043b \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:  <\/p>\n<blockquote><p> there is no way to find what queries are now cached<\/p><\/blockquote>\n<p>  \u0442.\u0435. \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u041b\u0438\u0448\u044c \u0441\u043f\u0443\u0441\u0442\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0442\u0430\u043a, \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u043b\u0435\u0433\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0411\u0414 \u0431\u0435\u0437 \u043f\u0430\u0442\u0447\u0438\u043d\u0433\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432. \u042d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043b\u044f <code>INFORMATION_SCHEMA<\/code>.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041e\u0431\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043a\u044d\u0448\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/h4>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 <code>QUERY CACHE<\/code> \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437:<br \/>   \u2014 pool&#8217;\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<br \/>   \u2014 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u00ab\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\u00bb<br \/>   \u2014 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u00ab\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0442\u0430\u0431\u043b\u0438\u0446\u00bb<br \/>   \u2014 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439.<br \/>  \u0418\u043c\u0435\u043d\u043d\u043e \u0432\u0432\u0438\u0434\u0443 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430 (\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043e\u043a) <code>QUERY CACHE<\/code> \u0447\u0430\u0441\u0442\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e\u0442 \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u0432 \u043c\u043d\u043e\u0433\u043e\u044f\u0434\u0435\u0440\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043e\u0439 \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c DML, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c \u044d\u0442\u043e\u0433\u043e \u043a\u044d\u0448\u0430 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c \u0435\u0433\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u044c. \u0412 \u043e\u0431\u0449\u0435\u043c \u0432\u0438\u0434\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0430\u044f <code>QUERY CACHE<\/code> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0442\u0438\u043f\u0430 <code>Query_cache_block<\/code>. \u0411\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0432\u044f\u0437\u0435\u0439 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043f\u0443\u0442\u0435\u043c \u0432\u043e \u0438\u043c\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043e\u0447\u0438\u0441\u0442\u043a\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043f\u0430\u0440\u0430 \u00ab\u0434\u0435\u0440\u0435\u0432\u044c\u0435\u0432\u00bb. \u041f\u0435\u0440\u0432\u043e\u0435 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u00ab\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\u00bb <code>HASH Query_cache::queries<\/code>, \u0430 \u0432\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u00ab\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0442\u0430\u0431\u043b\u0438\u0446\u00bb <code>HASH Query_cache::tables<\/code>. \u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 pool&#8217;\u0430 <code>QUERY CACHE<\/code> \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0432\u0438\u0434\u0435:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/15c\/220\/e3f\/15c220e3fab81553e2ea64f61ac5ff32.png\"\/><br \/>  \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 \u043a \u0432\u0435\u0440\u0441\u0438\u0438, \u043d\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u0430 \u0443\u0436\u0435 \u043c\u043d\u043e\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u0439: \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u00ab\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432\u00bb \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u043a\u0430\u043b\u044c\u043a\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043f\u043e \u043d\u0438\u043c, \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u00ab\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0442\u0430\u0431\u043b\u0438\u0446\u00bb \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0438\u0432\u0448\u0438\u0445\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u0438\u0437 \u043a\u044d\u0448\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 (\u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u0435\u0441\u0442\u044c \u0435\u0449\u0451 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0432\u044f\u0437\u0435\u0439, \u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u044f \u0438\u0445 \u043e\u043f\u0443\u0449\u0443, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043e\u043d\u0438 \u043d\u0430\u043c \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b).<br \/>  \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u0441\u0445\u0435\u043c\u0435 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0430\u044f \u043d\u0430\u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f (\u043f\u043e\u043c\u0435\u0447\u0435\u043d\u0430 \u043a\u0440\u0430\u0441\u043d\u044b\u043c) \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Query_cache_query<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">struct Query_cache_query {   ulonglong limit_found_rows; ...   inline uchar* query() ... }; <\/code><\/pre>\n<p>   \u2014 SQL \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043a\u043e\u043b-\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f  <\/div>\n<\/div>\n<p>  \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u0435\u0451 \u043e\u0442\u0442\u0443\u0434\u0430. <\/p>\n<h4>\u041e\u0431\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430\u0445<\/h4>\n<p>  \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b: \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c MySQL \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c \u2014 <code>INFORMATION_SCHEMA Plugins<\/code>. \u041f\u0435\u0440\u0432\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 <code>QUERY CACHE<\/code> \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u043e <code>Roland Bouman<\/code> \u0432 \u0441\u0432\u043e\u0435\u043c \u0431\u043b\u043e\u0433\u0435. \u0415\u0433\u043e \u0441\u0442\u0430\u0442\u044c\u044f, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0442\u0430\u0440\u0430\u044f, \u043a \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443 \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0430\u0441\u044c. \u0414\u043b\u044f \u0442\u0435\u0445 \u043a\u0442\u043e \u043f\u043b\u043e\u0445\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u043a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d\u044b, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"http:\/\/habrahabr.ru\/post\/131410\/\">\u044d\u0442\u043e\u0442<\/a> \u043f\u043e\u0441\u0442 \u043d\u0430 \u0445\u0430\u0431\u0440\u0435, \u043e\u0442 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 MySQL <a href=\"http:\/\/habrahabr.ru\/users\/petropavel\/\" class=\"user_link\">petropavel<\/a> \u0438\u043b\u0438 \u0436\u0435 \u043a\u043d\u0438\u0433\u0443 <code>MySQL 5.1 Plugin Development<\/code> \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0441 \u0443\u0447\u0430\u0441\u0442\u0438\u0435\u043c \u044d\u0442\u043e\u0433\u043e \u0436\u0435 \u0430\u0432\u0442\u043e\u0440\u0430. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0443\u0434\u0435\u043b\u0438\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u044f\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043f\u043e\u0434 MySQL 5.5.29 \u2014 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f <code>INFORMATION_SCHEMA<\/code> \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c:<br \/>   \u2014 <code>ST_FIELD_INFO<\/code> \u2014 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0442\u0430\u0431\u043b\u0438\u0446\u044b<br \/>   \u2014 <code>mysql_declare_plugin<\/code> \u2014 \u043c\u0430\u043a\u0440\u043e\u0441 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0441 \u0442\u0438\u043f\u043e\u043c <code>MYSQL_INFORMATION_SCHEMA_PLUGIN<\/code> \u0438 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<br \/>   \u2014 <code>st_mysql_information_schema<\/code> \u2014 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0435\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0440\u0430 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430<br \/>   \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0430\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443<br \/>   \u2014 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<br \/>  \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0439 \u0434\u0432\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b: \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043a\u044d\u0448\u0435 \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u0430\u044f \u0438\u043c\u0438 \u043f\u0430\u043c\u044f\u0442\u044c <code>QUERY_CACHE_RESULTS<\/code>, \u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0430\u0431\u043b\u0438\u0446 \u0411\u0414, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 <code>QUERY_CACHE_TABLES<\/code>. \u0427\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0434 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u043c \u0438\u0437 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u043f\u0440\u043e\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435, \u043d\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u044b\u0435 \u0434\u043b\u044f \u043d\u0430\u0441 \u0444\u0438\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435.<\/p>\n<h4>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043a\u044d\u0448 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/h4>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <code>QUERY CACHE<\/code> \u0441\u0435\u0440\u0432\u0435\u0440\u0430 MySQL \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 <code>Query_cache::query_cache<\/code>. \u042d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u043c: \u0435\u0433\u043e \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 <code>sql_cache.cc<\/code>. \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u044d\u0448 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u043d\u0435\u0434\u0440\u0430\u0445 MySQL, \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043a \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u043e\u0439 <\/p>\n<pre><code class=\"cpp\">#define MYSQL_SERVER<\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043c\u0430\u043a\u0440\u043e\u0441 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0430\u0448 \u043f\u043b\u0430\u0433\u0438\u043d \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u043c \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 MySQL, \u0438 \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u0435\u0435 \u2014 \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043a \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0432\u0435\u0440\u0441\u0438\u0438, \u043d\u043e \u0441\u043e\u0431\u0440\u0430\u043d\u043e\u0439 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430\u043c\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0442\u043e \u0432 \u043b\u0443\u0447\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430, \u0432 \u0445\u0443\u0434\u0448\u0435\u043c \u0436\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u044b\u043b\u0435\u0442\u0438\u0442 <code>ABORT<\/code>&#8216;\u043e\u043c \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0431\u0440\u0430\u043b\u0438 \u0435\u0433\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438, \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u0442\u044c \u043a\u0440\u0430\u0439\u043d\u0435 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u044b\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043b\u0430\u0433\u0438\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0421\u0423\u0411\u0414, \u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043a \u043a\u0440\u0430\u0445\u0443 \u0432\u0441\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 MySQL. \u0410\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u043c\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u043b\u0438 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0440\u0435\u0441\u043b\u043e\u0432\u0443\u0442\u044b\u043c \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0432\u044b\u0448\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0438 \u043d\u0435 \u0432\u0445\u043e\u0434\u044f\u0442 \u0432 \u0441\u0435\u043a\u0446\u0438\u044e public \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0430 <code>Query_cache<\/code>, \u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c\u0438 \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043e\u0442\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0430\u0440\u0443 \u043d\u043e\u0432\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043a\u043b\u0430\u0441\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">class MySQL_IS_Query_Cache : private Query_cache { public:    HASH *get_queries_hash() {     return &this-&gt;queries;   }    HASH *get_tables_hash() {     return &this-&gt;tables;   } }; <\/code><\/pre>\n<p>   \u2014 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0435.  <\/div>\n<\/div>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0442\u0438\u043f\u0430 <code>HASH<\/code> \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0444\u0430\u0439\u043b\u0435 <code>hash.h<\/code>. \u041d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u043c\u0435\u0442\u043e\u0434 <code>my_hash_element<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u043b\u0430\u0433\u0438\u043d \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u0430\u0440\u0441\u0438\u043d\u0433 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <code>WHERE<\/code> \u0438 \u043c\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u043b\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u0432\u0435\u0441\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442\u043e\u0432 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0438 \u0434\u0440. \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0430 \u043e\u0442\u043a\u0443\u043f \u0441\u0435\u0440\u0432\u0435\u0440\u0443. <\/p>\n<h4>QUERY_CACHE_TABLES<\/h4>\n<p>  \u0414\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u0442\u0430\u0431\u043b\u0438\u0446, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u044b\u043b\u0438 \u0437\u0430\u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u043d\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0438\u043c\u044f \u0441\u0445\u0435\u043c\u044b \u0438 \u0438\u043c\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#define MAX_SCHEMA_NAME_LENGTH 127 #define MAX_TABLE_NAME_LENGTH 127  #define COLUMN_SCHEMA_NAME 0 #define COLUMN_TABLE_NAME 1   ST_FIELD_INFO query_cache_table_fields[]= {   {&quot;SCHEMA_NAME&quot;,    MAX_SCHEMA_NAME_LENGTH,    MYSQL_TYPE_STRING, 0, 0, &quot;Schema Name&quot;},   {&quot;TABLE_NAME&quot;,     MAX_TABLE_NAME_LENGTH,     MYSQL_TYPE_STRING, 0, 0, &quot;Table Name&quot;},   {0,0, MYSQL_TYPE_STRING, 0, 0, 0} };  <\/code><\/pre>\n<p>   \u2014 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0434\u043b\u0438\u043d\u0443 \u044d\u0442\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 127 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0434\u0443\u043c\u0430\u044e \u044d\u0442\u043e \u0440\u0430\u0437\u0443\u043c\u043d\u043e  <\/div>\n<\/div>\n<h4>QUERY_CACHE_RESULTS<\/h4>\n<p>  \u0412 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e SQL \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0430 \u0442\u0430\u043a \u0436\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u044f\u0442\u044c \u043a\u043e\u043b\u043e\u043d\u043e\u043a:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e SQL, \u043a\u043e\u043b-\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u043e\u0442\u0432\u0435\u0442\u0435, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u043e\u0442\u0432\u0435\u0442\u043e\u043c \u043f\u0430\u043c\u044f\u0442\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#define MAX_STATEMENT_TEXT_LENGTH 1024  #define COLUMN_STATEMENT_TEXT 0 #define COLUMN_FOUND_ROWS 1 #define COLUMN_RESULT_BLOCKS_COUNT 2 #define COLUMN_RESULT_BLOCKS_SIZE 3 #define COLUMN_RESULT_BLOCKS_SIZE_USED 4   ST_FIELD_INFO query_cache_result_fields[]= {   {&quot;STATEMENT_TEXT&quot;,          MAX_STATEMENT_TEXT_LENGTH,MYSQL_TYPE_STRING, 0, 0, &quot;Cached statement text&quot;},   {&quot;FOUND_ROWS&quot;,              21, MYSQL_TYPE_LONGLONG, 0, 0, &quot;Result row count&quot;},   {&quot;RESULT_BLOCKS_COUNT&quot;,     21, MYSQL_TYPE_LONG, 0, 0, &quot;Result Blocks count&quot;},   {&quot;RESULT_BLOCKS_SIZE&quot;,      21, MYSQL_TYPE_LONGLONG, 0, 0,&quot;Result Blocks size&quot;},   {&quot;RESULT_BLOCKS_SIZE_USED&quot;, 21, MYSQL_TYPE_LONGLONG, 0, 0,&quot;Result Blocks used size&quot;},   {0,0, MYSQL_TYPE_STRING, 0, 0, 0} }; <\/code><\/pre>\n<p>   \u2014 \u0442\u0435\u043a\u0441\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438\u0441\u043a\u0443\u0441\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c 1024 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438, \u0435\u0441\u043b\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440  <\/div>\n<\/div>\n<h4>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435<\/h4>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c\u0443 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0412\u0435\u0437\u0434\u0435 \u0433\u0434\u0435 \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0443.  <\/p>\n<pre><code class=\"cpp\">  \/\/ character set information to store varchar values   CHARSET_INFO *cs = system_charset_info; <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043e\u0431\u044a\u0435\u043a\u0442\u0443 <code>Query_cache::query_cache<\/code> \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">  \/\/ query_cache defined in sql_cache.h is MySQL Query Cache implementation;   MySQL_IS_Query_Cache *qc = (MySQL_IS_Query_Cache *)&query_cache;   HASH *h_queries;     query_cache.lock();   h_queries = qc-&gt;get_queries_hash(); <\/code><\/pre>\n<p>   \u2014 h_queries \u0438\u0441\u043a\u043e\u043c\u044b\u0439 \u043d\u0430\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442, \u043f\u0440\u043e\u0438\u0442\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a\u043e \u0432\u0441\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c \u0438\u0437 <code>QUERY CACHE<\/code> (\u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 <code>HASH queries<\/code>)  <\/div>\n<\/div>\n<p>  \u0414\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 <code>HASH tables<\/code> \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">  \/\/ query_cache defined in sql_cache.h is MySQL Query Cache implementation;   MySQL_IS_Query_Cache *qc = (MySQL_IS_Query_Cache *)&query_cache;   HASH *h_tables;     query_cache.lock();   h_tables = qc-&gt;get_tables_hash(); <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0441 <code>HASH tables<\/code> \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e. \u0418\u0442\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">  for(uint i = 0; i &lt; h_tables-&gt;records; i++)   {    query_cache_block_hash = my_hash_element(h_tables, i);    query_cache_block_current = (Query_cache_block*)query_cache_block_hash;    Query_cache_table* query_cache_table = query_cache_block_current-&gt;table();     \/\/ get tables data    const char *schema_name = (const char*)query_cache_table-&gt;db();    size_t schema_name_length = strlen(schema_name)&gt;MAX_SCHEMA_NAME_LENGTH?MAX_SCHEMA_NAME_LENGTH:strlen(schema_name);    is_query_cache_tables-&gt;field[COLUMN_SCHEMA_NAME]-&gt;store((char*)schema_name, schema_name_length, cs); ...   } <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0448\u0442\u0430\u0442\u043d\u043e\u0433\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0441\u043d\u044f\u0442\u044c \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0443 <code>query_cache.unlock()<\/code>. \u042d\u0442\u0430 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u2014 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u0438 \u0435\u0451 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u043a <code>QUERY CACHE<\/code> \u0431\u0443\u0434\u0443\u0442 \u043e\u0436\u0438\u0434\u0430\u0442\u044c \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430.<br \/>  \u0421 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u0435\u043a\u0441\u0442\u043e\u0432 SQL \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432\u0441\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0438 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438. \u0411\u043b\u043e\u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u043d\u0430\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041e\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043b\u0438\u0448\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0442\u0438\u043f\u0430 <code>Query_cache_query<\/code>, \u0434\u043e\u0431\u0440\u0430\u0432\u0448\u0438\u0441\u044c \u0434\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043b\u0438\u0448\u044c \u0447\u0430\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u043d\u0430\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0442\u0435\u043a\u0441\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043a\u043e\u043b-\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u043c \u043d\u0430\u0431\u043e\u0440\u0435<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">   \/\/ get statement data    statement_text = (const char*)query_cache_query-&gt;query();    ulonglong found_rows = query_cache_query-&gt;found_rows(); <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u043e\u0431\u044a\u0435\u043c\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u0437\u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043d\u0430 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>result<\/code> \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>query_cache_query<\/code>. \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">  Query_cache_block *first_result_block = query_cache_query-&gt;result(); <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0443\u0447\u0430\u0441\u0442\u043a\u0430\u0445 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0439\u0442\u0438\u0441\u044c \u043f\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0441\u043f\u0438\u0441\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0438 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043d\u0430\u0441 \u043a \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u043c\u0443 \u0431\u043b\u043e\u043a\u0443 <code>Query_cache_block<\/code>. \u0422\u0430\u043a \u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u0443\u0441 \u0431\u043b\u043e\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c <code>Query_cache_block::RES_INCOMPLETE<\/code>.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0431\u0445\u043e\u0434\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">     \/\/ loop all query result blocks for current query      while(   (result_block= result_block-&gt;next) != first_result_block  \t       && result_block-&gt;type != Query_cache_block::RES_INCOMPLETE) \/* This type of block can be not lincked yet (in multithread environment)*\/      {        result_blocks_count++;                      result_blocks_size += result_block-&gt;length;        result_blocks_size_used += result_block-&gt;used;      } <\/code><\/pre>\n<p>   \u2014 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043c\u043e\u0436\u0435\u043c \u043b\u0438 \u043c\u044b \u0432\u044b\u0439\u0442\u0438 \u043d\u0430 \u043d\u0435\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 \u0431\u043b\u043e\u043a \u0442\u0430\u043a\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0438\u043b\u0438 \u043d\u0435\u0442, \u044f \u043d\u0435 \u0437\u043d\u0430\u044e, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u0434\u0441\u0442\u0440\u0430\u0445\u043e\u0432\u0430\u0442\u044c\u0441\u044f  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043d\u0430\u0441\u043b\u0430\u0436\u0434\u0430\u0435\u043c\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">install plugin QUERY_CACHE_RESULTS soname 'query_cache_results.so'; install plugin QUERY_CACHE_TABLES soname 'query_cache_tables.so'; show plugins; +--------------------------+--------+--------------------+------------------------+---------+ | Name                     | Status | Type               | Library                | License | +--------------------------+--------+--------------------+------------------------+---------+ ... | QUERY_CACHE_RESULTS      | ACTIVE | INFORMATION SCHEMA | query_cache_results.so | GPL     | | QUERY_CACHE_TABLES       | ACTIVE | INFORMATION SCHEMA | query_cache_tables.so  | GPL     | +--------------------------+--------+--------------------+------------------------+---------+ 24 rows in set (0.00 sec)  select * from pivot limit 10; ... 10 rows in set (0.00 sec)  select * from pivot p1, pivot p2 limit 1000; ... 1000 rows in set (0.00 sec)  select * from information_schema.query_cache_tables; +-------------+------------+ | SCHEMA_NAME | TABLE_NAME | +-------------+------------+ | test        | pivot      | +-------------+------------+ 1 row in set (0.00 sec)  select * from information_schema.query_cache_results \\G *************************** 1. row ***************************          STATEMENT_TEXT: select * from pivot p1, pivot p2 limit 1000              FOUND_ROWS: 1000     RESULT_BLOCKS_COUNT: 1      RESULT_BLOCKS_SIZE: 9992 RESULT_BLOCKS_SIZE_USED: 9985 *************************** 2. row ***************************          STATEMENT_TEXT: select * from pivot limit 10              FOUND_ROWS: 10     RESULT_BLOCKS_COUNT: 1      RESULT_BLOCKS_SIZE: 512 RESULT_BLOCKS_SIZE_USED: 208 2 rows in set (0.00 sec)  <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  P.S. \u0442\u0430\u043a \u043a\u0430\u043a \u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0411\u0414, \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043d\u0430 C++ \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u043e\u0435\u0439 \u0434\u0430\u0436\u0435 \u043f\u043e\u0431\u043e\u0447\u043d\u043e\u0439 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u043a\u0440\u0438\u0432\u044b\u043c \u0438 \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c, \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u044f \u0441 \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u044e \u0432\u044b\u0441\u043b\u0443\u0448\u0430\u044e \u0432\u0430\u0448\u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043f\u043e \u043a\u043e\u0434\u0443 \u0432 \u043b\u0438\u0447\u043a\u0443. <\/p>\n<p>  P.P.S. \u0414\u043b\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u044b\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e \u043f\u043e\u043b\u043d\u044b\u0435 \u043b\u0438\u0441\u0442\u0438\u043d\u0433\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u0430:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">mysql_query_cache.h<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#ifndef MYSQL_IS_QUERY_CACHE #define MYSQL_IS_QUERY_CACHE \/*    Copyright (c) 2012, PaynetEasy. All rights reserved.    Author:  Mikhail Goryachkin    Licence: GPL    Description: mysql query cache view plugin. *\/  #include &lt;stdlib.h&gt; #include &lt;ctype.h&gt; #ifndef MYSQL_SERVER #define MYSQL_SERVER #endif  #include &lt;sql_cache.cc&gt;  class MySQL_IS_Query_Cache : private Query_cache { public:    HASH *get_queries_hash() {     return &this-&gt;queries;   }    HASH *get_tables_hash() {     return &this-&gt;tables;   } };  #endif <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">query_cache_results.cc<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/*    Original author: Roland Bouman    Licence: GPL     Copyright (c) 2012, PaynetEasy. All rights reserved.    Author: Mikhail Goryachkin    Licence: GPL    Description: mysql query cache view plugin. *\/  #include &quot;mysql_query_cache.h&quot; #include &lt;mysql\/plugin.h&gt;  bool schema_table_store_record(THD *thd,TABLE *table);   #define MAX_STATEMENT_TEXT_LENGTH 1024  #define COLUMN_STATEMENT_TEXT 0 #define COLUMN_FOUND_ROWS 1 #define COLUMN_RESULT_BLOCKS_COUNT 2 #define COLUMN_RESULT_BLOCKS_SIZE 3 #define COLUMN_RESULT_BLOCKS_SIZE_USED 4   ST_FIELD_INFO query_cache_result_fields[]= {   {&quot;STATEMENT_TEXT&quot;,          MAX_STATEMENT_TEXT_LENGTH,MYSQL_TYPE_STRING, 0, 0, &quot;Cached statement text&quot;},   {&quot;FOUND_ROWS&quot;,              21, MYSQL_TYPE_LONGLONG, 0, 0, &quot;Result row count&quot;},   {&quot;RESULT_BLOCKS_COUNT&quot;,     21, MYSQL_TYPE_LONG, 0, 0, &quot;Result Blocks count&quot;},   {&quot;RESULT_BLOCKS_SIZE&quot;,      21, MYSQL_TYPE_LONGLONG, 0, 0,&quot;Result Blocks size&quot;},   {&quot;RESULT_BLOCKS_SIZE_USED&quot;, 21, MYSQL_TYPE_LONGLONG, 0, 0,&quot;Result Blocks used size&quot;},   {0,0, MYSQL_TYPE_STRING, 0, 0, 0} };  static int query_cache_result_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) {   \/\/ character set information to store varchar values   CHARSET_INFO *cs = system_charset_info;   TABLE *is_query_cache_results = (TABLE *)tables-&gt;table;   \/\/ query_cache defined in sql_cache.h is MySQL Query Cache implementation;   MySQL_IS_Query_Cache *qc = (MySQL_IS_Query_Cache *)&query_cache;    HASH *h_queries;   const uchar *query_cache_block_hash;   Query_cache_block* query_cache_block_current;     const char *statement_text;   size_t statement_text_length;     query_cache.lock();   h_queries = qc-&gt;get_queries_hash();     for(uint i = 0; i &lt; h_queries-&gt;records; i++)   {    query_cache_block_hash = my_hash_element(h_queries, i);    query_cache_block_current = (Query_cache_block*)query_cache_block_hash;    Query_cache_query *query_cache_query = query_cache_block_current-&gt;query();     \/\/ get statement data    statement_text = (const char*)query_cache_query-&gt;query();    statement_text_length = strlen(statement_text)&gt;MAX_STATEMENT_TEXT_LENGTH?MAX_STATEMENT_TEXT_LENGTH:strlen(statement_text);    is_query_cache_results-&gt;field[COLUMN_STATEMENT_TEXT]-&gt;store((char*)statement_text, statement_text_length, cs);        ulonglong found_rows = query_cache_query-&gt;found_rows();    is_query_cache_results-&gt;field[COLUMN_FOUND_ROWS]-&gt;store(found_rows, 0);        \/\/ calculate result size    uint result_blocks_count = 0;    ulonglong result_blocks_size = 0;    ulonglong result_blocks_size_used = 0;    Query_cache_block *first_result_block = query_cache_query-&gt;result();    if(   first_result_block        && first_result_block-&gt;type != Query_cache_block::RES_INCOMPLETE \/* This type of block can be not lincked yet (in multithread environment)*\/)     {      Query_cache_block *result_block = first_result_block;      result_blocks_count = 1;          result_blocks_size = result_block-&gt;length;    \/\/ length of all block      result_blocks_size_used = result_block-&gt;used; \/\/ length of data            \/\/ loop all query result blocks for current query      while(   (result_block= result_block-&gt;next) != first_result_block  \t       && result_block-&gt;type != Query_cache_block::RES_INCOMPLETE)      {        result_blocks_count++;                      result_blocks_size += result_block-&gt;length;        result_blocks_size_used += result_block-&gt;used;      }     }    is_query_cache_results-&gt;field[COLUMN_RESULT_BLOCKS_COUNT]-&gt;store(result_blocks_count, 0);    is_query_cache_results-&gt;field[COLUMN_RESULT_BLOCKS_SIZE]-&gt;store(result_blocks_size, 0);    is_query_cache_results-&gt;field[COLUMN_RESULT_BLOCKS_SIZE_USED]-&gt;store(result_blocks_size_used, 0);        if (schema_table_store_record(thd, is_query_cache_results)) {        query_cache.unlock();        return 1;      }   }    query_cache.unlock();   return 0; }   static int query_cache_result_plugin_init(void *p) {   ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *)p;     schema-&gt;fields_info = query_cache_result_fields;   schema-&gt;fill_table = query_cache_result_fill_table;     return 0; }   static int query_cache_result_plugin_deinit(void *p) {   return 0; }   struct st_mysql_information_schema query_cache_result_plugin = {   MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION  \/* interface version    *\/ };   \/*  Plugin library descriptor *\/ mysql_declare_plugin(mysql_is_query_cache_result) {   MYSQL_INFORMATION_SCHEMA_PLUGIN,               \/* type                            *\/   &query_cache_result_plugin,                    \/* descriptor                      *\/   &quot;QUERY_CACHE_RESULTS&quot;,                         \/* name                            *\/   &quot;Roland Bouman aka Mikhail Goryachkin&quot;,        \/* author                          *\/   &quot;Lists all query results in the query cache&quot;,  \/* description                     *\/   PLUGIN_LICENSE_GPL,   query_cache_result_plugin_init,                \/* init function (when loaded)     *\/   query_cache_result_plugin_deinit,              \/* deinit function (when unloaded) *\/   0x0010,                                        \/* version                         *\/   NULL,                                          \/* status variables                *\/   NULL,                                          \/* system variables                *\/   NULL,                                          \/* config options                  *\/   0,                                             \/* flags                           *\/ } mysql_declare_plugin_end; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">query_cache_tables.cc<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/*    Copyright (c) 2012, PaynetEasy. All rights reserved.    Author: Mikhail Goryachkin    Licence: GPL    Description: mysql query cache view plugin. *\/  #include &quot;mysql_query_cache.h&quot; #include &lt;mysql\/plugin.h&gt;  bool schema_table_store_record(THD *thd,TABLE *table);  #define MAX_SCHEMA_NAME_LENGTH 127 #define MAX_TABLE_NAME_LENGTH 127  #define COLUMN_SCHEMA_NAME 0 #define COLUMN_TABLE_NAME 1   ST_FIELD_INFO query_cache_table_fields[]= {   {&quot;SCHEMA_NAME&quot;,    MAX_SCHEMA_NAME_LENGTH,    MYSQL_TYPE_STRING, 0, 0, &quot;Schema Name&quot;},   {&quot;TABLE_NAME&quot;,     MAX_TABLE_NAME_LENGTH,     MYSQL_TYPE_STRING, 0, 0, &quot;Table Name&quot;},   {0,0, MYSQL_TYPE_STRING, 0, 0, 0} };  static int query_cache_table_fill_table(THD *thd, TABLE_LIST *tables, COND *cond) {   \/\/ character set information to store varchar values   CHARSET_INFO *cs = system_charset_info;   TABLE *is_query_cache_tables = (TABLE *)tables-&gt;table;   \/\/ query_cache defined in sql_cache.h is MySQL Query Cache implementation;   MySQL_IS_Query_Cache *qc = (MySQL_IS_Query_Cache *)&query_cache;    HASH *h_tables;   const uchar *query_cache_block_hash;   Query_cache_block* query_cache_block_current;     query_cache.lock();   h_tables = qc-&gt;get_tables_hash();     for(uint i = 0; i &lt; h_tables-&gt;records; i++)   {    query_cache_block_hash = my_hash_element(h_tables, i);    query_cache_block_current = (Query_cache_block*)query_cache_block_hash;    Query_cache_table* query_cache_table = query_cache_block_current-&gt;table();     \/\/ get tables data    const char *schema_name = (const char*)query_cache_table-&gt;db();    size_t schema_name_length = strlen(schema_name)&gt;MAX_SCHEMA_NAME_LENGTH?MAX_SCHEMA_NAME_LENGTH:strlen(schema_name);    is_query_cache_tables-&gt;field[COLUMN_SCHEMA_NAME]-&gt;store((char*)schema_name, schema_name_length, cs);     const char *table_name = (const char*)query_cache_table-&gt;table();    size_t table_name_length = strlen(table_name)&gt;MAX_TABLE_NAME_LENGTH?MAX_TABLE_NAME_LENGTH:strlen(table_name);    is_query_cache_tables-&gt;field[COLUMN_TABLE_NAME]-&gt;store((char*)table_name, table_name_length, cs);        if (schema_table_store_record(thd, is_query_cache_tables)) {        query_cache.unlock();        return 1;      }   }    query_cache.unlock();   return 0; }   static int query_cache_table_plugin_init(void *p) {   ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *)p;     schema-&gt;fields_info = query_cache_table_fields;   schema-&gt;fill_table = query_cache_table_fill_table;     return 0; }   static int query_cache_table_plugin_deinit(void *p) {   return 0; }   struct st_mysql_information_schema query_cache_table_plugin = {   MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION  \/* interface version    *\/ };   \/*  Plugin library descriptor *\/ mysql_declare_plugin(mysql_is_query_cache_table) {   MYSQL_INFORMATION_SCHEMA_PLUGIN,               \/* type                            *\/   &query_cache_table_plugin,                     \/* descriptor                      *\/   &quot;QUERY_CACHE_TABLES&quot;,                          \/* name                            *\/   &quot;Mikhail Goryachkin&quot;,                          \/* author                          *\/   &quot;Lists all tables in the query cache&quot;,         \/* description                     *\/   PLUGIN_LICENSE_GPL,   query_cache_table_plugin_init,                 \/* init function (when loaded)     *\/   query_cache_table_plugin_deinit,               \/* deinit function (when unloaded) *\/   0x0010,                                        \/* version                         *\/   NULL,                                          \/* status variables                *\/   NULL,                                          \/* system variables                *\/   NULL,                                          \/* config options                  *\/   0,                                             \/* flags                           *\/ } mysql_declare_plugin_end; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">CMakeLists.txt<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">MYSQL_ADD_PLUGIN(query_cache_results mysql_query_cache.h query_cache_results.cc MODULE_ONLY) MYSQL_ADD_PLUGIN(query_cache_tables mysql_query_cache.h query_cache_tables.cc MODULE_ONLY) <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<div class=\"polling\">\n<form action=\"\/json\/polling\/\" class=\"poll\" method=\"post\">\n<div class=\"poll_title\">\u0412 \u0432\u0435\u0440\u0441\u0438\u0438 5.5.28 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u043e\u0432\u0430\u044f \u0444\u0438\u0447\u0430, Audit Plugin. \u0421\u0442\u043e\u0438\u0442 \u043b\u0438 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c open source \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e MySQL Enterprise Audit \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0441 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e?<\/div>\n<p>  \t\t<input type=\"hidden\" name=\"post_id\" value=\"165241\"\/> \t\t<input type=\"hidden\" name=\"polling_question_id\" value=\"6869\"\/>  \t\t<\/p>\n<table class=\"answer\">\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv36147\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"36147\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv36147\">\u0414\u0430 \u2014 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u0438 \u0440\u0430\u0437\u043d\u044b\u0445<\/label> \t\t\t\t<\/td>\n<\/tr>\n<tr>\n<td class=\"input\"> \t\t\t\t\t<input type=\"radio\" id=\"vv36149\" \t\t\t\t\t\tclass=\"radio js-field-data\" \t\t\t\t\t\tname=\"variant[]\" \t\t\t\t\t\tvalue=\"36149\" \/> \t\t\t\t<\/td>\n<td class=\"label\"> \t\t\t\t\t<label for=\"vv36149\">\u041d\u0435\u0442 \u2014 \u0445\u0432\u0430\u0442\u0438\u0442 \u043f\u043e\u0441\u0442\u0438\u0442\u044c \u0441\u0438\u0448\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432 \u0431\u043b\u043e\u0433 MySQL, \u0442\u0443\u0442 \u044d\u0442\u043e \u043d\u0438\u043a\u043e\u043c\u0443 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e<\/label> \t\t\t\t<\/td>\n<\/tr>\n<\/table>\n<p class=\"for_users_only_msg\">\u0422\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043e\u043f\u0440\u043e\u0441\u0435. <a href=\"\/login\/\">\u0412\u043e\u0439\u0434\u0438\u0442\u0435<\/a>, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/p>\n<p class=\"total\">\u041d\u0438\u043a\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0433\u043e\u043b\u043e\u0441\u043e\u0432\u0430\u043b. \u0412\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u043d\u0435\u0442.<\/p>\n<\/p><\/form>\n<\/p><\/div>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/165241\/\"> http:\/\/habrahabr.ru\/post\/165241\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0412\u0441\u0435 \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u043f\u0440\u043e \u0442\u043e, \u0447\u0442\u043e <code>QUERY CACHE<\/code> \u0431\u044b\u0432\u0430\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u0435\u043d, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0435\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043d\u0438\u0437\u043a\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 DML \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 (\u0435\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e, \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"http:\/\/habrahabr.ru\/post\/41166\/\">\u0442\u0443\u0442<\/a>). \u041f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0447\u0430\u0441\u0442\u043e \u0432\u0441\u0442\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441, \u0430 \u0447\u0442\u043e \u0436\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 <code>QUERY CACHE<\/code>&#8216;\u0435 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u041f\u043e\u0438\u0441\u043a \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432 \u0441\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043c\u0435\u043d\u044f \u0432 \u0442\u0443\u043f\u0438\u043a. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0432\u0435\u0440\u043d\u044b\u043c, \u044f \u043d\u0430\u0448\u0435\u043b <a href=\"http:\/\/stackoverflow.com\/questions\/4187794\/how-to-list-cached-queries-in-mysql-qcache-queries-in-cache\">\u0442\u0443\u0442<\/a>. \u041e\u0442\u0432\u0435\u0442 \u0433\u043b\u0430\u0441\u0438\u043b \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:  <\/p>\n<blockquote><p> there is no way to find what queries are now cached<\/p><\/blockquote>\n<p>  \u0442.\u0435. \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442. \u041b\u0438\u0448\u044c \u0441\u043f\u0443\u0441\u0442\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0442\u0430\u043a, \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u043b\u0435\u0433\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0411\u0414 \u0431\u0435\u0437 \u043f\u0430\u0442\u0447\u0438\u043d\u0433\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u043a\u043e\u0434\u043e\u0432. \u042d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043b\u044f <code>INFORMATION_SCHEMA<\/code>.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-165241","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/165241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=165241"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/165241\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=165241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=165241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=165241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}