{"id":10006123,"date":"2022-08-06T22:06:06","date_gmt":"2022-08-06T14:06:06","guid":{"rendered":"https:\/\/ityet.com\/?p=10006123"},"modified":"2022-08-06T22:06:06","modified_gmt":"2022-08-06T14:06:06","slug":"%e3%80%90java%e9%9d%a2%e8%af%95%e3%80%91%e8%bf%99%e9%81%93%e4%ba%92%e8%81%94%e7%bd%91%e9%ab%98%e9%a2%91%e9%9d%a2%e8%af%95%e9%a2%98%e9%9a%be%e4%bd%8f%e4%ba%8680%e7%9a%84%e7%a8%8b%e5%ba%8f%e5%91%98","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10006123","title":{"rendered":"\u3010Java\u9762\u8bd5\u3011\u8fd9\u9053\u4e92\u8054\u7f51\u9ad8\u9891\u9762\u8bd5\u9898\u96be\u4f4f\u4e8680%\u7684\u7a0b\u5e8f\u5458\uff1f\u7d22\u5f15\u4ec0\u4e48\u65f6\u5019\u5931\u6548\uff1f"},"content":{"rendered":"<blockquote>\n<p>\u201c\u7d22\u5f15\u4ec0\u4e48\u65f6\u5019\u5931\u6548\uff1f\u201d<\/p>\n<p>\u9762\u8bd5\u8fc7\u7a0b\u4e2d\uff0c\u7a81\u5982\u5176\u6765\u7684\u4e00\u4e2a\u95ee\u9898\uff0c\u662f\u4e0d\u662f\u6709\u70b9\u61f5\uff1f<\/p>\n<p>\u6ca1\u5173\u7cfb\uff0c\u5173\u6ce8\u6211\uff0c\u9762\u8bd5\u4e0d\u8ff7\u8def\u3002<\/p>\n<p>\u6211\u662fMic\uff0c\u4e00\u4e2a\u5de5\u4f5c\u4e8614\u5e74\u7684Java\u7a0b\u5e8f\u5458\u3002<\/p>\n<p>\u7d22\u5f15\u5931\u6548\u6d89\u53ca\u5230\u7684\u77e5\u8bc6\u70b9\u975e\u5e38\u591a\uff0c\u6240\u4ee5\u6211\u628a\u8fd9\u4e2a\u95ee\u9898\u7684\u56de\u7b54\u6574\u7406\u5230\u4e86\u4e00\u4e2a20W\u5b57\u7684\u9762\u8bd5\u6587\u6863\u91cc\u9762\uff0c\u5927\u5bb6\u53ef\u4ee5\u9886\u53d6\u3002<\/p>\n<p>\u4e0b\u9762\u770b\u770b\u9ad8\u624b\u7684\u56de\u7b54<\/p>\n<\/blockquote>\n<h2>\u9ad8\u624b\uff1a<\/h2>\n<p>InnoDB\u5f15\u64ce\u91cc\u9762\u6709\u4e24\u79cd\u7d22\u5f15\u7c7b\u578b\uff0c\u4e00\u79cd\u662f\u4e3b\u952e\u7d22\u5f15\u3001\u4e00\u79cd\u662f\u666e\u901a\u7d22\u5f15\u3002<\/p>\n<p>InnoDB\u7528\u4e86B+\u6811\u7684\u7ed3\u6784\u6765\u5b58\u50a8\u7d22\u5f15\u6570\u636e\u3002<\/p>\n<p>\u5f53\u4f7f\u7528\u7d22\u5f15\u5217\u8fdb\u884c\u6570\u636e\u67e5\u8be2\u7684\u65f6\u5019\uff0c\u6700\u7ec8\u4f1a\u5230\u4e3b\u952e\u7d22\u5f15\u6811\u4e2d\u67e5\u8be2\u5bf9\u5e94\u7684\u6570\u636e\u884c\u8fdb\u884c\u8fd4\u56de\u3002<\/p>\n<p>\u7406\u8bba\u4e0a\u6765\u8bf4\uff0c\u4f7f\u7528\u7d22\u5f15\u5217\u67e5\u8be2\uff0c\u5c31\u80fd\u5f88\u597d\u7684\u63d0\u5347\u67e5\u8be2\u6548\u7387\uff0c\u4f46\u662f\u4e0d\u89c4\u8303\u7684\u4f7f\u7528\u4f1a\u5bfc\u81f4\u7d22\u5f15\u5931\u6548\uff0c\u4ece\u800c\u65e0\u6cd5\u53d1\u6325\u7d22\u5f15\u672c\u8eab\u7684\u4ef7\u503c\u3002<\/p>\n<p>\u5bfc\u81f4\u7d22\u5f15\u5931\u6548\u7684\u60c5\u51b5\u6709\u5f88\u591a\uff1a<\/p>\n<ol>\n<li>\n<p>\u5728\u7d22\u5f15\u5217\u4e0a\u505a\u8fd0\u7b97\uff0c\u6bd4\u5982\u4f7f\u7528\u51fd\u6570\uff0cMysql\u5728\u751f\u6210\u6267\u884c\u8ba1\u5212\u7684\u65f6\u5019\uff0c\u5b83\u662f\u6839\u636e\u7edf\u8ba1\u4fe1\u606f\u6765\u5224\u65ad\u662f\u5426\u8981\u4f7f\u7528\u7d22\u5f15\u7684\u3002<\/p>\n<p>\u800c\u5728\u7d22\u5f15\u5217\u4e0a\u52a0\u51fd\u6570\u8fd0\u7b97\uff0c\u5bfc\u81f4Mysql\u65e0\u6cd5\u8bc6\u522b\u7d22\u5f15\u5217\uff0c\u4e5f\u5c31\u4e0d\u4f1a\u518d\u8d70\u7d22\u5f15\u4e86\u3002<\/p>\n<p>\u4e0d\u8fc7\u4eceMysql8\u5f00\u59cb\uff0c\u589e\u52a0\u4e86\u51fd\u6570\u7d22\u5f15\u53ef\u4ee5\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n<\/li>\n<li>\n<p>\u5728\u4e00\u4e2a\u7531\u591a\u5217\u6784\u6210\u7684\u7ec4\u5408\u7d22\u5f15\u4e2d\uff0c\u9700\u8981\u6309\u7167\u6700\u5de6\u5339\u914d\u6cd5\u5219\uff0c\u4e5f\u5c31\u662f\u4ece\u7d22\u5f15\u7684\u6700\u5de6\u5217\u5f00\u59cb\u987a\u5e8f\u68c0\u7d22\uff0c\u5426\u5219\u4e0d\u4f1a\u8d70\u7d22\u5f15\u3002<\/p>\n<p>\u5728\u7ec4\u5408\u7d22\u5f15\u4e2d\uff0c\u7d22\u5f15\u7684\u5b58\u50a8\u7ed3\u6784\u662f\u6309\u7167\u7d22\u5f15\u5217\u7684\u987a\u5e8f\u6765\u5b58\u50a8\u7684\uff0c\u56e0\u6b64\u5728sql\u4e2d\u4e5f\u9700\u8981\u6309\u7167\u8fd9\u4e2a\u987a\u5e8f\u624d\u80fd\u8fdb\u884c\u9010\u4e00\u5339\u914d\u3002<\/p>\n<p>\u5426\u5219InnoDB\u65e0\u6cd5\u8bc6\u522b\u7d22\u5f15\u5bfc\u81f4\u7d22\u5f15\u5931\u6548\u3002<\/p>\n<\/li>\n<li>\n<p>\u5f53\u7d22\u5f15\u5217\u5b58\u5728\u9690\u5f0f\u8f6c\u5316\u7684\u65f6\u5019\uff0c \u6bd4\u5982\u7d22\u5f15\u5217\u662f\u5b57\u7b26\u4e32\u7c7b\u578b\uff0c\u4f46\u662f\u5728sql\u67e5\u8be2\u4e2d\u6ca1\u6709\u4f7f\u7528\u5f15\u53f7\u3002<\/p>\n<p>\u90a3\u4e48Mysql\u4f1a\u81ea\u52a8\u8fdb\u884c\u7c7b\u578b\u8f6c\u5316\uff0c\u4ece\u800c\u5bfc\u81f4\u7d22\u5f15\u5931\u6548\u3002<\/p>\n<\/li>\n<li>\u5728\u7d22\u5f15\u5217\u4f7f\u7528\u4e0d\u7b49\u4e8e\u53f7\u3001<code>not<\/code>\u67e5\u8be2\u7684\u65f6\u5019\uff0c\u7531\u4e8e\u7d22\u5f15\u6570\u636e\u7684\u68c0\u7d22\u6548\u7387\u975e\u5e38\u4f4e\uff0c\u56e0\u6b64Mysql\u5f15\u64ce\u4f1a\u5224\u65ad\u4e0d\u8d70\u7d22\u5f15\u3002<\/li>\n<li>\n<p>\u4f7f\u7528like\u901a\u914d\u7b26\u5339\u914d\u540e\u7f00<code>%xxx<\/code>\u7684\u65f6\u5019\uff0c\u7531\u4e8e\u8fd9\u79cd\u65b9\u5f0f\u4e0d\u7b26\u5408\u7d22\u5f15\u7684\u6700\u5de6\u5339\u914d\u539f\u5219\uff0c\u6240\u4ee5\u4e5f\u4e0d\u4f1a\u8d70\u7d22\u5f15\u3002<\/p>\n<p>\u4f46\u662f\u53cd\u8fc7\u6765\uff0c\u5982\u679c\u901a\u914d\u7b26\u5339\u914d\u7684\u662f\u524d\u7f00<code>xxx%<\/code>\uff0c\u7b26\u5408\u6700\u5de6\u5339\u914d\uff0c\u4e5f\u4f1a\u8d70\u7d22\u5f15\u3002<\/p>\n<\/li>\n<li>\u4f7f\u7528<code>or<\/code>\u8fde\u63a5\u67e5\u8be2\u7684\u65f6\u5019\uff0c<code>or<\/code>\u8bed\u53e5\u524d\u540e\u6ca1\u6709\u540c\u65f6\u4f7f\u7528\u7d22\u5f15\uff0c\u90a3\u4e48\u7d22\u5f15\u4f1a\u5931\u6548\u3002\u53ea\u6709<code>or<\/code>\u5de6\u53f3\u67e5\u8be2\u5b57\u6bb5\u90fd\u662f\u7d22\u5f15\u5217\u7684\u65f6\u5019\uff0c\u624d\u4f1a\u751f\u6548\u3002<\/li>\n<\/ol>\n<p>\u9664\u4e86\u8fd9\u4e9b\u573a\u666f\u4ee5\u5916\uff0c\u5bf9\u4e8e\u591a\u8868\u8fde\u63a5\u67e5\u8be2\u7684\u573a\u666f\u4e2d\uff0c\u8fde\u63a5\u987a\u5e8f\u4e5f\u4f1a\u5f71\u54cd\u7d22\u5f15\u7684\u4f7f\u7528\u3002<\/p>\n<p>\u4e0d\u8fc7\u6700\u7ec8\u662f\u5426\u8d70\u7d22\u5f15\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528explain\u547d\u4ee4\u6765\u67e5\u770bsql\u7684\u6267\u884c\u8ba1\u5212\uff0c\u7136\u540e\u9488\u5bf9\u6027\u7684\u8fdb\u884c\u8c03\u4f18\u5373\u53ef\u3002<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>Mysql\u91cc\u9762\u5f88\u591a\u95ee\u9898\u90fd\u53ef\u4ee5\u8003\u5bdf\u6bd5\u7adf\u5b83\u4e5f\u662f\u5de5\u4f5c\u4e2d\u4f7f\u7528\u975e\u5e38\u9891\u7e41\u7684\u7ec4\u4ef6\uff0c\u6309\u9053\u7406\u6765\u8bf4\uff0c\u6211\u4eec\u662f\u6709\u5fc5\u8981\u53bb\u6df1\u5ea6\u5b66\u4e60Mysql\u7684\u5e95\u5c42\u539f\u7406\u3002<\/p>\n<p>\u6bd5\u7adf\u6570\u636e\u7684\u5b89\u5168\u6027\u3001\u6570\u636eIO\u6027\u80fd\u90fd\u4f1a\u5f71\u54cd\u5230\u7cfb\u7edf\u7684\u6574\u4f53\u541e\u5410\u91cf\u3002<\/p>\n<p>\u5927\u5bb6\u8bb0\u5f97\u70b9\u8d5e\u3001\u6536\u85cf\u52a0\u5173\u6ce8\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVcZhSx\" alt=\"file\" title=\"file\" loading=\"lazy\"><\/p>\n<blockquote><p>\u7248\u6743\u58f0\u660e\uff1a\u672c\u535a\u5ba2\u6240\u6709\u6587\u7ae0\u9664\u7279\u522b\u58f0\u660e\u5916\uff0c\u5747\u91c7\u7528 CC BY-NC-SA 4.0 \u8bb8\u53ef\u534f\u8bae\u3002\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u6765\u81ea <code>Mic\u5e26\u4f60\u5b66\u67b6\u6784<\/code>\uff01<br \/>\u5982\u679c\u672c\u7bc7\u6587\u7ae0\u5bf9\u60a8\u6709\u5e2e\u52a9\uff0c\u8fd8\u8bf7\u5e2e\u5fd9\u70b9\u4e2a\u5173\u6ce8\u548c\u8d5e\uff0c\u60a8\u7684\u575a\u6301\u662f\u6211\u4e0d\u65ad\u521b\u4f5c\u7684\u52a8\u529b\u3002\u6b22\u8fce\u5173\u6ce8\u540c\u540d\u5fae\u4fe1\u516c\u4f17\u53f7\u83b7\u53d6\u66f4\u591a\u6280\u672f\u5e72\u8d27\uff01<\/p><\/blockquote>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000042278578\">https:\/\/segmentfault.com\/a\/1190000042278578<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u201c\u7d22\u5f15\u4ec0\u4e48\u65f6\u5019\u5931\u6548\uff1f\u201d \u9762\u8bd5\u8fc7\u7a0b\u4e2d\uff0c\u7a81\u5982\u5176\u6765\u7684\u4e00\u4e2a\u95ee\u9898\uff0c\u662f\u4e0d\u662f\u6709\u70b9\u61f5\uff1f \u6ca1\u5173\u7cfb\uff0c\u5173\u6ce8\u6211\uff0c\u9762\u8bd5\u4e0d\u8ff7\u8def\u3002 \u6211\u662fMi [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-10006123","post","type-post","status-publish","format-standard","hentry"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10006123"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006123\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10006123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10006123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10006123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}