{"id":1810,"date":"2010-04-26T19:11:42","date_gmt":"2010-04-26T11:11:42","guid":{"rendered":"http:\/\/www.orczhou.com\/?p=1810"},"modified":"2010-04-26T19:11:42","modified_gmt":"2010-04-26T11:11:42","slug":"innodb-plugin-some-feature-2","status":"publish","type":"post","link":"https:\/\/www.orczhou.com\/index.php\/2010\/04\/innodb-plugin-some-feature-2\/","title":{"rendered":"InnoDB Plugin\u7279\u6027\u4ecb\u7ecd-2\uff1a\u5feb\u901fDDL"},"content":{"rendered":"<p>InnoDB Plugin\u5728\u5feb\u901fDDL\u4e0a\u505a\u4e86\u4e00\u4e9b\u6539\u8fdb\uff0c\u5728\u505a\u7684\u5b9e\u9a8c\u4e2d\u770b\u5230\uff0c\u521b\u5efasecondary indexes\u65f6\uff0c\u5927\u7ea6\u5feb\u4e8620%\u3002<\/p>\n<p><font color=red>1. \u539f\u7406<\/font><\/p>\n<p>\u5728MySQL5.0\u91cc\u9762\uff0c\u5982\u679c\u6570\u636e\u8868\u7684\u8bb0\u5f55\u6570\u5f88\u591a\uff0c\u589e\u52a0\u548c\u5220\u9664\u7d22\u5f15\u662f\u975e\u5e38\u6162\u7684\u3002CREATE INDEX and DROP INDEX\u547d\u4ee4\u662f\u901a\u8fc7\u5148\u521b\u5efa\u4e00\u4e2a\u7a7a\u7684\u4e34\u65f6\u8868\uff0c\u8fd9\u4e2a\u8868\u5c31\u662f\u4f60\u65b0\u589e\u6216\u5220\u9664\u7d22\u5f15\u540e\u7684\u7ed3\u6784\uff0c\u7136\u540e\u628a\u539f\u8868\u4e2d\u7684\u5168\u90e8\u8bb0\u5f55\u90fd\u62f7\u8d1d\uff08\u63d2\u5165\uff09\u5230\u65b0\u7684\u4e34\u65f6\u8868\u4e2d\uff0c\u6700\u540e\u628a\u539f\u8868\u5220\u9664\uff0c\u4e34\u65f6\u8868\u91cd\u547d\u540d\u6210\u539f\u8868\u3002<\/p>\n<p>MySQL5.1\u7684\u4e00\u4e9b\u67b6\u6784\u4e0a\u7684\u6539\u53d8\uff0c\u53ef\u4ee5\u7b80\u5316\u4e0a\u9762\u7684\u8fc7\u7a0b\uff08\u4e0d\u518d\u9700\u8981\u9010\u884c\u62f7\u8d1d\u6570\u636e\uff09\u3002InnoDB Plugin\u5229\u7528\u8fd9\u4e2a\u6539\u53d8\uff0c\u7f29\u77ed\u4e86\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u7684\u7d22\u5f15\u53d8\u66f4\u65f6\u95f4\u3002\u5bf9InnoDB\u6765\u8bf4\u6709\u4e24\u7c7b\u7d22\u5f15\uff1athe clustered index and secondary indexes\u3002\u56e0\u4e3aInnoDB\u7684\u4e3b\u952e\u662fthe clustered index\uff0c\u6570\u636e\u5b58\u653e\u518d\u6b64\uff0c\u6240\u4ee5\uff0c\u5220\u9664\u6216\u8005\u6dfb\u52a0\u4e3b\u952e\uff08the clustered index\uff09\u9010\u884c\u62f7\u8d1d\u4e5f\u662f\u5fc5\u987b<!--more-->\u7684\u3002<!--more--><\/p>\n<p>InnoDB Pluing\u5728\u5220\u9664\u4e00\u4e2asecondary indexes\u65f6\uff0c\u5148\u66f4\u6539\u4e00\u4e0bInnoDB\u5185\u90e8\u6570\u636e\u5b57\u5178\u548cMySQL\u7684\u6570\u636e\u5b57\u5178\uff0c\u7136\u540e\u628a\u91ca\u653e\u7684\u7a7a\u95f4\u5f52\u8fd8\u7ed9InnoDB\u4ee5\u4f9b\u91cd\u590d\u4f7f\u7528\u3002\u5982\u679c\u662f<strong>\u589e\u52a0<\/strong>\u4e00\u4e2asecondary indexes\uff0c\u8fd8\u662f\u6709\u70b9\u590d\u6742\u7684\uff0cPlugin\u5148\u5c06\u6570\u636e\u8868\u4e2d\u7684\u6570\u636e\u53d6\u51fa\u5230memory buffers\u6216\u8005\u4e34\u65f6\u8868\u4e2d\uff0c\u5e76\u6309\u7167\u65b0\u5efa\u7d22\u5f15\u5217\u6392\u597d\u5e8f\uff0c\u7136\u540e\u5efa\u7acb\u7d22\u5f15\u7684B-Tree\u3002\u5b9e\u9a8c\u8868\u660e\uff0c\u8fd9\u6837\u8fd8\u662f\u7a0d\u5fae\u5feb\u4e00\u4e9b\u3002<\/p>\n<p><font color=red>2. \u5b9e\u9a8c<\/font><\/p>\n<p>\u4ee5\u4e0b\u662f\u4e00\u7ec4\u5173\u4e8esecondary indexes\u5bf9\u6bd4\u6570\u636e\uff1a<\/p>\n<p>ADD INDEX:<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/26825745@N06\/4520260416\/\" title=\"PluginFaster by orczhou, on Flickr\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/farm5.static.flickr.com\/4059\/4520260416_800342635c_o.png\" width=\"472\" height=\"198\" alt=\"PluginFaster\" \/><\/a><\/p>\n<p>Drop INDEX:<\/p>\n<p><a href=\"http:\/\/www.flickr.com\/photos\/26825745@N06\/4520278022\/\" title=\"PluginFaster-2 by orczhou, on Flickr\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/farm5.static.flickr.com\/4059\/4520278022_c2e9f7113e_o.png\" width=\"473\" height=\"198\" alt=\"PluginFaster-2\" \/><\/a><\/p>\n<p>\u4ee5\u4e0a\u56fe\u8868\u7eb5\u5750\u6807\u4e3a\u79d2\uff0c\u6d4b\u8bd5\u6570\u636e\u8868\u6709500\u4e07\u8bb0\u5f55\uff0cibd\u6587\u4ef6\u5927\u5c0f556M\u3002\uff08\u5c1d\u8bd5\u4e86\u5c06tmp_table_size\u548cmax_heap_table_size\u8bbe\u7f6e\u62101G\uff0c\u6548\u679c\u5e76\u6ca1\u6709\u4ec0\u4e48\u4e0d\u540c\uff09<\/p>\n<p><font color=red>3. \u5c0f\u7ed3<\/font><\/p>\n<p>\u53ef\u4ee5\u770b\u5230\u521b\u5efa\u7d22\u5f15Plugin\u6bd4Built-in\u5927\u7ea6\u5feb<strong>20%<\/strong>\uff0c\u800c\u5220\u9664\u7d22\u5f15\u7684\u901f\u5ea6\uff0c\u533a\u522b\u5e76\u4e0d\u5927\u3002<\/p>\n<p>\u5b9e\u9a8c\u7684\u7ed3\u679c\u5e76\u6ca1\u6709\u7406\u8bba\u4e0a\u90a3\u4e48\u7406\u60f3\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>InnoDB Plugin\u5728\u5feb\u901fDDL\u4e0a\u505a\u4e86\u4e00\u4e9b\u6539\u8fdb\uff0c\u5728\u505a\u7684\u5b9e\u9a8c\u4e2d\u770b\u5230\uff0c\u521b\u5efasecondary indexes\u65f6\uff0c\u5927\u7ea6\u5feb\u4e8620%\u3002 1. \u539f\u7406 \u5728MySQL5.0\u91cc\u9762\uff0c\u5982\u679c\u6570\u636e\u8868\u7684\u8bb0\u5f55\u6570\u5f88\u591a\uff0c\u589e\u52a0\u548c\u5220\u9664\u7d22\u5f15\u662f\u975e\u5e38\u6162\u7684\u3002CREATE INDEX and DROP INDEX\u547d\u4ee4\u662f\u901a\u8fc7\u5148\u521b\u5efa\u4e00\u4e2a\u7a7a\u7684\u4e34\u65f6\u8868\uff0c\u8fd9\u4e2a\u8868\u5c31\u662f\u4f60\u65b0\u589e\u6216\u5220\u9664\u7d22\u5f15\u540e\u7684\u7ed3\u6784\uff0c\u7136\u540e\u628a\u539f\u8868\u4e2d\u7684\u5168\u90e8\u8bb0\u5f55\u90fd\u62f7\u8d1d\uff08\u63d2\u5165\uff09\u5230\u65b0\u7684\u4e34\u65f6\u8868\u4e2d\uff0c\u6700\u540e\u628a\u539f\u8868\u5220\u9664\uff0c\u4e34\u65f6\u8868\u91cd\u547d\u540d\u6210\u539f\u8868\u3002 MySQL5.1\u7684\u4e00\u4e9b\u67b6\u6784\u4e0a\u7684\u6539\u53d8\uff0c\u53ef\u4ee5\u7b80\u5316\u4e0a\u9762\u7684\u8fc7\u7a0b\uff08\u4e0d\u518d\u9700\u8981\u9010\u884c\u62f7\u8d1d\u6570\u636e\uff09\u3002InnoDB Plugin\u5229\u7528\u8fd9\u4e2a\u6539\u53d8\uff0c\u7f29\u77ed\u4e86\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u7684\u7d22\u5f15\u53d8\u66f4\u65f6\u95f4\u3002\u5bf9InnoDB\u6765\u8bf4\u6709\u4e24\u7c7b\u7d22\u5f15\uff1athe clustered index and secondary indexes\u3002\u56e0\u4e3aInnoDB\u7684\u4e3b\u952e\u662fthe clustered index\uff0c\u6570\u636e\u5b58\u653e\u518d\u6b64\uff0c\u6240\u4ee5\uff0c\u5220\u9664\u6216\u8005\u6dfb\u52a0\u4e3b\u952e\uff08the clustered index\uff09\u9010\u884c\u62f7\u8d1d\u4e5f\u662f\u5fc5\u987b<\/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],"class_list":["post-1810","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-innodb","tag-innodb-plugin"],"_links":{"self":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/1810","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=1810"}],"version-history":[{"count":10,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/1810\/revisions"}],"predecessor-version":[{"id":1895,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/1810\/revisions\/1895"}],"wp:attachment":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/media?parent=1810"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/categories?post=1810"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/tags?post=1810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}