{"id":125053,"date":"2020-06-27T01:50:58","date_gmt":"2020-06-26T17:50:58","guid":{"rendered":"http:\/\/4563.org\/?p=125053"},"modified":"2020-06-27T01:50:58","modified_gmt":"2020-06-26T17:50:58","slug":"%e6%89%80%e6%9c%89%e5%ad%97%e6%ae%b5%e6%94%af%e6%8c%81%e6%8e%92%e5%ba%8f%ef%bc%8c%e6%9c%89-v-%e5%8f%8b%e6%9c%89%e5%a5%bd%e7%9a%84%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88%e5%90%97","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=125053","title":{"rendered":"\u6240\u6709\u5b57\u6bb5\u652f\u6301\u6392\u5e8f\uff0c\u6709 v \u53cb\u6709\u597d\u7684\u89e3\u51b3\u65b9\u6848\u5417"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6240\u6709\u5b57\u6bb5\u652f\u6301\u6392\u5e8f\uff0c\u6709 v \u53cb\u6709\u597d\u7684\u89e3\u51b3\u65b9\u6848\u5417               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tuine <\/span>  <span><i><\/i> 4<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6709\u4e2a\u9700\u6c42\u6b63\u5728\u505a\uff0c\u6240\u6709\u5b57\u6bb5\u652f\u6301\u6392\u5e8f\uff0c\u800c\u4e14\u5b57\u6bb5\u662f\u53ef\u589e\u52a0\u7684\uff0c\u6570\u636e\u5e93\u7528\u7684 pgsql\uff0c\u76ee\u524d\u60f3\u7684\u662f\u540c\u6b65\u5230 ES\uff0c\u7136\u540e\u8fdb\u884c\u6392\u5e8f&#8230;&#8230;<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>9<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"2139407\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : guyeu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5f53\u4f60\u89c9\u5f97\u4e00\u4e2a\u4e1c\u897f\u7684\u8bbe\u8ba1\u5f88\u50bb\u903c\uff0c\u8bf4\u660e\u8981\u4e0d\u7136\u9700\u6c42\u6709\u95ee\u9898\uff0c\u8981\u4e0d\u7136\u5bf9\u9700\u6c42\u7684\u7406\u89e3\u6709\u95ee\u9898\u3002\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2139408\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Liutos <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u780d\u9700\u6c42                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2139409\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : reus <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8981\u6392\u5e8f\u5c31\u52a0\u7d22\u5f15\u554a\uff0c\u6709\u4ec0\u4e48\u95ee\u9898\uff1f<br \/>\u8868\u7ed3\u6784 key, value \u5c31\u884c\u4e86<br \/>\u7d22\u5f15\u8fd9\u6837\u5efa\uff1acreate index on xxx using btree((value)) where key = &#8216;foo&#8217;<br \/>\u52a0\u4e00\u4e2a\u5b57\u6bb5\u5c31\u5efa\u4e00\u4e2a\u7d22\u5f15\uff0c\u53cd\u6b63\u4f60\u7684\u5b57\u6bb5\u4e5f\u4e0d\u4f1a\u65e0\u9650\u591a\u5427\uff1f<br \/>\u9700\u6c42\u4e0d\u50bb\u903c\uff0c\u9700\u6c42\u4e5f\u4e0d\u7528\u780d\uff0c\u56e0\u4e3a\u4f60\u7528\u7684\u662f pg\uff0cpg \u652f\u6301 partial index                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2139410\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : tuine <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @guyeu <br \/>@Liutos <br \/>\u9700\u6c42\u786e\u5b9e\u5f88\u50bb\u903c\uff0c\u8001\u677f\u8bf4\u7ed9\u6211\u4e00\u4e2a\u5145\u5206\u7684\u7406\u7531\uff0c\u4e0d\u7136\u5c31\u9700\u8981\u8fd9\u4e2a\uff01                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2139411\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : tuine <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @reus <br \/>\u52a0\u7d22\u5f15\u4e5f\u8003\u8651\u8fc7\uff0c\u4f46\u662f\u611f\u89c9\u4e0d\u592a\u5408\u7406\uff0c\u800c\u4e14\u4f1a\u9020\u6210\u5927\u91cf\u7d22\u5f15\u6570\u636e                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2139412\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : crclz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \uff08\u67d0\u5f20\u8868\uff09\u6240\u6709\u5b57\u6bb5\u652f\u6301\u6392\u5e8f\uff0c\u800c\u4e14\u5b57\u6bb5\u662f\u53ef\u589e\u52a0\u7684<\/p>\n<p>\u65b9\u6848 1\uff1a<br \/>\u4f8b\u5982\uff0c\u8fd9\u5f20\u8868\u4e3a\uff08 id\uff0c\u59d3\u540d\uff0c\u73ed\u7ea7\uff0c\u7535\u8bdd\u53f7\u7801\uff09<br \/>\u90a3\u4e48\uff0c\u6211\u4eec\u9700\u8981\u5efa\u7acb\u4e0b\u8868\u6765\u8fdb\u884c\u5b58\u50a8\uff1a<br \/>\uff08 id\uff0ckey\uff0cvalue \uff09<br \/>\u67d0\u5217\uff08 id=1\uff0c\u59d3\u540d=zhangsan\uff0c\u73ed\u7ea7=12\uff0c\u7535\u8bdd=18988888888 \uff09\u53ef\u4ee5\u8f6c\u6362\u4e3a\u4e0b\u8868\uff1a<br \/>\uff08 1\uff0c\u59d3\u540d\uff0czhangsan \uff09\uff08 1\uff0c\u73ed\u7ea7\uff0c12 \uff09\uff08 1\uff0c\u7535\u8bdd\u53f7\u7801\uff0c18988888888 \uff09<\/p>\n<p>\u8bc4\u4ef7\uff1a\u65b9\u6848 1 \u5f00\u53d1\u7b80\u5355\uff0c\u5bb9\u6613\u60f3\u5230\u3002\u4f46\u662f\u5c06\u8fde\u63a5\u597d\u7684\u5217\u62c6\u5206\u4f1a\u9762\u4e34\u4ee5\u4e0b\u95ee\u9898\uff1a<br \/>1. \u65e0\u6cd5\u521b\u5efa\u5305\u542b\u591a\u5217\u7684\u7d22\u5f15\uff08\u5f53\u7136\uff0c\u5982\u679c\u4f60\u53ea\u9700\u8981\u5355\u4e00\u7684\u6309\u7167\u67d0\u4e2a\u5217\u6392\u5e8f\uff0c\u5219\u4e0d\u5b58\u5728\u8fd9\u4e2a\u95ee\u9898\uff09<br \/>2. JOIN \u5f00\u9500\u5927<\/p>\n<p>\u4f46\u662f\uff0c\u5f53\u6570\u636e\u91cf\u3001\u5e76\u53d1\u91cf\u5c0f\u7684\u65f6\u5019\uff0c1 \u548c 2 \u90fd\u4e0d\u79f0\u4e4b\u4e3a\u95ee\u9898\u3002<\/p>\n<p>\u65b9\u6848 2\uff1a\uff08\u8fd9\u79cd\u65b9\u6cd5\u6bd4\u8f83 hack \uff09<br \/>\u5728\u4e1a\u52a1\u4ee3\u7801\u91cc\u9762\u7528\u539f\u751f sql \u52a8\u6001\u589e\u51cf\u5217\uff0c\u7136\u540e\u7528 sql \u521b\u5efa\u7d22\u5f15\uff0c\u5e76\u4e14\u628a\u5143\u6570\u636e\uff08 schema \uff09\u50a8\u5b58\u5728\u67d0\u5904\u3002<\/p>\n<p>\u65b9\u6848 3\uff1a\u7528 mongodb \u3002mongodb \u662f schemaless \u6240\u4ee5\u4e0d\u7528\u52a8\u6001\u589e\u51cf\u5217\u3002\u4f7f\u7528 mongo \u547d\u4ee4\u6765\u5efa\u7acb\u7d22\u5f15\u3002<\/p>\n<p>\u65b9\u6848 4\uff1a\u7528 postgres \u7684 jsonb \u7c7b\u578b\uff0c\u548c mongo \u529f\u80fd\u51e0\u4e4e\u4e00\u81f4\u3002\u4f18\u70b9\u662f pg \u81ea\u5e26\u5c31\u6709\u3002<\/p>\n<p>\u5bf9 234 \u7684\u8bc4\u4ef7\uff1a<br \/>\u867d\u7136\u6ca1\u6709\u65b9\u6848 1 \u5efa\u7acb\u7d22\u5f15\u7684\u95ee\u9898\uff0c\u4f46\u662f\u591a\u5217\u7d22\u5f15\u7684\u95ee\u9898\u4f9d\u65e7\u5b58\u5728\uff1a<\/p>\n<p>\u5ba2\u6237\u6253\u5f00\u4ea7\u54c1\uff0c\u5efa\u7acb\u4e86\u4e00\u4e2a\u201c\u5b66\u53f7\u201d\u5217\u548c\u4e00\u4e2a\u201c\u59d3\u540d\u201d\u5217\u3002\u8fc7\u4e86\u51e0\u5929\u53c8\u5efa\u7acb\u4e86\u201c\u7535\u8bdd\u53f7\u7801\u201d\u5217\uff0c\u8fc7\u4e86\u51e0\u5929\u53c8\u5efa\u7acb\u4e86\u201c\u82f1\u8bed\u6210\u7ee9\u201d\u5217\u3002<br \/>\u95ee\u9898\uff1a\u4f60\u5982\u4f55\u77e5\u9053\u5e94\u8be5\u7ed9\u90a3\u51e0\u5217\u5efa\u7acb\u591a\u5217\u7684\u7d22\u5f15\uff1f<\/p>\n<p>\u4f17\u6240\u5468\u77e5\u7d22\u5f15\u5e94\u8be5\u6309\u7167\u67e5\u8be2\u6765\u5efa\u7acb\u3002\u5982\u679c\u7ecf\u5e38\u6309\u7167\uff08\u82f1\u8bed\u6210\u7ee9 \u6570\u5b66\u6210\u7ee9 \u8bed\u6587\u6210\u7ee9\uff09\u6765\u6392\u5e8f\uff0c\u90a3\u4e48\u5c31\u5e94\u8be5\u4e3a\u8fd9\u4e09\u5217\u5efa\u7acb\u7d22\u5f15\u3002\u6240\u4ee5\u6211\u7684\u5efa\u8bae\u662f\u5bf9\u4e8e\u6570\u636e\u91cf\u5927\u4e8e\u67d0\u4e2a\u503c\u7684\u8868\uff0c\u7edf\u8ba1\u4f7f\u7528\u8005\u7684\u4f7f\u7528\u4e60\u60ef\uff0c\u4e3a\u6700\u5e38\u4f7f\u7528\u7684\u51e0\u79cd\u6392\u5e8f\u7ec4\u5408\u5efa\u7acb\u7d22\u5f15\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2139413\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : vhysug01 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6570\u636e\u5e93\u5c42\u9762\u7684\u6392\u5e8f\u8fd8\u662f\u67e5\u51fa\u6765\u518d\u6392\u5e8f\u5462\uff0c\u80fd\u4e0d\u80fd\u8ba9\u67e5\u51fa\u6765\u5728\u6392\u5e8f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2139414\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : reus <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @tuine \u770b\u89c1\u4f60\u8fd9\u79cd\u56de\u590d\u5c31\u706b\u8d77\uff0c\u201c\u611f\u89c9\u4e0d\u592a\u5408\u7406\u201d\u662f\u4ec0\u4e48\u9b3c\uff1f\u80fd\u4e0d\u80fd\u6709\u70b9\u7406\u6027\uff0c\u4e0d\u8981\u51ed\u611f\u89c9\u6765\u60f3\u95ee\u9898\uff1f<br \/>\u201c\u9020\u6210\u5927\u91cf\u7d22\u5f15\u6570\u636e\u201d\uff1f\u4f60\u53e6\u5916\u5bfc\u5165 es\uff0c\u96be\u9053\u5c31\u4e0d\u662f\u989d\u5916\u4ea7\u751f\u6570\u636e\uff1f\u96be\u9053 es \u5c31\u4e0d\u662f\u9760\u7d22\u5f15\uff1f\u4e0d\u60f3\u8981\u7d22\u5f15\uff0c\u4f60\u76f4\u63a5\u5168\u8868\u626b\u63cf\u5f97\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"2139415\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yincrow <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6bcf\u4e2a\u5b57\u6bb5\u5c31\u662f\u4e00\u5f20\u8868\uff0cDrupal \u91cc\u5c31\u662f\u8fd9\u6837\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6240\u6709\u5b57\u6bb5\u652f\u6301\u6392\u5e8f\uff0c\u6709 v \u53cb\u6709\u597d\u7684&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\/125053"}],"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=125053"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/125053\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=125053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=125053"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=125053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}