{"id":1604,"date":"2010-03-24T09:23:57","date_gmt":"2010-03-24T01:23:57","guid":{"rendered":"http:\/\/www.orczhou.com\/?p=1604"},"modified":"2010-03-24T09:24:41","modified_gmt":"2010-03-24T01:24:41","slug":"innodb-plugin-file-format","status":"publish","type":"post","link":"https:\/\/www.orczhou.com\/index.php\/2010\/03\/innodb-plugin-file-format\/","title":{"rendered":"InnoDB Plugin\u6587\u4ef6\u683c\u5f0f(\u6982\u8ff0)"},"content":{"rendered":"<p>\u672c\u6587\u5c06\u4ecb\u7ecdInnoDB Plugin\u6570\u636e\u8868\u683c\u5f0f\u7684\u57fa\u672c\u6982\u5ff5\u3002<\/p>\n<p><font color=\"red\">1. \u914d\u7f6e\u53c2\u6570innodb_file_format<\/font><\/p>\n<p>\u8fd9\u662f\u4e00\u4e2a\u5f88\u5bb9\u6613\u6df7\u6dc6\u7684\u6982\u5ff5\u3002\u76ee\u524d\uff0c\u5728InnoDB Plugin\uff081.0.6\uff09\u914d\u7f6e\u6587\u4ef6\u4e2dinnodb_file_format\u652f\u6301\u4e24\u79cd\uff1aAntelope\/\u02c8\u00e6nt\u026al\u0259\u028ap\/\u3001Barracuda\/\u02ccb\u00e6r\u0259\u02c8kju\u02d0d\u0259\/\u3002\u4ed6\u4eec\u5206\u522b\u662f\u4e24\u79cd\u6587\u4ef6\u683c\u5f0f\u7684\u4ee3\u53f7\uff0c\u5728\u672a\u6765\u7248\u672c\u4e2d\uff0cInnoDB\u5c06\u7ee7\u7eed\u5ef6\u7eed\u8fd9\u79cd\u4ee3\u53f7\u673a\u5236\uff0c\u5b83\u4eec\u4f1a\u662fAntelope, Barracuda, Cheetah, Dragon, Elk, Fox\u7b49\u7b49\u3002<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/26825745@N06\/4456338484\/\" title=\"Antelope_Barracuda by orczhou, on Flickr\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/farm5.static.flickr.com\/4004\/4456338484_1518d4d347_o.png\" width=\"457\" height=\"192\" alt=\"Antelope_Barracuda\" \/><\/a><\/p>\n<p><!--more--><\/p>\n<p>Antelope\u662fBuilt-in-InnoDB\uff08MySQL\u5185\u7f6e\u7684InnoDB\uff09\u652f\u6301\u6587\u4ef6\u683c\u5f0f\u7684\u4ee3\u53f7\uff0c\u6709\u4e24\u79cd\u201c\u6570\u636e\u8868\u683c\u5f0f\u201d\uff08row_format\uff09\uff1aRedundant\u3001Compact\uff1bBarracuda\u662fInnoDB Plugin\u652f\u6301\u7684\u6587\u4ef6\u683c\u5f0f\uff0c\u5728<strong>\u539f\u6765\u7684\u57fa\u7840\u4e0a<\/strong>\u65b0\u589e\u4e86\u4e24\u79cd\u6570\u636e\u8868\u683c\u5f0f\u7684\u652f\u6301\uff1aDynamic\u548cCompressed\u3002<\/p>\n<p>\u5bf9\u5e94\u5173\u7cfb\u8868\uff1a<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/26825745@N06\/4455602019\/\" title=\"innodb_plugin_com by orczhou, on Flickr\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/farm3.static.flickr.com\/2457\/4455602019_f1bf0e14d3_o.png\" width=\"576\" height=\"63\" alt=\"innodb_plugin_com\" \/><\/a><\/p>\n<p>\u4e00\u822c\uff0cinnodb_file_format\u5728<strong>\u914d\u7f6e\u6587\u4ef6\u4e2d<\/strong>\u6307\u5b9a\uff1brow_format\u5219\u5728<strong>\u521b\u5efa\u6570\u636e\u8868\u65f6<\/strong>\u6307\u5b9a\u3002<\/p>\n<p><font color=\"red\">2. \u65b0\u5efa\u6570\u636e\u8868\u7684\u683c\u5f0f\u3001\u5df2\u6709\u6570\u636e\u8868\u683c\u5f0f<\/font><\/p>\n<p>\u8981\u652f\u6301\u65b0\u7684\u6570\u636e\u8868\u683c\u5f0f\uff0c\u6211\u4eec\u9700\u8981\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u65b0\u589e\u914d\u7f6e\u9009\u9879\uff1a<\/p>\n<div class=\"mycode\">innodb_file_format=barracuda<br \/>\ninnodb_file_per_table = 1<br \/>\ninnodb_strict_mode=1    #\u5efa\u8bae\u52a0\u4e0a\n<\/div>\n<p>\u7136\u540e\uff0c\u5728\u521b\u5efa\u6570\u636e\u8868\u65f6\uff0c\u6307\u5b9a\u53c2\u6570ROW_FORMAT\u5c31\u53ef\u4ee5\u6307\u5b9a\u7279\u5b9a\u7684\u683c\u5f0f\u4e86\u3002\u4f8b\u5982\uff1a<\/p>\n<div class=\"mycode\">CREATE TABLE name (column1 INT PRIMARY KEY) ENGINE=InnoDB<br \/>\nROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;<\/div>\n<p>\u8fd9\u91cc\u521b\u5efa\u4e86\u4e00\u4e2aCOMPRESSED\u7684\u6570\u636e\u8868\uff0c\u6307\u5b9a\u538b\u7f29\u540e\u9875\u5927\u5c0f\u4e3a4K\u3002<\/p>\n<p>\u4e00\u822c\u5730\uff0c\u6211\u4eec\u901a\u8fc7SHOW CREATE TABLE\u5c31\u53ef\u4ee5\u770b\u5230\u6570\u636e\u8868\u7684\u5177\u4f53\u683c\u5f0f\u4e86\u3002\u7279\u522b\u5730\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7\u89c2\u5bdfibd\u7684\u6587\u4ef6\u5934\u6765\u786e\u5b9a\u6587\u4ef6\u7684\u683c\u5f0f\uff1a<\/p>\n<div class=\"mycode\">$od -t x1 -j 54 -N 4 t3.ibd     #compact<br \/>\n0000066 00 00 00 27<br \/>\n0000072<br \/>\n$od -t x1 -j 54 -N 4 t2.ibd      #compressed<br \/>\n0000066 00 00 00 00<br \/>\n0000072<\/div>\n<p><font color=\"red\">3. \u6587\u4ef6\u683c\u5f0f\u517c\u5bb9\u6027\u68c0\u67e5<\/font><\/p>\n<p>InnoDB Plugin\u5f15\u5165\u7684\u65b0\u7684\u6587\u4ef6\u683c\u5f0f\uff0c\u4e5f\u5f15\u5165\u8f83\u4e3a\u5b8c\u6574\u7684\u6587\u4ef6\u517c\u5bb9\u6027\u68c0\u67e5\uff0c\u4ee5\u9632\u6b62\u8bef\u64cd\u4f5c\u975e\u517c\u5bb9\u7684\u6587\u4ef6\u683c\u5f0f\u3002\u517c\u5bb9\u6027\u68c0\u67e5\u4e00\u5171\u6709\u4e09\u7c7b\uff1a\u542f\u52a8\u6570\u636e\u5e93\u65f6\u3001\u521b\u5efa\u6570\u636e\u8868\u65f6\u3001\u8bbf\u95ee\u6570\u636e\u8868\u65f6\u3002<\/p>\n<p><font color=\"blue\">3.1<\/font> \u5728\u6570\u636e\u5e93\u542f\u52a8\u65f6\u5019\uff0c\u53c2\u6570innodb_file_format_check\uff08>=5.1.38\uff09\u4f1a\u8981\u6c42InnoDB\u5728\u542f\u52a8\u65f6\u68c0\u67e5\u5f53\u524d\u6570\u636e\u8868\u7684\u683c\u5f0f\u3002\u8bbe\u7f6e\u4e3aON\u65f6\uff0c\u5982\u679c\u68c0\u6d4b\u5230\u4e0d\u652f\u6301\u7684\u683c\u5f0f\uff0c\u90a3\u4e48InnoDB\u4f1a\u542f\u52a8\u5931\u8d25\uff1b\u8bbe\u7f6e\u4e3aOFF\u65f6\uff0c\u68c0\u6d4b\u5230\u4e0d\u652f\u6301\u7684\u4ec5\u4f1a\u7ed9\u51fa\u8b66\u544a\uff0c\u5e76\u4e0d\u4f1a\u5bfc\u81f4\u542f\u52a8\u5931\u8d25\u3002<\/p>\n<p>\u628ainnodb_file_format_check\u8bbe\u7f6e\u4e3aOFF\u662f\u5f88\u5371\u9669\u7684\u3002\u5728InnoDB\u542f\u52a8\u540e\uff0c\u4e00\u822c\u9700\u8981\u505a\u4e00\u4e9b\u6062\u590d\u5de5\u4f5c\uff0c\u4f8b\u5982Double write buffer\/Insert buffer\u4e2d\u7684\u6570\u636e\u5904\u7406\uff08\u8fd9\u4f9d\u8d56\u4e8einnodb_fast_shutdown\u53c2\u6570\uff09\uff0c\u8bd5\u60f3\u5982\u679c\u6210\u529f\u542f\u52a8\uff0c\u4f46\u662f\u67d0\u4e9b\u8868\u662f\u4e0d\u652f\u6301\u7684\u683c\u5f0f\uff0c\u4f46\u662fInnoDB\u4ecd\u7136\u5b89\u88c5\u65e7\u7248\u672c\u505a\u6062\u590d\uff0c\u8fd9\u53ef\u80fd\u4f1a<strong>\u6bc1\u6389<\/strong>\u76f8\u5173\u6570\u636e\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u4e00\u822c\u5efa\u8baeinnodb_file_format_check\u8bbe\u7f6e\u4e3aON\u3002\u5982\u679c\u662fOFF\uff0c\u5173\u95edInnoDB\u7684innodb_fast_shutdown\u53c2\u6570\u52a1\u5fc5\u8bbe\u7f6e\u62100\u3002<\/p>\n<p><font color=\"blue\">3.2<\/font> \u9664\u4e86\u542f\u52a8\u65f6\u4f1a\u68c0\u67e5\u517c\u5bb9\u6027\u5916\uff0c\u5f53\u521b\u5efa\u6570\u636e\u8868\u65f6\uff0cInnoDB\u4f1a\u4f9d\u636e\u53c2\u6570InnoDB_file_format\u8fdb\u884c\u68c0\u67e5\uff0c\u5982\u679c\u521b\u5efa\u7684\u6570\u636e\u8868\u683c\u5f0f\u9ad8\u4e8eInnoDB_file_format\uff0c\u5219\u521b\u5efa\u4f1a\u5931\u8d25\u3002<\/p>\n<p><font color=\"blue\">3.3<\/font> \u5f53\u8bbf\u95ee\u67d0\u4e2a\u6570\u636e\u8868\uff08table-access\uff09\u65f6\uff0cInnoDB\u4e5f\u4f1a\u8fdb\u884c\u517c\u5bb9\u6027\u68c0\u67e5\u3002\u53ea\u8981\u5f53\u524d\u8fd0\u884c\u7684InnoDB\u7248\u672c\u80fd\u591f\u652f\u6301\u7684\u683c\u5f0f\uff0c\u90fd\u80fd\u591f\u88ab\u8bbf\u95ee\uff0c\u65e0\u8bba\u53c2\u6570InnoDB_file_format\u7684\u914d\u7f6e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u5c06\u4ecb\u7ecdInnoDB Plugin\u6570\u636e\u8868\u683c\u5f0f\u7684\u57fa\u672c\u6982\u5ff5\u3002 1. \u914d\u7f6e\u53c2\u6570innodb_file_format \u8fd9\u662f\u4e00\u4e2a\u5f88\u5bb9\u6613\u6df7\u6dc6\u7684\u6982\u5ff5\u3002\u76ee\u524d\uff0c\u5728InnoDB Plugin\uff081.0.6\uff09\u914d\u7f6e\u6587\u4ef6\u4e2dinnodb_file_format\u652f\u6301\u4e24\u79cd\uff1aAntelope\/\u02c8\u00e6nt\u026al\u0259\u028ap\/\u3001Barracuda\/\u02ccb\u00e6r\u0259\u02c8kju\u02d0d\u0259\/\u3002\u4ed6\u4eec\u5206\u522b\u662f\u4e24\u79cd\u6587\u4ef6\u683c\u5f0f\u7684\u4ee3\u53f7\uff0c\u5728\u672a\u6765\u7248\u672c\u4e2d\uff0cInnoDB\u5c06\u7ee7\u7eed\u5ef6\u7eed\u8fd9\u79cd\u4ee3\u53f7\u673a\u5236\uff0c\u5b83\u4eec\u4f1a\u662fAntelope, Barracuda, Cheetah, Dragon, Elk, Fox\u7b49\u7b49\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","inline_featured_image":false,"_tocer_settings":[],"footnotes":""},"categories":[6],"tags":[120,52,118],"class_list":["post-1604","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-innodb","tag-innodb-plugin","tag-mysql"],"_links":{"self":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/1604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/comments?post=1604"}],"version-history":[{"count":26,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/1604\/revisions"}],"predecessor-version":[{"id":1671,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/1604\/revisions\/1671"}],"wp:attachment":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/media?parent=1604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/categories?post=1604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/tags?post=1604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}