MySQL Forums
Forum List  »  NDB clusters

Re: help translating ndb table IDs to schema and table
Posted by: Frazer Clement
Date: April 09, 2021 11:38AM

The ndb_show_tables tool, or the ndbinfo.dict_obj_info table can be used to map table ids to names.

https://dev.mysql.com/doc/refman/8.0/en/mysql-cluster-programs-ndb-show-tables.html
https://dev.mysql.com/doc/refman/8.0/en/mysql-cluster-ndbinfo-dict-obj-info.html

The dict_obj_info table uses 'fully qualified' names, of the form <database/schema/table> - usually schema is 'def'.


You can join other ndbinfo tables with the ndbinfo.dict_obj_info table to see table names instead of ids.

> ndb_show_tables
id type state logging database schema name
5 IndexTrigger Online - NDB$INDEX_19_CUSTOM
8 UserTable Online Yes mysql def NDB$BLOB_7_3
17 UserTable Online Yes accounts def balances
5 UserTable Online Yes mysql def ndb_index_stat_sample
1 IndexTrigger Online - NDB$INDEX_12_CUSTOM
3 IndexTrigger Online - NDB$INDEX_16_CUSTOM
3 SystemTable Online Yes sys def NDB$EVENTS_0
10 UserTable Online Yes mysql def ndb_apply_status
4 UserTable Online Yes mysql def ndb_index_stat_head
14 OrderedIndex Online No sys def PRIMARY
6 OrderedIndex Online No sys def ndb_index_stat_sample_x1
13 UserTable Online Yes accounts def debits
18 OrderedIndex Online No sys def PRIMARY
15 UserTable Online Yes accounts def credits
20 UniqueHashIndex Online Yes sys def b$unique
19 OrderedIndex Online No sys def b
2 IndexTrigger Online - NDB$INDEX_14_CUSTOM
4 IndexTrigger Online - NDB$INDEX_18_CUSTOM
12 OrderedIndex Online No sys def PRIMARY
6 HashIndexTrigger Online - NDB$INDEX_20_UI
1 HashMap Online - DEFAULT-HASHMAP-3840-8
9 UserTable Online Yes mysql def ndb_schema_result
2 SystemTable Online Yes sys def SYSTAB_0
11 UserTable Online Yes mysql def ndb_sql_metadata
0 IndexTrigger Online - NDB$INDEX_6_CUSTOM
16 OrderedIndex Online No sys def PRIMARY
7 UserTable Online Yes mysql def ndb_schema
1 TableEvent Online - ndb_index_stat_head_event
5 TableEvent Online - REPL$mysql/ndb_apply_status
7 TableEvent Online - REPL$accounts/credits
2 TableEvent Online - REPL$mysql/ndb_schema
3 TableEvent Online - NDB$BLOBEVENT_REPL$mysql/ndb_schema_3
4 TableEvent Online - REPL$mysql/ndb_schema_result
8 TableEvent Online - REPL$accounts/balances
6 TableEvent Online - REPL$accounts/debits




mysql> select ti.table_id, doi.fq_name, ti.logged_table, ti.row_contains_gci, ti.row_contains_checksum, ti.read_backup, ti.fully_replicated, ti.storage_type, ti.hashmap_id, ti.partition_balance, ti.create_gci from ndbinfo.table_info ti join ndbinfo.dict_obj_info doi on ti.table_id = doi.id where doi.type in (1,2,3,6);
+----------+---------------------------------+--------------+------------------+-----------------------+-------------+------------------+--------------+------------+-------------------+------------+
| table_id | fq_name | logged_table | row_contains_gci | row_contains_checksum | read_backup | fully_replicated | storage_type | hashmap_id | partition_balance | create_gci |
+----------+---------------------------------+--------------+------------------+-----------------------+-------------+------------------+--------------+------------+-------------------+------------+
| 8 | mysql/def/NDB$BLOB_7_3 | 1 | 1 | 1 | 0 | 0 | MEMORY | 1 | FOR_RP_BY_LDM | 0 |
| 17 | accounts/def/balances | 1 | 1 | 1 | 1 | 0 | MEMORY | 1 | FOR_RP_BY_LDM | 0 |
| 5 | mysql/def/ndb_index_stat_sample | 1 | 1 | 1 | 0 | 0 | MEMORY | 1 | FOR_RP_BY_LDM | 0 |
| 3 | sys/def/NDB$EVENTS_0 | 1 | 1 | 1 | 0 | 0 | MEMORY | 1 | FOR_RP_BY_LDM | 0 |
| 10 | mysql/def/ndb_apply_status | 1 | 1 | 1 | 0 | 0 | MEMORY | 1 | FOR_RP_BY_LDM | 0 |
| 4 | mysql/def/ndb_index_stat_head | 1 | 1 | 1 | 0 | 0 | MEMORY | 1 | FOR_RP_BY_LDM | 0 |
| 13 | accounts/def/debits | 1 | 1 | 1 | 1 | 0 | MEMORY | 1 | FOR_RP_BY_LDM | 0 |
| 15 | accounts/def/credits | 1 | 1 | 1 | 1 | 0 | MEMORY | 1 | FOR_RP_BY_LDM | 0 |
| 20 | sys/def/17/b$unique | 1 | 1 | 1 | 1 | 0 | MEMORY | 1 | FOR_RP_BY_LDM | 0 |
| 9 | mysql/def/ndb_schema_result | 1 | 1 | 1 | 0 | 0 | MEMORY | 1 | FOR_RP_BY_LDM | 0 |
| 2 | sys/def/SYSTAB_0 | 1 | 1 | 1 | 0 | 0 | MEMORY | 1 | FOR_RP_BY_LDM | 0 |
| 11 | mysql/def/ndb_sql_metadata | 1 | 1 | 1 | 0 | 0 | MEMORY | 1 | FOR_RP_BY_LDM | 0 |
| 7 | mysql/def/ndb_schema | 1 | 1 | 1 | 0 | 0 | MEMORY | 1 | FOR_RP_BY_LDM | 0 |
+----------+---------------------------------+--------------+------------------+-----------------------+-------------+------------------+--------------+------------+-------------------+------------+
13 rows in set (0.10 sec)

mysql>

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: help translating ndb table IDs to schema and table
216
April 09, 2021 11:38AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.