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-24 23:37:06 +08:00
2023-07-05 15:16:04 +08:00
2023-07-18 09:17:14 +08:00
2023-06-21 16:25:07 +08:00
2023-05-15 15:13:16 +08:00
2023-05-29 15:38:31 +08:00
2023-08-29 18:27:19 +08:00
2023-07-28 17:28:52 +08:00
2023-07-28 17:28:52 +08:00
2023-08-15 15:30:48 +08:00
2023-08-25 11:21:35 +08:00
2023-08-23 14:21:22 +08:00
2023-08-29 13:26:25 +08:00
2023-04-07 17:04:08 +08:00
2023-07-10 17:57:21 +08:00
2023-06-01 13:09:58 +08:00
2023-08-16 12:18:05 +08:00
2023-08-04 12:49:53 +08:00
2023-05-29 15:38:31 +08:00
2023-08-29 19:36:19 +08:00
2023-07-01 12:29:22 +08:00
2023-08-29 16:18:11 +08:00
2023-08-26 12:59:05 +08:00
2023-06-13 14:31:24 +08:00
2023-07-18 09:17:14 +08:00
2023-05-14 20:01:30 +08:00
2023-08-25 16:47:14 +08:00
2023-08-05 12:52:53 +08:00
2023-08-23 20:10:53 +08:00
2023-08-31 07:44:18 +08:00
2023-08-25 11:40:30 +08:00
2023-08-25 11:40:30 +08:00
2023-05-29 15:38:31 +08:00
2023-08-30 19:02:48 +08:00
2023-03-30 14:42:34 +08:00
2023-08-07 20:03:03 +08:00
2023-02-19 15:11:54 +08:00
2023-03-21 23:22:17 +08:00
2023-08-30 21:00:12 +08:00
2023-04-07 14:23:16 +08:00
2023-04-03 09:49:07 +08:00
2023-06-01 13:09:58 +08:00
2023-08-30 17:09:06 +08:00
2023-08-31 15:51:32 +08:00
2023-08-04 13:12:21 +08:00
2023-08-23 11:23:00 +08:00
2023-08-31 15:51:32 +08:00
2023-08-23 20:10:53 +08:00
2023-08-31 15:51:32 +08:00
2023-08-31 15:51:32 +08:00
2023-07-28 10:12:35 +08:00
2023-07-29 00:31:01 +08:00
2023-06-08 10:55:22 +08:00
2023-08-31 21:22:26 +08:00
2023-07-11 14:27:03 +08:00
2023-03-20 13:10:12 +08:00
2023-05-17 21:26:31 +08:00
2023-08-26 17:52:10 +08:00
2023-04-11 11:09:43 +08:00
2023-06-21 18:36:46 +08:00
2023-04-26 15:34:46 +08:00
2023-04-07 14:23:16 +08:00
2023-02-17 18:48:27 +08:00
2023-05-26 16:05:38 +08:00
2023-05-29 15:38:31 +08:00
2023-05-24 20:17:28 +08:00
2023-08-23 20:10:53 +08:00
2023-08-23 20:10:53 +08:00
2023-08-25 09:15:27 +08:00
2023-08-25 09:15:27 +08:00
2023-05-10 15:06:23 +08:00
2023-08-23 20:10:53 +08:00
2023-08-23 20:10:53 +08:00
2023-06-06 11:05:56 +08:00
2023-06-06 11:05:56 +08:00
2023-06-06 11:05:56 +08:00
2023-08-25 09:15:27 +08:00
2023-08-23 20:10:53 +08:00
2023-05-29 15:38:31 +08:00
2023-08-24 10:57:40 +08:00
2023-06-21 18:36:46 +08:00
2023-08-13 10:32:21 +08:00
2023-03-23 17:59:49 +08:00
2023-06-21 18:36:46 +08:00
2023-08-29 18:30:16 +08:00
2023-04-07 14:23:16 +08:00