daidai
e680d42fe7
[feature](information_schema)add metadata_name_ids for quickly get catlogs,db,table and add profiling table in order to Compatible with mysql (#22702)
add information_schema.metadata_name_idsfor quickly get catlogs,db,table.
1. table struct :
```mysql
mysql> desc internal.information_schema.metadata_name_ids;
+---------------+--------------+------+-------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------------+--------------+------+-------+---------+-------+
| CATALOG_ID | BIGINT | Yes | false | NULL | |
| CATALOG_NAME | VARCHAR(512) | Yes | false | NULL | |
| DATABASE_ID | BIGINT | Yes | false | NULL | |
| DATABASE_NAME | VARCHAR(64) | Yes | false | NULL | |
| TABLE_ID | BIGINT | Yes | false | NULL | |
| TABLE_NAME | VARCHAR(64) | Yes | false | NULL | |
+---------------+--------------+------+-------+---------+-------+
6 rows in set (0.00 sec)
mysql> select * from internal.information_schema.metadata_name_ids where CATALOG_NAME="hive1" limit 1 \G;
*************************** 1. row ***************************
CATALOG_ID: 113008
CATALOG_NAME: hive1
DATABASE_ID: 113042
DATABASE_NAME: ssb1_parquet
TABLE_ID: 114009
TABLE_NAME: dates
1 row in set (0.07 sec)
```
2. when you create / drop catalog , need not refresh catalog .
```mysql
mysql> select count(*) from internal.information_schema.metadata_name_ids\G;
*************************** 1. row ***************************
count(*): 21301
1 row in set (0.34 sec)
mysql> drop catalog hive2;
Query OK, 0 rows affected (0.01 sec)
mysql> select count(*) from internal.information_schema.metadata_name_ids\G;
*************************** 1. row ***************************
count(*): 10665
1 row in set (0.04 sec)
mysql> create catalog hive3 ...
mysql> select count(*) from internal.information_schema.metadata_name_ids\G;
*************************** 1. row ***************************
count(*): 21301
1 row in set (0.32 sec)
```
3. create / drop table , need not refresh catalog .
```mysql
mysql> CREATE TABLE IF NOT EXISTS demo.example_tbl ... ;
mysql> select count(*) from internal.information_schema.metadata_name_ids\G;
*************************** 1. row ***************************
count(*): 10666
1 row in set (0.04 sec)
mysql> drop table demo.example_tbl;
Query OK, 0 rows affected (0.01 sec)
mysql> select count(*) from internal.information_schema.metadata_name_ids\G;
*************************** 1. row ***************************
count(*): 10665
1 row in set (0.04 sec)
```
4. you can set query time , prevent queries from taking too long .
```
fe.conf : query_metadata_name_ids_timeout
the time used to obtain all tables in one database
```
5. add information_schema.profiling in order to Compatible with mysql
```mysql
mysql> select * from information_schema.profiling;
Empty set (0.07 sec)
mysql> set profiling=1;
Query OK, 0 rows affected (0.01 sec)
```
2023-08-31 21:22:26 +08:00
..
2023-08-28 14:22:19 +08:00
2023-07-27 09:57:31 +08:00
2023-04-07 13:09:44 +08:00
2022-08-17 22:45:53 +08:00
2022-08-17 22:45:53 +08:00
2023-07-31 17:20:23 +08:00
2023-04-03 22:32:43 +08:00
2022-12-16 17:08:29 +08:00
2023-08-17 09:17:09 +08:00
2023-06-14 17:34:34 +08:00
2022-11-22 21:35:18 +08:00
2023-03-22 11:24:45 +08:00
2023-07-22 10:41:55 +08:00
2023-02-24 15:27:34 +08:00
2023-06-14 17:34:34 +08:00
2023-06-14 17:34:34 +08:00
2023-06-06 14:35:16 +08:00
2023-03-10 11:52:22 +08:00
2023-08-12 19:41:55 +08:00
2023-06-14 17:34:34 +08:00
2023-08-31 19:26:47 +08:00
2023-06-01 13:09:58 +08:00
2023-03-23 16:11:04 +08:00
2023-08-31 21:22:26 +08:00
2023-06-14 17:34:34 +08:00
2023-06-01 13:09:58 +08:00
2023-06-14 17:34:34 +08:00
2022-09-23 09:10:33 +08:00
2022-08-17 22:45:53 +08:00
2023-06-14 17:34:34 +08:00
2023-03-25 21:48:13 +08:00
2023-04-29 21:28:41 +08:00
2022-11-22 21:35:18 +08:00
2022-08-17 22:45:53 +08:00
2022-08-17 22:45:53 +08:00