{"id":5211,"date":"2021-05-29T14:44:23","date_gmt":"2021-05-29T06:44:23","guid":{"rendered":"https:\/\/www.xttblog.com\/?p=5211"},"modified":"2021-05-29T14:44:23","modified_gmt":"2021-05-29T06:44:23","slug":"%e4%bb%8e%e6%a0%b9%e4%b8%8a%e7%90%86%e8%a7%a3clickhouse%e5%88%b0%e5%ba%95%e5%bf%ab%e5%9c%a8%e5%93%aa%e9%87%8c%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=5211","title":{"rendered":"\u4ece\u6839\u4e0a\u7406\u89e3ClickHouse\u5230\u5e95\u5feb\u5728\u54ea\u91cc\uff1f"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">ClickHouse\u5230\u5e95\u725b\u903c\u5728\u54ea\u91cc\uff1f\u4e3a\u4ec0\u4e48\u6bd4MySQL\u5feb831\u500d\uff01<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e24\u5e74 ClickHouse \u975e\u5e38\u7684\u706b\uff0c\u5c24\u5176\u662f\u5728\u5927\u6570\u636e\u9886\u57df\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u521a\u597d\u8fd9\u4e24\u5929\u4e5f\u6709\u7fa4\u53cb\u5728\u7fa4\u91cc\u8bf4\u8d77 ClickHouse\uff0c\u8fd9\u6b3e\u6765\u81ea\u4fc4\u7f57\u65af Yandex \u7684\u5f00\u6e90\u6570\u636e\u5e93\u4ea7\u54c1\u6027\u80fd\u5c4c\u7206\u4e86\uff0c\u5ba3\u79f0\u6bd4 MySQL \u5feb 831 \u500d\u3002\u4eca\u5929\u6211\u4eec\u5c31\u626f\u4e00\u626f ClickHouse \u5230\u5e95\u597d\u5728\u54ea\u91cc\uff1f<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Yandex<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u6211\u4eec\u5148\u8bf4\u4e00\u4e0b Yandex \u8fd9\u5bb6\u516c\u53f8\uff0c\u4ed6\u662f\u4fc4\u7f57\u65af\u7684\u4e00\u5bb6\u4e92\u8054\u7f51\u5de8\u5934\u516c\u53f8\uff0c\u867d\u7136\u5728\u56fd\u9645\u4e0a\u6ca1\u4ec0\u4e48\u540d\u6c14\uff0c\u4f46\u5728\u4fc4\u7f57\u65af\uff0c\u4ed6\u5c31\u662f\u8001\u5927\uff0c\u662f\u4fc4\u7f57\u65af\u6392\u540d\u7b2c\u4e00\u7684\u641c\u7d22\u5f15\u64ce\u516c\u53f8\u3002\u662f\u548c\u8c37\u6b4c\u3001\u767e\u5ea6\u4e00\u6837\u7684\u5b58\u5728\u3002ClickHouse \u8bde\u751f\u4e8e 2016 \u5e74\uff0c\u5c31\u662f\u6765\u81ea\u4e8e Yandex \u516c\u53f8\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8001\u6bdb\u5b50\u5728\u56fd\u9645\u4e92\u8054\u7f51\u4e0a\uff0c\u867d\u7136\u6ca1\u6709\u50cf\u4e2d\u7f8e\u8fd9\u6837\u5177\u6709\u7edf\u6cbb\u5730\u4f4d\u7684\u4e92\u8054\u7f51\u516c\u53f8\uff0c\u4f46\u662f\u8001\u6bdb\u5b50\u7684\u4e00\u4e9b\u5f00\u6e90\u8f6f\u4ef6\u7684\u6027\u80fd\u8fd8\u662f\u6760\u6760\u7684\u3002\u6bd4\u5982\uff0c\u5927\u540d\u9f0e\u9f0e\u7684 Nginx\uff0c\u518d\u6bd4\u5982\u6211\u4eec\u4eca\u5929\u8981\u8ba8\u8bba\u7684 ClickHouse\uff0c\u6240\u4ee5\uff0cClickHouse \u8fd8\u662f\u975e\u5e38\u503c\u5f97\u4e00\u5b66\u7684\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ClickHouse<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">ClickHouse \u4e3b\u8981\u7528\u4e8e\u5728\u7ebf\u5206\u6790\u5904\u7406\u67e5\u8be2\uff08OLAP\uff09\uff0c\u80fd\u591f\u4f7f\u7528 SQL \u67e5\u8be2\u5b9e\u65f6\u751f\u6210\u5206\u6790\u6570\u636e\u62a5\u544a\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u548c\u6211\u4eec\u5e38\u89c1\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u975e\u5e38\u4e0d\u540c\u3002\u6bd4\u5982\uff0cMySQL\uff0cPostgresql\uff0cSQL Server \u7b49\u6570\u636e\u5e93\u91c7\u7528\u7684\u90fd\u662f\u884c\u5f0f\u5b58\u50a8\uff0c\u800c ClickHouse \u91c7\u7528\u7684\u786e\u5b9e\u5217\u5f0f\u5b58\u50a8\u3002\u4e0b\u9762\u6211\u4eec\u901a\u8fc7\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff0c\u6765\u6bd4\u8f83\u5b83\u4eec\u7684\u4e0d\u540c\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/xmt1139057136\/xttblog\/2021\/05\/ch0.png\" alt=\"\" \/><figcaption>MySQL \u884c\u5f0f\u5b58\u50a8<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u4e0a\u8ff0\u8868\u683c\u6240\u793a\uff0c\u4f20\u7edf\u7684 MySQL \u6570\u636e\u5e93\u7684\u6bcf\u4e00\u884c\u6570\u636e\u90fd\u662f\u7269\u7406\u7684\u5b58\u50a8\u5728\u4e00\u8d77\u7684\u3002\u5982\u679c\u6211\u8981\u53d6 id \u7b49\u4e8e 10000 \u8fd9\u4e00\u6761\u6570\u636e\u7684 name \u5217\uff0c\u90a3\u6211\u5c31\u5fc5\u987b\u8981\u628a\u8fd9\u4e00\u884c\u6570\u636e\u8bfb\u53d6\u51fa\u6765\uff0c\u7136\u540e\u53d6 name \u5217\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u518d\u6bd4\u5982\uff0c\u4e0b\u9762\u7684 SQL\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT name FROM xttblog where id &gt; 10000;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u4f17\u591a\u7684\u6570\u636e\u4e2d\uff0c\u6211\u53ea\u53d6\u4e00\u5217\uff0c\u4f46\u6211\u9700\u8981\u628a\u6bcf\u6761\u6570\u636e\u90fd\u8bfb\u53d6\u51fa\u6765\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u57fa\u4e8e\u4e0a\u9762\u4f20\u7edf\u6570\u636e\u5e93\u7684\u4e00\u4e9b\u7279\u70b9\uff0cClickHouse \u53e6\u8f9f\u8e4a\u5f84\uff0c\u63a8\u51fa\u4e86\u5217\u5f0f\u5b58\u50a8\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/xmt1139057136\/xttblog\/2021\/05\/ch1.png\" alt=\"\" \/><figcaption>ClickHouse\u5217\u5f0f\u5b58\u50a8<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u770b\u4e0a\u56fe\u7684\u5217\u5f0f\u5b58\u50a8\u793a\u4f8b\uff0c\u5b8c\u5168\u548c MySQL \u7b49\u6570\u636e\u5e93\u4e0d\u540c\u3002\u5f53\u6211\u6267\u884c\u4e0b\u9762\u7684 SQL \u65f6\uff0c\u67e5\u8be2\u6548\u7387\u975e\u5e38\u7684\u9ad8\uff01<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT name FROM xttblog where id &gt; 10000;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7531\u4e8e name \u5217\u7684\u6570\u636e\u90fd\u5b58\u50a8\u5728\u4e00\u8d77\uff0c\u56e0\u6b64\u6548\u7387\u5927\u5927\u7684\u8d85\u8fc7\u4e86\u4f20\u7edf\u7684\u6570\u636e\u5e93\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/xmt1139057136\/xttblog\/2021\/05\/ch2.png\" alt=\"\" \/><figcaption>\u884c\u5f0f\u5b58\u50a8\u548c\u5217\u5f0f\u5b58\u50a8\u6bd4\u8f83<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u9664\u4e86\u903b\u8f91\u4e0a\u7684\u4e0d\u540c\uff0c\u78c1\u76d8\u4e0a\u7684\u7ec4\u7ec7\u7ed3\u6784\u4e5f\u5927\u4e0d\u4e00\u6837\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/xmt1139057136\/xttblog\/2021\/05\/ch3.png\" alt=\"\" \/><figcaption>\u884c\u5f0f\u5b58\u50a8\u548c\u5217\u5f0f\u5b58\u50a8\u5728\u78c1\u76d8\u4e0a\u7684\u7ec4\u7ec7\u7ed3\u6784<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u9664\u4e86\u5217\u5f0f\u5b58\u50a8\u4e0a\u7684\u4e0d\u540c\uff0cClickHouse \u8fd8\u6709\u9ad8\u6548\u7684\u6570\u636e\u538b\u7f29\uff0c\u9ed8\u8ba4\u4f7f\u7528LZ4\u7b97\u6cd5\uff0c\u603b\u4f53\u538b\u7f29\u6bd4\u53ef\u8fbe 8:1\u3002ClickHouse \u8fd8\u91c7\u7528\u4e86\u5206\u5e03\u5f0f\u591a\u4e3b\u67b6\u6784\u63d0\u9ad8\u5e76\u53d1\u6027\u80fd\uff0cClickHouse\u4f7f\u8bfb\u8bf7\u6c42\u53ef\u4ee5\u968f\u673a\u6253\u5230\u4efb\u610f\u8282\u70b9\uff0c\u5747\u8861\u8bfb\u538b\u529b\uff0c\u5199\u8bf7\u6c42\u4e5f\u65e0\u9700\u8f6c\u53d1\u5230master\u8282\u70b9\uff0c\u4e0d\u4f1a\u4ea7\u751f\u5355\u70b9\u538b\u529b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ClickHouse \u8fd8\u6709\u5411\u91cf\u5f15\u64ce\uff0c\u5229\u7528 SIMD \u6307\u4ee4\u5b9e\u73b0\u5e76\u884c\u8ba1\u7b97\u3002\u5bf9\u591a\u4e2a\u6570\u636e\u5757\u6765\u8bf4\uff0c\u4e00\u6b21 SIMD \u6307\u4ee4\u4f1a\u540c\u65f6\u64cd\u4f5c\u591a\u4e2a\u5757\uff0c\u5927\u5927\u51cf\u5c11\u4e86\u547d\u4ee4\u6267\u884c\u6b21\u6570\uff0c\u7f29\u77ed\u4e86\u8ba1\u7b97\u65f6\u95f4\u3002\u5411\u91cf\u5f15\u64ce\u5728\u7ed3\u5408\u591a\u6838\u540e\u4f1a\u5c06 ClickHouse \u7684\u6027\u80fd\u6dcb\u6f13\u5c3d\u81f4\u7684\u53d1\u6325\u51fa\u6765\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ClickHouse \u5728\u7d22\u5f15\u4e0a\u4e5f\u6709\u4e0d\u540c\uff0c\u91c7\u7528\u4e86\u7a00\u758f\u7d22\u5f15\u53ca\u8df3\u6570\u7d22\u5f15\u3002\u540c\u65f6\u8fd8\u6709\u5f88\u591a MergeTree\uff0c\u63d0\u4f9b\u6d77\u91cf\u4e1a\u52a1\u573a\u666f\u652f\u6301\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u57fa\u4e8e\u4ee5\u4e0a\u7279\u70b9\uff0cClickHouse \u5728\u5305\u542b count\u3001sum\u3001group by\u3001order by \u7b49\u60c5\u51b5\u7684\u67e5\u8be2\u5bf9\u6bd4\uff0c\u540c\u7b49\u6761\u4ef6\u4e0b\uff0cClickHouse \u7684\u67e5\u8be2\u6027\u80fd\u5f02\u5e38\u5f3a\u608d\uff0c\u5b98\u7f51\u4e0a\u7684\u6570\u636e\u663e\u793a\uff0c\u662f\u540c\u7b49\u6761\u4ef6\u4e0b MySQL \u7684 831 \u500d\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/xmt1139057136\/xttblog\/2021\/05\/ch4.png\" alt=\"\" \/><figcaption>MySQL VS ClickHouse \u6027\u80fd\u6bd4\u8f83<\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/xmt1139057136\/xttblog\/2021\/05\/ch5.png\" alt=\"\" \/><figcaption>ClickHouse \u4e0e MySQL \u7684\u90e8\u5206SQL\u67e5\u8be2\u6548\u7387\u5bf9\u6bd4<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u66f4\u591a\u7684\u5bf9\u6bd4\u6570\u636e\uff0c\u5efa\u8bae\u5927\u5bb6\u53bb\u5b98\u7f51\u4e0a\u67e5\u770b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u54ce\uff0c\u53c8\u8981\u5185\u5377\u8d77\u6765\u4e86\u3002<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=5211\">\u4ece\u6839\u4e0a\u7406\u89e3ClickHouse\u5230\u5e95\u5feb\u5728\u54ea\u91cc\uff1f<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>ClickHouse\u5230\u5e95\u725b\u903c\u5728\u54ea\u91cc\uff1f\u4e3a\u4ec0\u4e48\u6bd4MySQL\u5feb831\u500d\uff01 \u8fd9\u4e24\u5e74 ClickHouse \u975e\u5e38\u7684\u706b\uff0c\u5c24 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[2115,83,791,1243,1236],"class_list":["post-5211","post","type-post","status-publish","format-standard","hentry","category-yyzt","tag-clickhouse","tag-mysql","tag-791","tag-1243","tag-1236"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/5211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5211"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/5211\/revisions"}],"predecessor-version":[{"id":5213,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/5211\/revisions\/5213"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}