{"id":1500,"date":"2015-04-23T10:50:06","date_gmt":"2015-04-23T02:50:06","guid":{"rendered":"http:\/\/boweihe.me\/?p=1500"},"modified":"2015-04-23T10:50:06","modified_gmt":"2015-04-23T02:50:06","slug":"mysql-%e5%bc%95%e6%93%8e%e9%80%89%e6%8b%a9-myisam-%e8%bf%98%e6%98%af-innodb","status":"publish","type":"post","link":"https:\/\/dayandcarrot.space\/?p=1500","title":{"rendered":"MySQL \u5f15\u64ce\u9009\u62e9 MyISAM \u8fd8\u662f InnoDB?"},"content":{"rendered":"<p>\u5efa\u8868\u7684\u65f6\u5019\u4f1a\u9009\u62e9\u6570\u636e\u5e93\u5f15\u64ce\uff0c\u5e38\u7528\u7684\u6709MyISAM\u548cInnoDB\uff0c\u5230\u5e95\u9009\u54ea\u4e2a\u5462\uff1f<br \/>\n<strong>\u53c2\u8003\u6587\u732e\uff1a<\/strong><\/p>\n<ul>\n<li><a href=\"http:\/\/drizzlewalk.blog.51cto.com\/2203401\/443266\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/drizzlewalk.blog.51cto.com\/2203401\/443266<\/a><\/li>\n<li><a href=\"http:\/\/www.rackspace.com\/knowledge_center\/article\/mysql-engines-myisam-vs-innodb\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.rackspace.com\/knowledge_center\/article\/mysql-engines-myisam-vs-innodb<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/20148\/myisam-versus-innodb\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/stackoverflow.com\/questions\/20148\/myisam-versus-innodb<\/a><\/li>\n<li><a href=\"http:\/\/www.pureweber.com\/article\/myisam-vs-innodb\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/www.pureweber.com\/article\/myisam-vs-innodb\/<\/a><\/li>\n<\/ul>\n<p><strong>\u4ec0\u4e48\u662fMyISAM?<\/strong><br \/>\nMyISAM\u662fMySQL\u5173\u7cfb\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u7684\u9ed8\u8ba4\u50a8\u5b58\u5f15\u64ce\u3002\u8fd9\u79cdMySQL\u8868\u5b58\u50a8\u7ed3\u6784\u4ece\u65e7\u7684ISAM\u4ee3\u7801\u6269\u5c55\u51fa\u8bb8\u591a\u6709\u7528\u7684\u529f\u80fd\u3002\u5728\u65b0\u7248\u672c\u7684MySQL\u4e2d\uff0cInnoDB\u5f15\u64ce\u7531\u4e8e\u5176\u5bf9\u4e8b\u52a1\uff0c\u53c2\u7167\u5b8c\u6574\u6027\uff0c\u4ee5\u53ca\u66f4\u9ad8\u7684\u5e76\u53d1\u6027\u7b49\u4f18\u70b9\u5f00\u59cb\u5e7f\u6cdb\u7684\u53d6\u4ee3MyISAM\u3002<br \/>\n\u6bcf\u4e00\u4e2aMyISAM\u8868\u90fd\u5bf9\u5e94\u4e8e\u786c\u76d8\u4e0a\u7684\u4e09\u4e2a\u6587\u4ef6\u3002\u8fd9\u4e09\u4e2a\u6587\u4ef6\u6709\u4e00\u6837\u7684\u6587\u4ef6\u540d\uff0c\u4f46\u662f\u6709\u4e0d\u540c\u7684\u6269\u5c55\u540d\u4ee5\u6307\u793a\u5176\u7c7b\u578b\u7528\u9014\uff1a.frm\u6587\u4ef6\u4fdd\u5b58\u8868\u7684\u5b9a\u4e49\uff0c\u4f46\u662f\u8fd9\u4e2a\u6587\u4ef6\u5e76\u4e0d\u662fMyISAM\u5f15\u64ce\u7684\u4e00\u90e8\uff0c\u800c\u662f\u670d\u52a1\u5668\u7684\u4e00\u90e8\u5206\uff1b.MYD\u4fdd\u5b58\u8868\u7684\u6570\u636e\uff1b.MYI\u662f\u8868\u7684\u7d22\u5f15\u6587\u4ef6\u3002<br \/>\n<strong>\u4ec0\u4e48\u662fInnoDB?<\/strong><br \/>\nInnoDB\u662fMySQL\u7684\u53e6\u4e00\u4e2a\u5b58\u50a8\u5f15\u64ce\uff0c\u6b63\u6210\u4e3a\u76ee\u524dMySQL AB\u6240\u53d1\u884c\u65b0\u7248\u7684\u6807\u51c6\uff0c\u88ab\u5305\u542b\u5728\u6240\u6709\u4e8c\u8fdb\u5236\u5b89\u88c5\u5305\u91cc\u3002\u8f83\u4e4b\u4e8e\u5176\u5b83\u7684\u5b58\u50a8\u5f15\u64ce\u5b83\u7684\u4f18\u70b9\u662f\u5b83\u652f\u6301\u517c\u5bb9ACID\u7684\u4e8b\u52a1\uff08\u7c7b\u4f3c\u4e8ePostgreSQL),\u4ee5\u53ca\u53c2\u6570\u5b8c\u6574\u6027\uff08\u5373\u5bf9\u5916\u952e\u7684\u652f\u6301\uff09\u3002<br \/>\nOracle\u516c\u53f8\u4e0e2005\u5e7410\u6708\u6536\u8d2d\u4e86Innobase\u3002Innobase\u91c7\u7528\u53cc\u8ba4\u8bc1\u6388\u6743\u3002\u5b83\u4f7f\u7528GNU\u53d1\u884c\uff0c\u4e5f\u5141\u8bb8\u5176\u5b83\u60f3\u5c06InnoDB\u7ed3\u5408\u5230\u5546\u4e1a\u8f6f\u4ef6\u7684\u56e2\u4f53\u83b7\u5f97\u6388\u6743\u3002<\/p>\n<h2>MyISAM vs Innodb &#8211; Quick comparison Table | \u5feb\u901f\u6bd4\u8f83\u8868:<\/h2>\n<table border=\"1\">\n<tbody>\n<tr>\n<th>MyISAM<\/th>\n<th>Innodb<\/th>\n<\/tr>\n<tr>\n<td>Not *ACID compliant and non-transactional<\/td>\n<td>*ACID compliant and hence fully transactional with ROLLBACK and COMMIT and support for Foreign Keys<\/td>\n<\/tr>\n<tr>\n<td>MySQL 5.0 Default Engine<\/td>\n<td>Rackspace Cloud Default Engine<\/td>\n<\/tr>\n<tr>\n<td>Offers Compression<\/td>\n<td>Offers Compression<\/td>\n<\/tr>\n<tr>\n<td>Requires full repair\/rebuild of indexes\/tables<\/td>\n<td>Auto recovery from crash via replay of logs<\/td>\n<\/tr>\n<tr>\n<td>Changed Db pages written to disk instantly<\/td>\n<td>Dirty pages converted from random to sequential before commit and flush to disk<\/td>\n<\/tr>\n<tr>\n<td>No ordering in storage of data<\/td>\n<td>Row data stored in pages in PK order<\/td>\n<\/tr>\n<tr>\n<td>Table level locking<\/td>\n<td>Row level locking<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<dl>\n<dd>\n<ul>\n<li>ACID &#8211; Atomicity, Consistency, Isolation, Durability (read more on it here:<a class=\"external free\" title=\"http:\/\/en.wikipedia.org\/wiki\/ACID\" href=\"http:\/\/en.wikipedia.org\/wiki\/ACID\" rel=\"nofollow\">http:\/\/en.wikipedia.org\/wiki\/ACID<\/a>)<\/li>\n<\/ul>\n<\/dd>\n<\/dl>\n<p>\u5728StackOverflow\u4e0a\u7684\u5c0f\u603b\u7ed3\uff1a<\/p>\n<pre class=\"\">Frequent reading, almost no writing \u5e38\u6709\u8bfb\u53d6\u64cd\u4f5c\uff0c\u51e0\u4e4e\u6ca1\u6709\u5199\u64cd\u4f5c=&gt; MyISAM\nFull-text search in MySQL &lt;= 5.5      =&gt; MyISAM\n<\/pre>\n<p>InnoDB\u7684\u8bbe\u8ba1\u76ee\u6807\u662f\u5904\u7406\u5927\u5bb9\u91cf\u6570\u636e\u5e93\u7cfb\u7edf\uff0c\u5b83\u7684CPU\u5229\u7528\u7387\u662f\u5176\u5b83\u57fa\u4e8e\u78c1\u76d8\u7684\u5173\u7cfb\u6570\u636e\u5e93\u5f15\u64ce\u6240\u4e0d\u80fd\u6bd4\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5efa\u8868\u7684\u65f6\u5019\u4f1a\u9009\u62e9\u6570\u636e\u5e93\u5f15\u64ce\uff0c\u5e38\u7528\u7684\u6709MyISAM\u548cInnoDB\uff0c\u5230\u5e95\u9009\u54ea\u4e2a\u5462\uff1f \u53c2\u8003\u6587\u732e\uff1a http:\/\/drizzlewalk.blog.51cto.com\/2203401\/443266 http:\/\/www.rackspace.com\/knowledge_center\/article\/mysql-engines-myisam-vs-innodb http:\/\/stackoverflow.com\/questions\/20148\/myisam-versus-innodb http:\/\/www.pureweber.com\/article\/myisam-vs-innodb\/ \u4ec0\u4e48\u662fMyISAM? MyISAM\u662fMySQL\u5173\u7cfb\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u7684\u9ed8\u8ba4\u50a8\u5b58\u5f15\u64ce\u3002\u8fd9\u79cdMySQL\u8868\u5b58\u50a8\u7ed3\u6784\u4ece\u65e7\u7684ISAM\u4ee3\u7801\u6269\u5c55\u51fa\u8bb8\u591a\u6709\u7528\u7684\u529f\u80fd\u3002\u5728\u65b0\u7248\u672c\u7684MySQL\u4e2d\uff0cInnoDB\u5f15\u64ce\u7531\u4e8e\u5176\u5bf9\u4e8b\u52a1\uff0c\u53c2\u7167\u5b8c\u6574\u6027\uff0c\u4ee5\u53ca\u66f4\u9ad8\u7684\u5e76\u53d1\u6027\u7b49\u4f18\u70b9\u5f00\u59cb\u5e7f\u6cdb\u7684\u53d6\u4ee3MyISAM\u3002 \u6bcf\u4e00\u4e2aMyISAM\u8868\u90fd\u5bf9\u5e94\u4e8e\u786c\u76d8\u4e0a\u7684\u4e09\u4e2a\u6587\u4ef6\u3002\u8fd9\u4e09\u4e2a\u6587\u4ef6\u6709\u4e00\u6837\u7684\u6587\u4ef6\u540d\uff0c\u4f46\u662f\u6709\u4e0d\u540c\u7684\u6269\u5c55\u540d\u4ee5\u6307\u793a\u5176\u7c7b\u578b\u7528\u9014\uff1a.frm\u6587\u4ef6\u4fdd\u5b58\u8868\u7684\u5b9a\u4e49\uff0c\u4f46\u662f\u8fd9\u4e2a\u6587\u4ef6\u5e76\u4e0d\u662fMyISAM\u5f15\u64ce\u7684\u4e00\u90e8\uff0c\u800c\u662f\u670d\u52a1\u5668\u7684\u4e00\u90e8\u5206\uff1b.MYD\u4fdd\u5b58\u8868\u7684\u6570\u636e\uff1b.MYI\u662f\u8868\u7684\u7d22\u5f15\u6587\u4ef6\u3002 \u4ec0\u4e48\u662fInnoDB? InnoDB\u662fMySQL\u7684\u53e6\u4e00\u4e2a\u5b58\u50a8\u5f15\u64ce\uff0c\u6b63\u6210\u4e3a\u76ee\u524dMySQL AB\u6240\u53d1\u884c\u65b0\u7248\u7684\u6807\u51c6\uff0c\u88ab\u5305\u542b\u5728\u6240\u6709\u4e8c\u8fdb\u5236\u5b89\u88c5\u5305\u91cc\u3002\u8f83\u4e4b\u4e8e\u5176\u5b83\u7684\u5b58\u50a8\u5f15\u64ce\u5b83\u7684\u4f18\u70b9\u662f\u5b83\u652f\u6301\u517c\u5bb9ACID\u7684\u4e8b\u52a1\uff08\u7c7b\u4f3c\u4e8ePostgreSQL),\u4ee5\u53ca\u53c2\u6570\u5b8c\u6574\u6027\uff08\u5373\u5bf9\u5916\u952e\u7684\u652f\u6301\uff09\u3002 Oracle\u516c\u53f8\u4e0e2005\u5e7410\u6708\u6536\u8d2d\u4e86Innobase\u3002Innobase\u91c7\u7528\u53cc\u8ba4\u8bc1\u6388\u6743\u3002\u5b83\u4f7f\u7528GNU\u53d1\u884c\uff0c\u4e5f\u5141\u8bb8\u5176\u5b83\u60f3\u5c06InnoDB\u7ed3\u5408\u5230\u5546\u4e1a\u8f6f\u4ef6\u7684\u56e2\u4f53\u83b7\u5f97\u6388\u6743\u3002 MyISAM vs Innodb &#8211; Quick comparison Table | \u5feb\u901f\u6bd4\u8f83\u8868: MyISAM Innodb Not *ACID compliant and non-transactional *ACID compliant and hence fully transactional with ROLLBACK and COMMIT and support for Foreign Keys MySQL 5.0 Default Engine Rackspace Cloud Default Engine Offers Compression Offers [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,8],"tags":[76,163],"class_list":["post-1500","post","type-post","status-publish","format-standard","hentry","category-study","category-technical","tag-mysql","tag-163"],"_links":{"self":[{"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=\/wp\/v2\/posts\/1500","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1500"}],"version-history":[{"count":0,"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=\/wp\/v2\/posts\/1500\/revisions"}],"wp:attachment":[{"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dayandcarrot.space\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}