Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 718 Bytes

3.7_Utility_Statements.md

File metadata and controls

58 lines (42 loc) · 718 Bytes

3.7 Utility Statements

3.7.1 USE

USE db_name

例:

use TESTDB;

3.7.2 EXPLAIN

EXPLAIN explainable_stmt

 SELECT statement
| DELETE statement
| INSERT statement
| REPLACE statement
| UPDATE statement

注意事项:

  1. INSERT中表不能为自增序列表
    例:
explain SELECT select * from a_test where id=1;
  1. 在dble中,EXPLAIN 不等价于于DESC

3.7.3 EXPLAIN2

EXPLAIN2 shardingNode=node_name sql=sql_stmt

例:

explain2 shardingNode=dn2 sql=select * from a_test where id=1;

3.7.4 DESC

{DESCRIBE | DESC} tbl_name [col_name | wild]

例:

DESC a_test id;

注意: 在dble中,EXPLAIN 不等价于于DESC