hubgeter opened a new pull request, #22702:
URL: https://github.com/apache/doris/pull/22702

   ## Proposed changes
    
   add information_schema.simple_tables for quickly get catlogs,db,table.
   
   1. table  struct :   
   ```mysql
   mysql> desc  internal.information_schema.simple_tables;
   +---------------+--------------+------+-------+---------+-------+
   | 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.simple_tables 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.simple_tables\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.simple_tables\G; 
   *************************** 1. row ***************************
   count(*): 10665
   1 row in set (0.04 sec) 
   
   
   mysql> create catalog hive3 ... 
   mysql> select count(*) from internal.information_schema.simple_tables\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.simple_tables\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.simple_tables\G; 
   *************************** 1. row ***************************
   count(*): 10665
   1 row in set (0.04 sec) 
   
   ```
   
   4. you can set query time , prevent queries from taking too long . 
   ```mysql
   set query_simple_tables_timeout=4;
   
   ```
   
   <!--Describe your changes.-->
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[d...@doris.apache.org](mailto:d...@doris.apache.org) by explaining why you 
chose the solution you did and what alternatives you considered, etc...
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to