{"id":114,"date":"2020-06-09T10:42:24","date_gmt":"2020-06-09T02:42:24","guid":{"rendered":"http:\/\/www.gbase8.cn\/?p=114"},"modified":"2020-09-08T11:28:43","modified_gmt":"2020-09-08T03:28:43","slug":"gbase8a-%e9%9b%86%e7%be%a4%e6%9f%a5%e7%9c%8b%e8%a1%a8%e7%b4%a2%e5%bc%95","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/114","title":{"rendered":"\u5357\u5927\u901a\u7528GBase8a \u96c6\u7fa4\u67e5\u770b\u8868\u7d22\u5f15"},"content":{"rendered":"<p>GBase 8a\u6570\u636e\u5e93\u96c6\u7fa4\uff0c\u5f53\u524d\u7248\u672c\u76ee\u524d\u53ea\u652f\u6301\u4e00\u79cdhash\u7d22\u5f15\uff0c\u540c\u65f6\u63d0\u4f9b\u4e86\u5143\u6570\u636e\u8868 information_schema. statistics \u67e5\u770b\u7d22\u5f15\u60c5\u51b5\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"1606\" height=\"488\" src=\"http:\/\/www.gbase8.cn\/wp-content\/uploads\/2020\/06\/image-43.png\" alt=\"\" class=\"wp-image-115\"\/><\/figure>\n\n\n\n<p>gbase> select * from information_schema.statistics where table_schema='testdb'; \u5176\u4e2dGLOBAL HASH\u662fhash\u7d22\u5f15\uff0cGROUPED\u662f\u884c\u5b58\u5217\u7d22\u5f15\uff0c\u5176\u4e3a\u4e00\u4e2a\u6570\u636e\u7ed3\u6784\uff0c\u5185\u90e8\u4f7f\u7528\uff0c\u4e0d\u7b97\u6807\u51c6\u7d22\u5f15\u7c7b\u578b\u3002<\/p>\n\n\n\n<p>\u6837\u4f8b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase> show create table t1;\n+-------+---------------------------------------------------------------------------------------------------------------------------------------------------+\n| Table | Create Table                                                                                                                                      |\n+-------+---------------------------------------------------------------------------------------------------------------------------------------------------+\n| t1    | CREATE TABLE \"t1\" (\n  \"id\" int(11) DEFAULT NULL,\n  \"value\" int(11) DEFAULT NULL\n) ENGINE=EXPRESS DEFAULT CHARSET=utf8 TABLESPACE='sys_tablespace' |\n+-------+---------------------------------------------------------------------------------------------------------------------------------------------------+\n1 row in set (Elapsed: 00:00:00.00)\n\ngbase> create index idx_id on testdb.t1(id) key_block_size=4096 using hash global;\nQuery OK, 0 rows affected (Elapsed: 00:00:01.62)\nRecords: 0  Duplicates: 0  Warnings: 0\n\ngbase> show create table t1;\n+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| Table | Create Table                                                                                                                                                                                                   |\n+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| t1    | CREATE TABLE \"t1\" (\n  \"id\" int(11) DEFAULT NULL,\n  \"value\" int(11) DEFAULT NULL,\n  KEY \"idx_id\" (\"id\") KEY_BLOCK_SIZE=4096 USING HASH GLOBAL\n) ENGINE=EXPRESS DEFAULT CHARSET=utf8 TABLESPACE='sys_tablespace' |\n+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n1 row in set (Elapsed: 00:00:00.00)\n\ngbase> select * from information_schema.statistics where table_schema='testdb';\n+---------------+--------------+------------+------------+--------------+------------+--------------+-------------+-----------+-------------+----------+--------+----------+-------------+---------+\n| TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | NON_UNIQUE | INDEX_SCHEMA | INDEX_NAME | SEQ_IN_INDEX | COLUMN_NAME | COLLATION | CARDINALITY | SUB_PART | PACKED | NULLABLE | INDEX_TYPE  | COMMENT |\n+---------------+--------------+------------+------------+--------------+------------+--------------+-------------+-----------+-------------+----------+--------+----------+-------------+---------+\n| NULL          | testdb       | t1         |          1 | testdb       | idx_id     |            1 | id          | NULL      |        NULL |     NULL | NULL   | YES      | GLOBAL HASH |         |\n+---------------+--------------+------------+------------+--------------+------------+--------------+-------------+-----------+-------------+----------+--------+----------+-------------+---------+\n1 row in set (Elapsed: 00:00:00.00)\n\ngbase> select * from information_schema.statistics where table_schema='testdb'\\G;\n*************************** 1. row ***************************\nTABLE_CATALOG: NULL\n TABLE_SCHEMA: testdb\n   TABLE_NAME: t1\n   NON_UNIQUE: 1\n INDEX_SCHEMA: testdb\n   INDEX_NAME: idx_id\n SEQ_IN_INDEX: 1\n  COLUMN_NAME: id\n    COLLATION: NULL\n  CARDINALITY: NULL\n     SUB_PART: NULL\n       PACKED: NULL\n     NULLABLE: YES\n   INDEX_TYPE: GLOBAL HASH\n      COMMENT:\n1 row in set (Elapsed: 00:00:00.00)\n\nERROR:\nNo query specified\n\n<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>\u5176\u5b83\u5143\u6570\u636e\u4fe1\u606f\u8bf7\u53c2\u8003<\/p>\n\n\n\n<p><a href=\"http:\/\/www.gbase8.cn\/en\/?tag=%e5%85%83%e6%95%b0%e6%8d%ae\">http:\/\/www.gbase8.cn\/?tag=%e5%85%83%e6%95%b0%e6%8d%ae<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>\u5357\u5927\u901a\u7528GBase 8a\u6570\u636e\u5e93\u96c6\u7fa4\uff0c\u5f53\u524d\u7248\u672c\u76ee\u524d\u53ea\u652f\u6301\u4e00\u79cdhash\u7d22\u5f15\uff0c\u540c\u65f6\u63d0\u4f9b\u4e86\u5143\u6570\u636e\u8868 information_schema. statistics \u67e5\u770b\u7d22\u5f15\u60c5\u51b5\u3002<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[69],"class_list":["post-114","post","type-post","status-publish","format-standard","hentry","category-gbase8a","tag-69"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/114","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=114"}],"version-history":[{"count":2,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/114\/revisions"}],"predecessor-version":[{"id":1071,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/114\/revisions\/1071"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}