标签:字符 pos 帮助 0.00 null 分区 int character src
INFORMATION_SCHEMA Name | Remarks |
SPECIFIC_CATALOG | def |
SPECIFIC_SCHEMA | routine database |
SPECIFIC_NAME | routine name |
ORDINAL_POSITION | 1, 2, 3, ... for parameters, 0 for function RETURNS clause |
PARAMETER_MODE | IN, OUT, INOUT (NULL for RETURNS) |
PARAMETER_NAME | parameter name (NULL for RETURNS) |
DATA_TYPE | same as for COLUMNS table |
CHARACTER_MAXIMUM_LENGTH | same as for COLUMNS table |
CHARACTER_OCTET_LENGTH | same as for COLUMNS table |
NUMERIC_PRECISION | same as for COLUMNS table |
NUMERIC_SCALE | same as for COLUMNS table |
DATETIME_PRECISION | same as for COLUMNS table |
CHARACTER_SET_NAME | same as for COLUMNS table |
COLLATION_NAME | same as for COLUMNS table |
DTD_IDENTIFIER | same as for COLUMNS table |
ROUTINE_TYPE | same as for ROUTINES table |
select distinct TABLE_NAME from information_schema.PARTITIONS where TABLE_SCHEMA=‘qiandai‘ and PARTITION_NAME is not null ;
查看每个分区表有多少个分区以及每个分区的行数:
select TABLE_SCHEMA, TABLE_NAME,PARTITION_NAME,TABLE_ROWS,PARTITION_EXPRESSION,PARTITION_METHOD,PARTITION_DESCRIPTION
from information_schema.PARTITIONS where TABLE_SCHEMA=‘qiandai‘ and TABLE_NAME=‘employees‘ ;
3:PLUGINS
INFORMATION_SCHEMA Name | SHOW Name |
QUERY_ID | Query_ID |
SEQ | |
STATE | Status |
DURATION | Duration |
CPU_USER | CPU_user |
CPU_SYSTEM | CPU_system |
CONTEXT_VOLUNTARY | Context_voluntary |
CONTEXT_INVOLUNTARY | Context_involuntary |
BLOCK_OPS_IN | Block_ops_in |
BLOCK_OPS_OUT | Block_ops_out |
MESSAGES_SENT | Messages_sent |
MESSAGES_RECEIVED | Messages_received |
PAGE_FAULTS_MAJOR | Page_faults_major |
PAGE_FAULTS_MINOR | Page_faults_minor |
SWAPS | Swaps |
SOURCE_FUNCTION | Source_function |
SOURCE_FILE | Source_file |
SOURCE_LINE | Source_line |
SET profiling = 1;
然后就可以看到这个会话记录的信息。
select * from qiandai.t1;
然后进行查询:
SHOW PROFILES;
就能够查看记录的信息了:
root@localhost [(none)]>SHOW PROFILES; +----------+------------+--------------------------+ | Query_ID | Duration | Query | +----------+------------+--------------------------+ | 1 | 0.00101925 | select * from qiandai.t1 | +----------+------------+--------------------------+ 1 row in set, 1 warning (0.00 sec)
能看到执行信息,还有使用的时间。
root@localhost [(none)]>SHOW PROFILE; +----------------------+----------+ | Status | Duration | +----------------------+----------+ | starting | 0.000219 | | checking permissions | 0.000035 | | checking permissions | 0.000016 | | Opening tables | 0.000047 | | init | 0.000101 | | System lock | 0.000040 | | optimizing | 0.000054 | | statistics | 0.000083 | | preparing | 0.000063 | | executing | 0.000019 | | Sending data | 0.000187 | | end | 0.000021 | | query end | 0.000023 | | closing tables | 0.000023 | | freeing items | 0.000040 | | cleaning up | 0.000051 | +----------------------+----------+ 16 rows in set, 1 warning (0.00 sec)
SHOW PROFILE可以深入的查看服务器执行语句的工作情况。以及也能帮助你理解执行语句消耗时间的情况。一些限制是它没有实现的功能,不能查看和剖析其他连接的语句,以及剖析时所引起的消耗。
(1)ALL 显示所有性能信息 (2)LOCK IO 显示块IO操作的次数 (3)CONTEXT SWITCHES 显示上下文切换次数,不管是主动还是被动 (4)CPU 显示用户CPU时间、系统CPU时间 (5)IPC 显示发送和接收的消息数量 (6)MEMORY [暂未实现] (7)PAGE FAULTS 显示页错误数量 (8)SOURCE 显示源码中的函数名称与位置 (9)SWAPS 显示SWAP的次数
6:REFERENTIAL_CONSTRAINTS
select * from information_schema.SCHEMA_PRIVILEGES ;
标签:字符 pos 帮助 0.00 null 分区 int character src
原文地址:http://www.cnblogs.com/shengdimaya/p/6891841.html