{"id":5190,"date":"2021-03-24T10:26:40","date_gmt":"2021-03-24T02:26:40","guid":{"rendered":"https:\/\/www.gbase8.cn\/?p=5190"},"modified":"2021-04-16T15:06:36","modified_gmt":"2021-04-16T07:06:36","slug":"gbase-8a-%e4%bb%8e%e9%9b%86%e7%be%a4%e5%b1%82%e9%80%9a%e8%bf%87segment_id%e7%9b%b4%e6%8e%a5%e6%9f%a5%e8%af%a2%e5%88%86%e7%89%87%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/5190","title":{"rendered":"\u5357\u5927\u901a\u7528GBase 8a \u4ece\u96c6\u7fa4\u5c42\u901a\u8fc7segment_id\u76f4\u63a5\u67e5\u8be2\u5206\u7247\u6570\u636e\u6392\u67e5\u503e\u659c"},"content":{"rendered":"<p>GBase 8a \u6570\u636e\u5e93\u96c6\u7fa4\uff0c\u5c06\u6570\u636e\u6309\u7167\u7528\u6237\u6307\u5b9a\u7684\u5206\u5e03\u683c\u5f0f\u5207\u5206\uff0c\u4fdd\u5b58\u5728\u591a\u53f0\u6570\u636e\u8ba1\u7b97\u8282\u70b9\u4e0a\u3002\u672c\u6587\u4ecb\u7ecd\u5728\u65b0\u72489.5.3\u7248\u672c\u91cc\uff0c\u5982\u679c\u901a\u8fc7segment_id\u76f4\u63a5\u67e5\u8be2\u67d0\u4e9b\u8ba1\u7b97\u8282\u70b9\u7684\u6570\u636e\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-6a2aaa77a81c9\" 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-6a2aaa77a81c9\"  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\/5190\/#%E5%8F%82%E8%80%83\" >\u53c2\u8003<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.gbase8.cn\/en\/5190\/#%E9%99%90%E5%88%B6\" >\u9650\u5236<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.gbase8.cn\/en\/5190\/#%E8%83%8C%E6%99%AF\" >\u80cc\u666f<\/a><\/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\/5190\/#%E5%8F%82%E6%95%B0\" >\u53c2\u6570<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.gbase8.cn\/en\/5190\/#%E6%95%B0%E6%8D%AE%E5%BA%93%E5%8F%82%E6%95%B0\" >\u6570\u636e\u5e93\u53c2\u6570<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.gbase8.cn\/en\/5190\/#SQL%E8%AF%AD%E6%B3%95\" >SQL\u8bed\u6cd5<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.gbase8.cn\/en\/5190\/#%E6%A0%B7%E4%BE%8B\" >\u6837\u4f8b<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.gbase8.cn\/en\/5190\/#%E7%8E%AF%E5%A2%83\" >\u73af\u5883<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.gbase8.cn\/en\/5190\/#%E8%AE%BE%E7%BD%AE%E5%8F%82%E6%95%B0\" >\u8bbe\u7f6e\u53c2\u6570<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.gbase8.cn\/en\/5190\/#%E6%95%B0%E6%8D%AE\" >\u6570\u636e<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.gbase8.cn\/en\/5190\/#%E6%9F%A5%E8%AF%A2%E5%88%86%E7%89%87\" >\u67e5\u8be2\u5206\u7247<\/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\/5190\/#%E5%9C%A8%E6%9F%A5%E8%AF%A2%E7%BB%93%E6%9E%9C%E9%87%8C%E5%8C%85%E5%90%AB%E5%88%86%E7%89%87\" >\u5728\u67e5\u8be2\u7ed3\u679c\u91cc\u5305\u542b\u5206\u7247<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.gbase8.cn\/en\/5190\/#%E5%A4%9A%E8%A1%A8%E6%97%B6%EF%BC%8C%E6%8C%87%E5%AE%9A%E8%A1%A8%E5%90%8D%E5%AD%97\" >\u591a\u8868\u65f6\uff0c\u6307\u5b9a\u8868\u540d\u5b57<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.gbase8.cn\/en\/5190\/#%E7%BB%9F%E8%AE%A1%E5%90%84%E4%B8%AA%E5%88%86%E7%89%87%E7%9A%84%E6%95%B0%E6%8D%AE%E9%87%8F\" >\u7edf\u8ba1\u5404\u4e2a\u5206\u7247\u7684\u6570\u636e\u91cf<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8F%82%E8%80%83\"><\/span>\u53c2\u8003<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><a href=\"https:\/\/www.gbase8.cn\/en\/4943\/\">GBase 8a\u6570\u636e\u503e\u659c\uff0c\u4e0d\u540c\u8282\u70b9\u78c1\u76d8\u5360\u7528\u5dee\u8ddd\u7684\u51e0\u4e2a\u539f\u56e0<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.gbase8.cn\/en\/75\/\">GBase8a \u96c6\u7fa4\u67e5\u770b\u67d0\u5f20\u8868\u5360\u7528\u7684\u78c1\u76d8\u7a7a\u95f4\u5927\u5c0f<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%99%90%E5%88%B6\"><\/span>\u9650\u5236<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u4eceV9.5.3\u7248\u672c\u624d\u652f\u6301\uff0c\u8be5\u7248\u672c\u4e5f\u540c\u65f6\u652f\u6301\u591a\u5206\u7247\u90e8\u7f72\uff0c\u53ef\u4ee5\u53c2\u8003\u3010<a href=\"https:\/\/www.gbase8.cn\/en\/tag\/%e5%a4%9a%e5%ae%9e%e4%be%8b\/\">\u591a\u5b9e\u4f8b\u6709\u5173\u6587\u7ae0<\/a>\u3011<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E8%83%8C%E6%99%AF\"><\/span>\u80cc\u666f<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>GBase 8a\u6570\u636e\u5e93\u96c6\u7fa4\u7684\u6bcf\u4e2a\u6570\u636e\u8ba1\u7b97\u8282\u70b9\uff0c\u90fd\u662f\u4e00\u53f0\u6570\u636e\u5e93\u5355\u673a\uff0c\u8d1f\u8d23\u672c\u5730\u8ba1\u7b97\u548c\u5b58\u50a8\u3002\u8001\u7248\u672c\u96c6\u7fa4\uff0c\u53ef\u4ee5\u901a\u8fc7\u76f4\u63a5\u8fde\u63a5\u8ba1\u7b97\u8282\u70b9(\u6bd4\u5982\u901a\u8fc7\u547d\u4ee4\u884c\u5de5\u5177gncli\uff0c -h\u53c2\u6570\u6307\u5b9aIP\uff09\u8bbf\u95ee\u6bcf\u4e2a\u8282\u70b9\u7684\u5206\u7247\u6570\u636e\uff0c\u5728V953\u7248\u672c\u91cc\uff0c\u5f15\u5165\u4e86segment_id\u529f\u80fd\uff0c\u53ef\u4ee5\u76f4\u63a5\u8bbf\u95ee\u5bf9\u5e94\u7684\u8282\u70b9\u5206\u7247\uff0c\u7b80\u5316\u4e86\u64cd\u4f5c\u3002 <\/p>\n\n\n\n<p>\u5f53\u7136\uff0c\u5982\u679c\u8be5\u529f\u80fd\u53ea\u7528\u4e8e\u65b9\u4f4d\u5f53\u524d\u670d\u52a1\u4e2d\u7684\u5206\u7247\uff0c\u5982\u4e3a\u4e86\u67e5\u8be2\u5907\u4efd\u5206\u7247\uff0c\u8fd8\u662f\u9700\u8981\u7528\u547d\u4ee4\u884c\u5de5\u5177\u6307\u5b9aIP\u8fdb\u884c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8F%82%E6%95%B0\"><\/span>\u53c2\u6570<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%95%B0%E6%8D%AE%E5%BA%93%E5%8F%82%E6%95%B0\"><\/span>\u6570\u636e\u5e93\u53c2\u6570<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>gcluster_segment_id_replace<\/p>\n\n\n\n<p>0\uff1a\u4e0d\u542f\u7528segment_id\u529f\u80fd\uff0c\u9ed8\u8ba4\u503c<\/p>\n\n\n\n<p>1\uff1a\u5f00\u542fsegnemtn_id\u529f\u80fd<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"SQL%E8%AF%AD%E6%B3%95\"><\/span>SQL\u8bed\u6cd5<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>where segment_id=\u5206\u7247\u53f7<\/code><\/pre>\n\n\n\n<p>\u5176\u4e2d\u5206\u7247\u53f7\uff0c\u4ece1\u5f00\u59cb\uff0c\u8be6\u7ec6\u53ef\u4ee5\u770bgcadmin showdistribution\u7684\u8f93\u51fa<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;gbase@gbase_rh7_003 ~]$ gcadmin showdistribution\n\n                                 Distribution ID: 2 | State: new | Total segment num: 4\n\n             Primary Segment Node IP                   Segment ID                 Duplicate Segment node IP\n========================================================================================================================\n|                   10.0.2.103                   |         1          |                   10.0.2.104                   |\n------------------------------------------------------------------------------------------------------------------------\n|                   10.0.2.104                   |         2          |                   10.0.2.105                   |\n------------------------------------------------------------------------------------------------------------------------\n|                   10.0.2.105                   |         3          |                   10.0.2.106                   |\n------------------------------------------------------------------------------------------------------------------------\n|                   10.0.2.106                   |         4          |                   10.0.2.103                   |\n========================================================================================================================\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%A0%B7%E4%BE%8B\"><\/span>\u6837\u4f8b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 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><\/h3>\n\n\n\n<p>4\u5206\u7247\u96c6\u7fa4\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;gbase@gbase_rh7_003 ~]$ gcadmin\nCLUSTER STATE:         ACTIVE\nVIRTUAL CLUSTER MODE:  NORMAL\n\n====================================\n| GBASE GCWARE CLUSTER INFORMATION |\n====================================\n| NodeName |  IpAddress   | gcware |\n------------------------------------\n| gcware1  |  10.0.2.103  |  OPEN  |\n------------------------------------\n====================================================\n|      GBASE COORDINATOR CLUSTER INFORMATION       |\n====================================================\n|   NodeName   | IpAddress  | gcluster | DataState |\n----------------------------------------------------\n| coordinator1 | 10.0.2.103 |   OPEN   |     0     |\n----------------------------------------------------\n=========================================================================================================\n|                                    GBASE DATA CLUSTER INFORMATION                                     |\n=========================================================================================================\n| NodeName |                IpAddress                 | DistributionId | gnode | syncserver | DataState |\n---------------------------------------------------------------------------------------------------------\n|  node1   |                10.0.2.103                |       2        | OPEN  |    OPEN    |     0     |\n---------------------------------------------------------------------------------------------------------\n|  node2   |                10.0.2.104                |       2        | OPEN  |    OPEN    |     0     |\n---------------------------------------------------------------------------------------------------------\n|  node3   |                10.0.2.105                |       2        | OPEN  |    OPEN    |     0     |\n---------------------------------------------------------------------------------------------------------\n|  node4   |                10.0.2.106                |       2        | OPEN  |    OPEN    |     0     |\n---------------------------------------------------------------------------------------------------------\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E8%AE%BE%E7%BD%AE%E5%8F%82%E6%95%B0\"><\/span>\u8bbe\u7f6e\u53c2\u6570<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u672c\u4f8b\u8bbe\u7f6esession\u7ea7\u522b\uff0c\u53ea\u5bf9\u5f53\u524d\u8fde\u63a5\u6709\u6548\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; show variables like '%seg%';\n+-------------------------------------------------+------------+\n| Variable_name                                   | Value      |\n+-------------------------------------------------+------------+\n| _gbase_segment_size                             | 2147483648 |\n| _t_gcluster_single_segment_cluster_optimization | 0          |\n| gcluster_segment_id_replace                     | 0          |\n+-------------------------------------------------+------------+\n3 rows in set (Elapsed: 00:00:00.00)\n\ngbase&gt; set gcluster_segment_id_replace=1;\nQuery OK, 0 rows affected (Elapsed: 00:00:00.00)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%95%B0%E6%8D%AE\"><\/span>\u6570\u636e<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>16\u884c\u6570\u636e\u7684hash\u5206\u5e03\u8868<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select count(*) from t1;\n+----------+\n| count(*) |\n+----------+\n|       16 |\n+----------+\n1 row in set (Elapsed: 00:00:00.08)\n\ngbase&gt; show create table t1;\n+-------+----------------------------------------------------------------------------------------------------------------------------------------+\n| Table | Create Table                                                                                                                           |\n+-------+----------------------------------------------------------------------------------------------------------------------------------------+\n| t1    | CREATE TABLE \"t1\" (\n  \"id\" int(11) DEFAULT NULL\n) ENGINE=EXPRESS DISTRIBUTED BY('id') DEFAULT CHARSET=utf8 TABLESPACE='sys_tablespace' |\n+-------+----------------------------------------------------------------------------------------------------------------------------------------+\n1 row in set (Elapsed: 00:00:00.00)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9F%A5%E8%AF%A2%E5%88%86%E7%89%87\"><\/span>\u67e5\u8be2\u5206\u7247<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u901a\u8fc7segment_id\u57284\u4e2a\u5206\u7247\u91cc\u67e5\u8be2\u3002\u6ce8\u610f\u5206\u7247\u53f7\u4e0d\u8fdb\u884c\u6821\u9a8c\uff0c\u5982\u4e0d\u5b58\u5728\u5219\u8fd4\u56de\u7a7a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select * from t1 where segment_id=1;\n+------+\n| id   |\n+------+\n|    4 |\n|    7 |\n|    6 |\n|   12 |\n|   10 |\n|   16 |\n|   11 |\n+------+\n7 rows in set (Elapsed: 00:00:00.01)\n\ngbase&gt; select * from t1 where segment_id=2;\n+------+\n| id   |\n+------+\n|    8 |\n+------+\n1 row in set (Elapsed: 00:00:00.01)\n\ngbase&gt; select * from t1 where segment_id=3;\n+------+\n| id   |\n+------+\n|    1 |\n|    9 |\n|   13 |\n+------+\n3 rows in set (Elapsed: 00:00:00.01)\n\ngbase&gt; select * from t1 where segment_id=4;\n+------+\n| id   |\n+------+\n|    2 |\n|   15 |\n|    3 |\n|    5 |\n|   14 |\n+------+\n5 rows in set (Elapsed: 00:00:00.01)\n\ngbase&gt; select * from t1 where segment_id=5;\nEmpty set (Elapsed: 00:00:00.01)\n\ngbase&gt; select * from t1 where segment_id=6;\nEmpty set (Elapsed: 00:00:00.01)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%9C%A8%E6%9F%A5%E8%AF%A2%E7%BB%93%E6%9E%9C%E9%87%8C%E5%8C%85%E5%90%AB%E5%88%86%E7%89%87\"><\/span>\u5728\u67e5\u8be2\u7ed3\u679c\u91cc\u5305\u542b\u5206\u7247<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u5728select \u91cc\u5305\u542b\u5206\u7247\u53f7\uff0c\u6bd4\u5982<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select segment_id,t1.* from t1;\n+------------+------+\n| segment_id | id   |\n+------------+------+\n|          1 |    4 |\n|          1 |    7 |\n|          1 |    6 |\n|          1 |   12 |\n|          1 |   10 |\n|          1 |   16 |\n|          1 |   11 |\n|          4 |    2 |\n|          4 |   15 |\n|          4 |    3 |\n|          4 |    5 |\n|          4 |   14 |\n|          3 |    1 |\n|          3 |    9 |\n|          3 |   13 |\n|          2 |    8 |\n+------------+------+\n16 rows in set (Elapsed: 00:00:00.02)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%A4%9A%E8%A1%A8%E6%97%B6%EF%BC%8C%E6%8C%87%E5%AE%9A%E8%A1%A8%E5%90%8D%E5%AD%97\"><\/span>\u591a\u8868\u65f6\uff0c\u6307\u5b9a\u8868\u540d\u5b57<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select segment_id(t1),segment_id(t2),t1.* from t1,t2 where t1.id=t2.id;\n+------------+------------+------+\n| segment_id | segment_id | id   |\n+------------+------------+------+\n|          1 |          1 |    4 |\n|          4 |          1 |    2 |\n|          4 |          1 |    3 |\n|          3 |          1 |    1 |\n+------------+------------+------+\n4 rows in set (Elapsed: 00:00:00.06)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%BB%9F%E8%AE%A1%E5%90%84%E4%B8%AA%E5%88%86%E7%89%87%E7%9A%84%E6%95%B0%E6%8D%AE%E9%87%8F\"><\/span>\u7edf\u8ba1\u5404\u4e2a\u5206\u7247\u7684\u6570\u636e\u91cf<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u6ce8\u610f\uff0c\u6b64\u5904\u8fd4\u56de\u7684\u662f\u6b63\u5e38\u5206\u7247\u7684\u6570\u636e\uff0c\u7528\u4e8e\u6392\u67e5\u6570\u636e\u503e\u659c\u5f88\u6709\u7528\u5904\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select segment_id,count(*) from t1 group by segment_id;\n+------------+----------+\n| segment_id | count(*) |\n+------------+----------+\n|          4 |        5 |\n|          1 |        7 |\n|          2 |        1 |\n|          3 |        3 |\n+------------+----------+\n4 rows in set (Elapsed: 00:00:00.17)\n<\/code><\/pre>\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>\u5357\u5927\u901a\u7528GBase 8a \u6570\u636e\u5e93\u96c6\u7fa4\uff0c\u5c06\u6570\u636e\u6309\u7167\u7528\u6237\u6307\u5b9a\u7684\u5206\u5e03\u683c\u5f0f\u5207\u5206\uff0c\u4fdd\u5b58\u5728\u591a\u53f0\u6570\u636e\u8ba1\u7b97\u8282\u70b9\u4e0a\u3002\u672c\u6587\u4ecb\u7ecd\u5728\u65b0\u72489.5.3\u7248\u672c\u91cc\uff0c\u5982\u679c\u901a\u8fc7segment_id\u76f4\u63a5\u67e5\u8be2\u67d0\u4e9b\u8ba1\u7b97\u8282\u70b9\u7684\u6570\u636e\u3002<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6],"tags":[74,60],"class_list":{"0":"post-5190","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-gbase8a","8":"tag-74","9":"tag-v95"},"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/5190","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=5190"}],"version-history":[{"count":9,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/5190\/revisions"}],"predecessor-version":[{"id":5353,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/5190\/revisions\/5353"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=5190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=5190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=5190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}