{"id":5401,"date":"2020-07-30T00:21:59","date_gmt":"2020-07-29T16:21:59","guid":{"rendered":"http:\/\/39.97.231.10\/?p=5401"},"modified":"2020-07-30T00:21:59","modified_gmt":"2020-07-29T16:21:59","slug":"mysql-%e5%a6%82%e4%bd%95%e5%bf%ab%e9%80%9f%e5%85%a8%e8%a1%a8%e6%9b%b4%e6%96%b0%e6%9f%90%e4%b8%aa%e5%ad%97%e6%ae%b5%e5%80%bc","status":"publish","type":"post","link":"http:\/\/www.weijing.co\/?p=5401","title":{"rendered":"MySQL \u5982\u4f55\u5feb\u901f\u5168\u8868\u66f4\u65b0\u67d0\u4e2a\u5b57\u6bb5\u503c"},"content":{"rendered":"<div>\n<div>\n\u6700\u8fd1\u9047\u5230\u4e00\u4e2a\u6709\u8da3\u7684MySQL\u95ee\u9898\uff0c\u5982\u4f55\u5feb\u901f\u5168\u8868\u66f4\u65b0\u67d0\u4e2a\u5b57\u6bb5\u503c\uff0c\u6bd4\u5982\u6709\u4e00\u5f20\u5927\u8868\uff0c1\u5343\u4e07\u6761\u8bb0\u5f55\uff0c\u5176\u4e2d\u6709\u4e2a\u5b57\u6bb5c\uff0c\u5982\u4f55\u9ad8\u6548\u5730\u5168\u8868\u66f4\u65b0\u5b57\u6bb5c\u7684\u503c\uff0c\u4f7f\u5f97c=c+1\u3002\n<\/div>\n<\/div>\n<div>\n<div>\n\u8fd9\u4e2a\u95ee\u9898\u4f3c\u4e4e\u6ca1\u6709\u4ec0\u4e48\u597d\u7684\u89e3\u51b3\u65b9\u6cd5\uff0c\u6709\u4e2a\u670b\u53cb\u63d0\u793a\uff0c\u80fd\u5426\u5c061\u5343\u4e07\u6761\u8bb0\u5f55\u62c6\u5206\u6210\u591a\u4e2a\u90e8\u5206\uff0c\u5e76\u53d1\u66f4\u65b0\uff0c\u8fd9\u79cd\u6bd4\u5355\u7eaf\u7684\u4e00\u6761SQL\u5168\u8868\u66f4\u65b0\u8981\u5feb\u4e00\u4e9b\u3002\u771f\u7684\u662f\u8fd9\u6837\u5417\uff1f\u6211\u505a\u4e86\u4e00\u4e2a\u5b9e\u9a8c\u3002<\/p>\n<h5>1. \u73af\u5883\u914d\u7f6e\uff1a<\/h5>\n<ul>\n<li>\u673a\u5668\u914d\u7f6e\uff1a16\u6838\uff0c32G<\/li>\n<li>MySQL \u7248\u672c\uff1a5.7.19\uff0c1\u4e3b2\u4ece<\/li>\n<li>1\u5f20sysbench\u8868\uff0c1\u5343\u4e07\u6761\u6570\u636e<\/li>\n<\/ul>\n<h5>2. \u6d4b\u8bd5\u7ed3\u679c\uff1a<\/h5>\n<p>\uff081\uff09\u5355\u72ec\u4e00\u6761SQL\u66f4\u65b0\u5168\u8868\uff0c\u8017\u65f6\u00a03 min 41.78 sec\u3002<br \/>\nupdate sbtest1 set k=k+1;<br \/>\n\uff082\uff09\u5c061\u5343\u4e07\u6761\u6570\u636e\u5206\u4e3a4\u4e2a\u90e8\u5206\uff0c\u5e76\u53d1\u66f4\u65b0\uff0c\u8017\u65f6\u00a01 min 23.05 sec\u3002<br \/>\nupdate sbtest1 set k=k+1 where id &gt;=1 and id &lt;=2500000;<br \/>\nupdate sbtest1 set k=k+1 where id &gt;=2500001 and id &lt;=5000000;<br \/>\nupdate sbtest1 set k=k+1 where id &gt;=5000001 and id &lt;=7500000;<br \/>\nupdate sbtest1 set k=k+1 where id &gt;=7500001 and id &lt;=10000000;<br \/>\n\u4ece\u4ee5\u4e0a\u6d4b\u8bd5\u7ed3\u679c\u6765\u770b\uff0c\u5206\u5757\u5e76\u53d1\u66f4\u65b0\uff0c\u786e\u5b9e\u6bd4\u5355\u4e2aSQL\u66f4\u65b0\u6548\u7387\u8981\u9ad8\u3002<\/p>\n<h5>3. \u9047\u5230\u7684\u95ee\u9898\uff1a<\/h5>\n<p>\u5728\u6d4b\u8bd5\u7684\u8fc7\u7a0b\uff0c\u4f1a\u9047\u5230binlog cache\u4e0d\u591f\u7684\u9519\u8bef\uff0c\u5982\u4e0b\uff1a<br \/>\nERROR 1197 (HY000): Multi-statement transaction required more than \\&#8217;max_binlog_cache_size\\&#8217; bytes of storage; increase this mysqld variable and try again<br \/>\n\u8c03\u9ad8max_binlog_cache_size\u53c2\u6570\uff0c\u91cd\u65b0\u8fde\u63a5\uff0c\u518d\u6b21\u6267\u884c\u5c31\u597d\u4e86\u3002\n<\/p><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u9047\u5230\u4e00\u4e2a\u6709\u8da3\u7684MySQL\u95ee\u9898\uff0c\u5982\u4f55\u5feb\u901f\u5168\u8868\u66f4\u65b0\u67d0\u4e2a\u5b57\u6bb5\u503c\uff0c\u6bd4\u5982\u6709\u4e00\u5f20\u5927\u8868\uff0c1\u5343\u4e07\u6761\u8bb0\u5f55\uff0c\u5176\u4e2d\u6709\u4e2a\u5b57\u6bb5c\uff0c\u5982 &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"http:\/\/www.weijing.co\/?p=5401\"> <span class=\"screen-reader-text\">MySQL \u5982\u4f55\u5feb\u901f\u5168\u8868\u66f4\u65b0\u67d0\u4e2a\u5b57\u6bb5\u503c<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[90,88],"tags":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"mailpoet_newsletter_max":false,"woocommerce_thumbnail":false,"woocommerce_single":false,"woocommerce_gallery_thumbnail":false,"shop_catalog":false,"shop_single":false,"shop_thumbnail":false},"uagb_author_info":{"display_name":"weijing","author_link":"http:\/\/www.weijing.co\/?author=4"},"uagb_comment_info":0,"uagb_excerpt":"\u6700\u8fd1\u9047\u5230\u4e00\u4e2a\u6709\u8da3\u7684MySQL\u95ee\u9898\uff0c\u5982\u4f55\u5feb\u901f\u5168\u8868\u66f4\u65b0\u67d0\u4e2a\u5b57\u6bb5\u503c\uff0c\u6bd4\u5982\u6709\u4e00\u5f20\u5927\u8868\uff0c1\u5343\u4e07\u6761\u8bb0\u5f55\uff0c\u5176\u4e2d\u6709\u4e2a\u5b57\u6bb5c\uff0c\u5982&hellip;","_links":{"self":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/5401"}],"collection":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5401"}],"version-history":[{"count":0,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/5401\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5401"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5401"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}