{"id":164981,"date":"2020-10-01T13:51:21","date_gmt":"2020-10-01T05:51:21","guid":{"rendered":"http:\/\/4563.org\/?p=164981"},"modified":"2020-10-01T13:51:21","modified_gmt":"2020-10-01T05:51:21","slug":"%e5%85%b3%e4%ba%8e-mysql-%e4%b8%a4%e8%a1%a8%e6%9f%a5%e8%af%a2%ef%bc%8c%e4%b8%89%e5%88%97%e5%ad%97%e6%ae%b5%e7%9b%b8%e7%ad%89%e7%9a%84%e4%b8%80%e4%b8%aa%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=164981","title":{"rendered":"\u5173\u4e8e mysql \u4e24\u8868\u67e5\u8be2\uff0c\u4e09\u5217\u5b57\u6bb5\u76f8\u7b49\u7684\u4e00\u4e2a\u95ee\u9898"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5173\u4e8e mysql \u4e24\u8868\u67e5\u8be2\uff0c\u4e09\u5217\u5b57\u6bb5\u76f8\u7b49\u7684\u4e00\u4e2a\u95ee\u9898               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : 0clickjacking0 <\/span>  <span><i><\/i> 1<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u76ee\u524d\u60c5\u51b5\u662f\u8fd9\u6837\u7684\uff0c\u6211\u6709\u4e24\u5f20\u8868\uff0c\u5206\u522b\u4e3a t1 \u548c t2\uff0ct1 \u4e2d\u6709\u5b57\u6bb5\uff08 id,a,b,c \uff09,t2 \u4e2d\u6709\u5b57\u6bb5(name,a,b,c)\uff0c\u60f3\u8ba9\u8fd9\u4e24\u8868\u4e2d\u7684 a,b,c \u5b57\u6bb5\u76f8\u7b49\u65f6\uff0c\u67e5\u8be2\u51fa id \u548c name\uff0c\u6211\u7684\u67e5\u8be2\u8bed\u53e5\u5982\u4e0b<code>select id,name from t1,t2 where(t1.a=t2.a and t1.b=t2.b and t1.c=t2.c)<\/code>\uff0c\u4f46\u662f\u4e00\u76f4\u67e5\u4e0d\u51fa\u6765\uff0c\u4e5f\u5c1d\u8bd5\u8fc7\u5148\u628a a \u5b57\u6bb5\u76f8\u7b49\u7684\u67e5\u5230\u4e00\u5f20\u8868\u4e0a\uff0c\u4f46\u662f\u6570\u636e\u91cf\u5b9e\u5728\u592a\u5927\u4e86\uff0c\u8868\u76f4\u63a5\u6ee1\u4e86\uff0c\u62a5\u9519\u4e86\uff0c\u5404\u4f4d\u5927\u5e08\u5085\u6709\u5565\u529e\u6cd5\u5417<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>16<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3626219\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xyjincan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             a\uff0cb\uff0cc where \u987a\u5e8f\u6309\u8868\u5185\u91cd\u590d\u6570\u636e\u91cf\u4ece\u5c0f\u5230\u5927\u6765\uff0c\u5efa\u7acb\u7d22\u5f15\uff0c\u8fd9\u4e24\u4e2a\u8868\u8fd8\u662f\u5408\u5e76\u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3626220\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lychs1998 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bd5\u8bd5\u8fde\u63a5\uff1f<br \/>select t1.id,t2.name from t1 inner join t2 on t1.a = t2.a and t1.b = t2.b and t1.c = t2.c;<\/p>\n<p>\u4e0d\u8fc7\u5176\u5b9e\u6700\u597d\u8fd8\u662f\u5f04\u4e2a t3 \u8868\uff0c\u6570\u636e\u7ed3\u6784\u662f id,name,a,b,c \u628a\u4e24\u4e2a\u8868\u6570\u636e\u5408\u5e76\u4e86\u6700\u65b9\u4fbf\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3626221\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : 0clickjacking0 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lychs1998 \u6211\u7684\u601d\u8def\u662f\u8fd9\u6837\u7684\uff0c\u5148\u628a a \u76f8\u7b49\u7684\u505a\u4e00\u5f20\u4e34\u65f6\u8868\uff0c\u7136\u540e\u5728\u8fd9\u5f20\u4e34\u65f6\u8868\u4e2d\u53bb\u67e5\u8be2 b \u76f8\u7b49\u7684\uff0c\u7136\u540e\u53bb\u67e5\u8be2 c \u76f8\u7b49\u7684\uff0c\u4f46\u662f\u8fd9\u6837\u597d\u50cf\u6709\u95ee\u9898\uff0c\u67e5\u4e0d\u51fa\u6765                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3626222\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : 0clickjacking0 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xyjincan \u6211\u7684\u601d\u8def\u662f\u8fd9\u6837\u7684\uff0c\u5148\u628a a \u76f8\u7b49\u7684\u505a\u4e00\u5f20\u4e34\u65f6\u8868\uff0c\u7136\u540e\u5728\u8fd9\u5f20\u4e34\u65f6\u8868\u4e2d\u53bb\u67e5\u8be2 b \u76f8\u7b49\u7684\uff0c\u7136\u540e\u53bb\u67e5\u8be2 c \u76f8\u7b49\u7684\uff0c\u4f46\u662f\u8fd9\u6837\u597d\u50cf\u6709\u95ee\u9898\uff0c\u67e5\u4e0d\u51fa\u6765                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3626223\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : bowser1701 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @0clickjacking0 \u7528\u8fde\u63a5\u4e0d\u884c\u5417\uff1f\u611f\u89c9\u4f60\u8fd9\u79cd\u601d\u8def\u4e5f\u4e0d\u4f1a\u6bd4\u8fde\u63a5\u9ad8\u6548\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3626224\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : KomiSans <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             select b01.id as id , b02.name as name from b1 b01 INNER JOIN b2 b02 ON b01.a = b02.a and b01.b = b02.b and b01.c = b02.c; \uff1f\uff1f\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3626225\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lpts007 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u60f3\u6c42\u4e3b\u4e2a\u4e8b<br \/>\u80fd\u628a\u8868\u6570\u636e\u91cf\uff0c\u6570\u636e\u5206\u5e03\u63cf\u8ff0\u4e00\u4e0b\u5417<br \/>abc \u91cd\u7684\u591a\u4e86\u80af\u5b9a\u67e5\u4e0d\u51fa\u6765\uff0c\u4f60\u81ea\u5df1\u6253\u7b97\u600e\u4e48\u529e                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3626226\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : 0clickjacking0 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lpts007 \u8868 1 \u5927\u6982 15 \u4e07\u6761\uff0c\u8868 2 \u5927\u7ea6 4900 \u6761\uff0c\u5c31\u76ee\u524d\u4e07\u60f3\u8981\u7684\u7ed3\u679c\u662f t1.a=t2.a and t1.b=t2.b and t1.c=t2.c \u540c\u65f6\u6ee1\u8db3\uff0c\u4f46\u662f\u67e5\u51fa\u6765\u7684\u8c8c\u4f3c\u662f\u7b1b\u5361\u5c14\u79ef\uff0c\u6709\u4e9b\u6570\u636e\u6709\u95ee\u9898\u7684\uff0c\u6211\u53bb\u8bd5\u8bd5\u81ea\u7136\u8fde\u63a5\u884c\u4e0d\u884c\uff0c\u5982\u679c\u4e0d\u884c\u7684\u8bdd\uff0c\u8003\u8651\u7528 py \u4e86\uff0c\u56e0\u4e3a\u6570\u636e\u91cf\u4e5f\u6ca1\u6709\u8fbe\u5230\u4e0a\u767e\u4e07\u7684\u7ea7\u522b\uff0c\u7528 py \u4e5f\u662f\u65e0\u5948\u4e4b\u4e3e                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3626227\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wangritian <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             t2 \u4f5c\u4e3b\u8868\uff08\u603b\u884c\u6570\u5c11\u7684\uff09\uff0cleft join t1\uff0ct1 \u521b\u5efa\u8054\u5408\u7d22\u5f15 a,b,c<br \/>\u4e5f\u53ef\u4ee5\u589e\u52a0\u5b57\u6bb5\u8ba1\u7b97 a,b,c \u7684\u54c8\u5e0c\uff0c\u5bf9\u54c8\u5e0c\u5b57\u6bb5\u521b\u5efa\u7d22\u5f15\uff0c\u67e5\u8be2\u65f6\u4e0d\u7528\u7ba1 a,b,c \u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3626228\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : 0clickjacking0 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @wangritian \u90a3\u6211\u662f\u4e0d\u662f\u53ef\u4ee5\u5bf9 t1 \u548c t2 \u7684 a,b,c \u5b57\u6bb5\u90fd\u8ba1\u7b97\u54c8\u5e0c\uff0c\u7136\u540e\u76f4\u63a5\u53bb\u6bd4\u8f83\u4ed6\u4eec\u7684\u54c8\u5e0c\u5c31\u884c\u4e86\uff0c\u8fd9\u6837\u5c31\u53d8\u6210\u4e86\u6bd4\u8f83\u4e00\u4e2a\u5b57\u6bb5                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3626229\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lpts007 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @0clickjacking0 <br \/>\u201c\u4f46\u662f\u67e5\u51fa\u6765\u7684\u8c8c\u4f3c\u662f\u7b1b\u5361\u5c14\u79ef\u201d \u90a3\u5c31\u5bf9\u4e86\uff0c\u8bf4\u660e\u5b58\u5728\u5927\u91cf abc \u76f8\u7b49\u7684\u6570\u636e<br \/>\u5047\u8bbe<br \/>\u8868 t1<br \/>|id | a| b| c|<br \/>|1| a1|b1|c1|<br \/>|2| a1|b1|c1|<br \/>|3| a3|b3|c3|<\/p>\n<p>\u8868 t2<br \/>|name | a| b| c|<br \/>|n1| a1|b1|c1|<br \/>|n2| a1|b1|c1|<br \/>|n3| a1|b1|c1|<br \/>|n4| a3|b3|c3|<\/p>\n<p>\u7ed3\u679c\u4f1a\u6709 2 x 3 +1 x 1 = 7 \u6761\u3002\u90a3\u4f60\u7684\u9884\u671f\u662f\u4e0d\u662f\u67e5\u51fa 7 \u6761\u5462\uff1f<br \/>abc \u91cd\u590d\u8bb0\u5f55\u8d8a\u591a\uff0c\u6570\u636e\u6761\u6570\u8d8a\u591a\u3002<br \/>\u4f60\u5bf9\u4fe9\u8868\u6570\u636e\u5206\u5e03\u6ca1\u6709\u5927\u4f53\u6982\u5ff5\u5417.<\/p>\n<p>\u6211\u534a\u74f6\u5b50\u6c34\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3626230\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lpts007 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u81f3\u4e8e hash \u6210\u4e00\u4e2a\u5b57\u6bb5\u518d\u539f\u6837\u67e5\u2014\u2014\u5982\u679c\u7ed3\u679c\u8ddf\u4e4b\u524d\u4e0d\u4e00\u6837\u7684\u8bdd\uff0c\u8981\u4e48 hash \u78b0\u649e\uff0c\u8981\u4e48 mysql \u7684 bug \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3626231\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zhangysh1995 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e5d\u9760\u8c31 @wangritian <br \/>\u4e3b\u53ef\u80fd\u8981\u7ed9\u51fa\u8868\u7ed3\u6784\u4f1a\u66f4\u597d\u4e00\u4e9b\u3002\u53e6\u5916\uff0c\u5982\u679c a,b,c \u662f\u7ec4\u5408\u5916\u952e\u597d\u8bf4\uff0c\u4e0d\u662f\u7684\u8bdd\uff0c\u4e3a\u5565 name \u6ca1\u6709\u4e5f\u653e\u5728 t1 \u91cc\u9762\uff1f\u611f\u89c9\u6709\u4e9b\u8bb8\u5947\u602a\u3002\u4ece\u67e5\u8be2\u6765\u8bf4\uff0c\u9700\u8981\u7ed9 t2 \u52a0\u7ec4\u5408\u7d22\u5f15 (a,b,c) \uff0cinner join \u548c left join \u533a\u522b\u4e0d\u5927\uff0c\u90fd\u662f index scan                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3626232\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : vZexc0m <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bd5\u8bd5\u5148\u6c42\u548c\uff0c\u7136\u540e\u5bf9\u548c\u505a\u7d22\u5f15\u3002\u7136\u540e\u7f29\u5c0f\u8303\u56f4\u518d\u67e5                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3626233\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : PopRain <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             select distinct id,name from t1,t2 where(t1.a=t2.a and t1.b=t2.b and t1.c=t2.c)<\/p>\n<p>\u4f60\u8fd9\u4e2a\u6570\u636e\u91cf\u4e00\u70b9\u90fd\u4e0d\u5927\uff0c\u67e5\u4e0d\u51fa\u6765\u8bf4\u660e\u6ee1\u8db3\u6761\u4ef6\u7684\u8bb0\u5f55\u592a\u591a\u592a\u591a\u4e86\u3002\u3002\u3002\u3002 \u8bd5\u8bd5\u6d88\u91cd                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3626234\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wangritian <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @0clickjacking0 \u662f\u7684\uff0c\u8fd9\u662f\u54c8\u5e0c\u7684\u4f5c\u7528\u4e4b\u4e00\uff0c\u4f46\u4e0d\u6392\u9664\u6709\u54c8\u5e0c\u78b0\u649e\u6982\u7387\uff0c\u5728\u8d85\u5927\u6570\u636e\u91cf\u65f6\uff0c\u54c8\u5e0c\u76f8\u7b49\uff0c\u8fd8\u9700\u8981\u5bf9\u5e94\u7684 n \u4e2a\u5b57\u6bb5\u4e5f\u5206\u522b\u76f8\u7b49                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5173\u4e8e mysql \u4e24\u8868\u67e5\u8be2\uff0c\u4e09\u5217\u5b57&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/164981"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=164981"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/164981\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=164981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=164981"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=164981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}