暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

GBase8a mpp如何查看表的tableid

VV_刺头王 2022-05-25
556

可以通过以下三种方式查看表的tableid,具体如下:

1、通过show full create table 查看,TID即为该表的tableid

gbase> show full create table t1;

+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

| Table | Create Table                                                                                                                                                                                                                    |

+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

| t1    | CREATE TABLE "t1" (

  "a" int(11) DEFAULT NULL,

  "b" varchar(40) DEFAULT NULL,

  "c" date DEFAULT NULL

) ENGINE=EXPRESS DISTRIBUTED BY('a') TID(5) UID(1) DEFAULT CHARSET=utf8 TABLESPACE='sys_tablespace' COLUMN_IDS(0, 1, 2) |

+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

1 row in set (Elapsed: 00:00:00.00)

2、通过information_schema.tables查看对应表的table_id

gbase> select table_name,table_id from information_schema.tables where table_name='t1';

+------------+----------+

| table_name | table_id |

+------------+----------+

| t1         |        5 |

+------------+----------+

1 row in set (Elapsed: 00:00:00.00)

3、通过metadump查看:

元数据合并前版本查看方式metadump table.desc.A/B, 元数据合并后的版本查看方式metadumptable.info.A/B,其中的t_num就是tableid

元数据合并前版本:

[gbase@localhost t1.GED]$ metadump table.des.B

This tool is designed for use at GBase internally,and is unsupported externally.

GBase makes no claims and holds no liability regarding the external use of this tool.

This tool is copyrighted and his redistribution is restricted.

table.des.B

+----------------------+-----------------+

| storage_version      | GEHV6           |

| encrypt              | 0               |

| shrinked_rowid       | 0               |

| no_attr              | 1               |

| attr_nums[0]         | 0               |

| no_attr_cnt          | 1               |

| no_attr[0]           | 1               |

| t_name               | t1              |

| t_desc::false        |                 |

| offset               | 46              |

| length               | 10              |

| block type           | 1               |

| next                 | 0               |

| t_num                | 2053            |

| limit_storage_size   | 0               |

| storage_size         | 0               |

| scn                  | 131083          |

| compress_flag_num    | 4294967295      |

| compress_flag_str    | 4294967295      |

| extend_size          | 0               |

| autoextend_flag      | 0               |

| tab_data_size        | 0               |

| durability           | 0               |

+----------------------+-----------------+

元数据合并后版本:

[gbase@node34 t1.GED]$ metadump table.info.B

This tool is designed for use at GBase internally,and is unsupported externally.

GBase makes no claims and holds no liability regarding the external use of this tool.

This tool is copyrighted and his redistribution is restricted.

table.info.B

----------------------------state------------------------

+-------------------------------------+-----------------+

| version                             | 8               |

| checksum                            | 3585941699      |

| table_last_operation                | DDL             |

| ctl_version                         | B               |

| map_version                         | A               |

| delete_version                      | B               |

+-------------------------------------+-----------------+

----------------------------des--------------------------

+----------------------+-----------------+

| storage_version      | GEHV8           |

| checksum             | 2647270172      |

| t_num                | 5               |

| tablespace_id        | 0               |

| no_attr              | 3               |

| no_attr_cnt          | 3               |

| encrypt              | 0               |

| compress_flag_num    | 4294967295      |

| compress_flag_str    | 4294967295      |

| limit_storage_size   | 0               |

| autoextend_flag      | 0               |

| extend_size          | 0               |

| shrinked_rowid       | 0               |

| tab_data_size        | 0               |

| storage_size         | 0               |

| scn                  | 9               |

+----------------------+-----------------+

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论