{"id":6596,"date":"2021-06-24T14:50:20","date_gmt":"2021-06-24T06:50:20","guid":{"rendered":"https:\/\/www.gbase8.cn\/?p=6596"},"modified":"2021-06-24T17:00:30","modified_gmt":"2021-06-24T09:00:30","slug":"%e4%bb%8eclickhouse%e6%89%a7%e8%a1%8c%e8%ae%a1%e5%88%92%e7%9c%8b%e8%b7%b3%e6%95%b0%e7%b4%a2%e5%bc%95%e7%9a%84%e6%95%88%e6%9e%9c","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/6596","title":{"rendered":"\u4eceClickhouse\u6267\u884c\u8ba1\u5212\u770b\u8df3\u6570\/\u7a00\u758f\u7d22\u5f15\u7684\u6548\u679c"},"content":{"rendered":"<p>Cliclhouse\u652f\u6301\u8df3\u6570\u7d22\u5f15(Data Skipping Indexes)\uff0c\u672c\u6587\u4ece\u6267\u884c\u8ba1\u5212\u4e0a\u67e5\u627e\u8df3\u6570\/\u7a00\u758f\u7d22\u5f15\u5bf9\u6267\u884c\u8ba1\u5212\u548c\u6027\u80fd\u7684\u5f71\u54cd\u3002<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Directory Navigation<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2b0c909e668\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2b0c909e668\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.gbase8.cn\/en\/6596\/#%E7%8E%AF%E5%A2%83\" >\u73af\u5883<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.gbase8.cn\/en\/6596\/#%E6%99%AE%E9%80%9A%E8%A1%A8\" >\u666e\u901a\u8868<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.gbase8.cn\/en\/6596\/#%E5%B8%A6%E8%B7%B3%E6%95%B0%E7%A8%80%E7%96%8F%E7%B4%A2%E5%BC%95%E7%9A%84%E8%A1%A8\" >\u5e26\u8df3\u6570\/\u7a00\u758f\u7d22\u5f15\u7684\u8868<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.gbase8.cn\/en\/6596\/#%E6%95%B0%E6%8D%AE%E9%87%8F\" >\u6570\u636e\u91cf<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.gbase8.cn\/en\/6596\/#%E6%9F%A5%E7%9C%8BClickhouse%E7%9A%84%E6%89%A7%E8%A1%8C%E8%AE%A1%E5%88%92\" >\u67e5\u770bClickhouse\u7684\u6267\u884c\u8ba1\u5212<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.gbase8.cn\/en\/6596\/#%E6%97%A0%E7%B4%A2%E5%BC%95%E8%A1%A8%E7%9A%84%E6%89%A7%E8%A1%8C%E8%AE%A1%E5%88%92\" >\u65e0\u7d22\u5f15\u8868\u7684\u6267\u884c\u8ba1\u5212<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.gbase8.cn\/en\/6596\/#%E5%B8%A6%E8%B7%B3%E6%95%B0%E7%A8%80%E7%96%8F%E7%B4%A2%E5%BC%95%E7%9A%84%E6%89%A7%E8%A1%8C%E8%AE%A1%E5%88%92\" >\u5e26\u8df3\u6570\/\u7a00\u758f\u7d22\u5f15\u7684\u6267\u884c\u8ba1\u5212<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.gbase8.cn\/en\/6596\/#%E6%89%A7%E8%A1%8C%E6%80%A7%E8%83%BD%E7%BB%93%E6%9E%9C%E5%AF%B9%E6%AF%94\" >\u6267\u884c\u6027\u80fd\u7ed3\u679c\u5bf9\u6bd4<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.gbase8.cn\/en\/6596\/#%E5%91%BD%E4%B8%AD%E6%95%B0%E9%87%8F%E5%B0%91%E6%97%B6%EF%BC%8C%E7%B4%A2%E5%BC%95%E6%95%88%E6%9E%9C%E6%98%8E%E6%98%BE\" >\u547d\u4e2d\u6570\u91cf\u5c11\u65f6\uff0c\u7d22\u5f15\u6548\u679c\u660e\u663e<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.gbase8.cn\/en\/6596\/#%E5%91%BD%E4%B8%AD%E6%95%B0%E9%87%8F%E5%B0%91%E6%97%B6%E6%89%A7%E8%A1%8C%E8%AE%A1%E5%88%92\" >\u547d\u4e2d\u6570\u91cf\u5c11\u65f6\u6267\u884c\u8ba1\u5212<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.gbase8.cn\/en\/6596\/#%E5%91%BD%E4%B8%AD%E5%A4%A7%E9%87%8F%E7%BB%93%E6%9E%9C%EF%BC%8C%E6%97%A0%E5%AE%9E%E8%B4%A8%E5%BD%B1%E5%93%8D\" >\u547d\u4e2d\u5927\u91cf\u7ed3\u679c\uff0c\u65e0\u5b9e\u8d28\u5f71\u54cd<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.gbase8.cn\/en\/6596\/#%E5%91%BD%E4%B8%AD%E5%A4%A7%E9%87%8F%E7%BB%93%E6%9E%9C%E6%89%A7%E8%A1%8C%E8%AE%A1%E5%88%92\" >\u547d\u4e2d\u5927\u91cf\u7ed3\u679c\u6267\u884c\u8ba1\u5212<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%8E%AF%E5%A2%83\"><\/span>\u73af\u5883<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%99%AE%E9%80%9A%E8%A1%A8\"><\/span>\u666e\u901a\u8868<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE testdb.t1\n(\n    `id` Int32,\n    `name` String,\n    `birth` Date\n)\nENGINE = MergeTree\nORDER BY id<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%B8%A6%E8%B7%B3%E6%95%B0%E7%A8%80%E7%96%8F%E7%B4%A2%E5%BC%95%E7%9A%84%E8%A1%A8\"><\/span>\u5e26\u8df3\u6570\/\u7a00\u758f\u7d22\u5f15\u7684\u8868<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u672c\u4f8b\u5b50\u4e2d\uff0c\u7528\u540d\u5b57\u7684\u957f\u5ea6\uff0clength(name)\uff0c\u505a\u7d22\u5f15\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE testdb.tt1\n(\n    `id` Int32,\n    `name` String,\n    `birth` Date,\n    INDEX a length(name) TYPE set(1000) GRANULARITY 4\n)\nENGINE = MergeTree\nORDER BY id<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%95%B0%E6%8D%AE%E9%87%8F\"><\/span>\u6570\u636e\u91cf<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u90fd\u662f6710\u4e07\u884c\uff0867108864\uff09\u3002\u4ece\u76f8\u540c\u7684\u8868\uff0cinsert select \u590d\u5236\u8fc7\u6765\u7684\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>localhost :) select count() from t1;\n\nSELECT count()\nFROM t1\n\nQuery id: f84c9c2a-a93c-4eaa-b3cd-a5edd171be0b\n\n\u250c\u2500\u2500count()\u2500\u2510\n\u2502 67108864 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n1 rows in set. Elapsed: 0.003 sec.\n\nlocalhost :) select count() from tt1;\n\nSELECT count()\nFROM tt1\n\nQuery id: d82f42cd-56f0-4697-b2ea-89c743d75b78\n\n\u250c\u2500\u2500count()\u2500\u2510\n\u2502 67108864 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n1 rows in set. Elapsed: 0.003 sec.\n\nlocalhost :)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E7%9C%8BClickhouse%E7%9A%84%E6%89%A7%E8%A1%8C%E8%AE%A1%E5%88%92\"><\/span>\u67e5\u770bClickhouse\u7684\u6267\u884c\u8ba1\u5212<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u6ce8\u610f\u5176\u4e2d\u7684\u6570\u636e\u8bfb\u53d6\u4f4d\u7f6e\uff0c\u5206\u522b\u662f\u4ece\u539f\u59cb\u7684\u5b58\u50a8\uff08<strong>ReadFromStorage<\/strong>\uff09\uff0c\u548c\u9884\u5904\u7406\u7684\u6e90(<strong>ReadFromPreparedSource<\/strong>)\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%97%A0%E7%B4%A2%E5%BC%95%E8%A1%A8%E7%9A%84%E6%89%A7%E8%A1%8C%E8%AE%A1%E5%88%92\"><\/span>\u65e0\u7d22\u5f15\u8868\u7684\u6267\u884c\u8ba1\u5212<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>localhost :) explain select * from t1 where length(name)=10;\n\nEXPLAIN\nSELECT *\nFROM t1\nWHERE length(name) = 10\n\nQuery id: a9431920-a102-4e98-bb63-1bcf27d1cfe4\n\n\u250c\u2500explain\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Expression ((Projection + Before ORDER BY))                               \u2502\n\u2502   SettingQuotaAndLimits (Set limits and quota after reading from storage) \u2502\n\u2502     <span class=\"has-inline-color has-luminous-vivid-orange-color\"><strong>ReadFromStorage (MergeTree)  <\/strong><\/span>                                         \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n3 rows in set. Elapsed: 0.004 sec.\n\nlocalhost :)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%B8%A6%E8%B7%B3%E6%95%B0%E7%A8%80%E7%96%8F%E7%B4%A2%E5%BC%95%E7%9A%84%E6%89%A7%E8%A1%8C%E8%AE%A1%E5%88%92\"><\/span>\u5e26\u8df3\u6570\/\u7a00\u758f\u7d22\u5f15\u7684\u6267\u884c\u8ba1\u5212<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>localhost :) explain select * from tt1 where length(name)=10;\n\nEXPLAIN\nSELECT *\nFROM tt1\nWHERE length(name) = 10\n\nQuery id: cbe2695b-7f0a-4c59-b4f4-bd69eba72dab\n\n\u250c\u2500explain\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Expression ((Projection + Before ORDER BY))                               \u2502\n\u2502   SettingQuotaAndLimits (Set limits and quota after reading from storage) \u2502\n\u2502     <span class=\"has-inline-color has-luminous-vivid-orange-color\"><strong>ReadFromPreparedSource (Read from NullSource)<\/strong><\/span>                         \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n3 rows in set. Elapsed: 0.004 sec.\n\nlocalhost :)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%89%A7%E8%A1%8C%E6%80%A7%E8%83%BD%E7%BB%93%E6%9E%9C%E5%AF%B9%E6%AF%94\"><\/span>\u6267\u884c\u6027\u80fd\u7ed3\u679c\u5bf9\u6bd4<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%91%BD%E4%B8%AD%E6%95%B0%E9%87%8F%E5%B0%91%E6%97%B6%EF%BC%8C%E7%B4%A2%E5%BC%95%E6%95%88%E6%9E%9C%E6%98%8E%E6%98%BE\"><\/span>\u547d\u4e2d\u6570\u91cf\u5c11\u65f6\uff0c\u7d22\u5f15\u6548\u679c\u660e\u663e<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>6700\u4e07\u53ea\u547d\u4e2d1\u884c\uff0c\u6027\u80fd\u5dee\u8ddd\u4e00\u4e2a\u6570\u91cf\u7ea7\u4ee5\u4e0a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>localhost :) select count(*) from t1 where length(name)=8;\n\nSELECT count(*)\nFROM t1\nWHERE length(name) = 8\n\nQuery id: 46c953f0-5b52-4162-a030-c628b0261e2e\n\n\u250c\u2500count()\u2500\u2510\n\u2502       1 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n1 rows in set. Elapsed: 0.458 sec. Processed 67.11 million rows, 939.52 MB (146.47 million rows\/s., 2.05 GB\/s.)\n\nlocalhost :) select count(*) from tt1 where length(name)=8;\n\nSELECT count(*)\nFROM tt1\nWHERE length(name) = 8\n\nQuery id: ecbba9cc-a728-4194-b814-9ffe6dffdcc7\n\n\u250c\u2500count()\u2500\u2510\n\u2502       1 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n1 rows in set. Elapsed: 0.013 sec.\n\nlocalhost :)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%91%BD%E4%B8%AD%E6%95%B0%E9%87%8F%E5%B0%91%E6%97%B6%E6%89%A7%E8%A1%8C%E8%AE%A1%E5%88%92\"><\/span>\u547d\u4e2d\u6570\u91cf\u5c11\u65f6\u6267\u884c\u8ba1\u5212<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>localhost :) explain select count(*) from t1 where length(name)=6;\n\nEXPLAIN\nSELECT count(*)\nFROM t1\nWHERE length(name) = 6\n\nQuery id: 3e40c992-cb35-427c-a666-cdec4497d430\n\n\u250c\u2500explain\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Expression ((Projection + Before ORDER BY))                                     \u2502\n\u2502   Aggregating                                                                   \u2502\n\u2502     Expression (Before GROUP BY)                                                \u2502\n\u2502       Filter (WHERE)                                                            \u2502\n\u2502         SettingQuotaAndLimits (Set limits and quota after reading from storage) \u2502\n\u2502           ReadFromStorage (MergeTree)                                           \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n6 rows in set. Elapsed: 0.013 sec.\n\nlocalhost :) explain select count(*) from tt1 where length(name)=6;\n\nEXPLAIN\nSELECT count(*)\nFROM tt1\nWHERE length(name) = 6\n\nQuery id: 3ef5e2fd-d210-4549-8cb4-b8db899f0a8d\n\n\u250c\u2500explain\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Expression ((Projection + Before ORDER BY))                                     \u2502\n\u2502   Aggregating                                                                   \u2502\n\u2502     Expression (Before GROUP BY)                                                \u2502\n\u2502       Filter (WHERE)                                                            \u2502\n\u2502         SettingQuotaAndLimits (Set limits and quota after reading from storage) \u2502\n\u2502           ReadFromPreparedSource (Read from NullSource)                         \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n6 rows in set. Elapsed: 0.014 sec.\n\nlocalhost :)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%91%BD%E4%B8%AD%E5%A4%A7%E9%87%8F%E7%BB%93%E6%9E%9C%EF%BC%8C%E6%97%A0%E5%AE%9E%E8%B4%A8%E5%BD%B1%E5%93%8D\"><\/span>\u547d\u4e2d\u5927\u91cf\u7ed3\u679c\uff0c\u65e0\u5b9e\u8d28\u5f71\u54cd<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u56e0\u4e3a\u8bc4\u4f30\u7684\u7ed3\u679c\uff0c\u547d\u4e2d\u5927\u91cf\u6570\u636e\uff0c\u4e0d\u518d\u8d70\u7d22\u5f15\uff0c\u540e\u9762\u7684\u6267\u884c\u8ba1\u5212\u4e5f\u80fd\u770b\u51fa\u5dee\u8ddd\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>localhost :) select count(*) from t1 where length(name)=5;\n\nSELECT count(*)\nFROM t1\nWHERE length(name) = 5\n\nQuery id: b72a577a-6c1b-4fa5-aaea-d65a7900b14e\n\n\u250c\u2500\u2500count()\u2500\u2510\n\u2502 67108864 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n1 rows in set. Elapsed: 0.447 sec. Processed 67.11 million rows, 939.52 MB (150.24 million rows\/s., 2.10 GB\/s.)\n\nlocalhost :) select count(*) from tt1 where length(name)=5;\n\nSELECT count(*)\nFROM tt1\nWHERE length(name) = 5\n\nQuery id: 984daf4c-f674-417b-b251-e53b31ba01e8\n\n\u250c\u2500\u2500count()\u2500\u2510\n\u2502 67108864 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n1 rows in set. Elapsed: 0.454 sec. Processed 67.11 million rows, 939.52 MB (147.71 million rows\/s., 2.07 GB\/s.)\n\nlocalhost :)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%91%BD%E4%B8%AD%E5%A4%A7%E9%87%8F%E7%BB%93%E6%9E%9C%E6%89%A7%E8%A1%8C%E8%AE%A1%E5%88%92\"><\/span>\u547d\u4e2d\u5927\u91cf\u7ed3\u679c\u6267\u884c\u8ba1\u5212<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u5b8c\u5168\u4e00\u6837\u7684\u6267\u884c\u8ba1\u5212\uff0c\u90fd\u662f\u4ece\u5b58\u50a8\u8bfb\u53d6\u4e86\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>localhost :) explain select count(*) from t1 where length(name)=5;\n\nEXPLAIN\nSELECT count(*)\nFROM t1\nWHERE length(name) = 5\n\nQuery id: c5ce5b52-bc5b-4315-8546-48bb74eb510c\n\n\u250c\u2500explain\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Expression ((Projection + Before ORDER BY))                                     \u2502\n\u2502   Aggregating                                                                   \u2502\n\u2502     Expression (Before GROUP BY)                                                \u2502\n\u2502       Filter (WHERE)                                                            \u2502\n\u2502         SettingQuotaAndLimits (Set limits and quota after reading from storage) \u2502\n\u2502           ReadFromStorage (MergeTree)                                           \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n6 rows in set. Elapsed: 0.004 sec.\n\nlocalhost :) explain select count(*) from tt1 where length(name)=5;\n\nEXPLAIN\nSELECT count(*)\nFROM tt1\nWHERE length(name) = 5\n\nQuery id: 9d1c9b43-344e-4e8b-91a1-2af55e417090\n\n\u250c\u2500explain\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Expression ((Projection + Before ORDER BY))                                     \u2502\n\u2502   Aggregating                                                                   \u2502\n\u2502     Expression (Before GROUP BY)                                                \u2502\n\u2502       Filter (WHERE)                                                            \u2502\n\u2502         SettingQuotaAndLimits (Set limits and quota after reading from storage) \u2502\n\u2502           ReadFromStorage (MergeTree)                                           \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n6 rows in set. Elapsed: 0.011 sec.\n\n<\/code><\/pre>","protected":false},"excerpt":{"rendered":"<p>Cliclhouse\u652f\u6301\u8df3\u6570\u7d22\u5f15(Data Skipping Indexes)\uff0c\u672c\u6587\u4ece\u6267\u884c\u8ba1\u5212\u4e0a\u67e5\u627e\u8df3\u6570\/\u7a00\u758f\u7d22\u5f15\u5bf9\u6267\u884c\u8ba1\u5212\u548c\u6027\u80fd\u7684\u5f71\u54cd\u3002<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86],"tags":[],"class_list":["post-6596","post","type-post","status-publish","format-standard","hentry","category-clickhouse"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/6596","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/comments?post=6596"}],"version-history":[{"count":6,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/6596\/revisions"}],"predecessor-version":[{"id":6617,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/6596\/revisions\/6617"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=6596"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=6596"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=6596"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}