美文网首页
MySql SQL 优化

MySql SQL 优化

作者: E码 | 来源:发表于2016-10-19 18:44 被阅读0次

    MySql SQL 优化

    通过 show [session|global]status 命令来查看服务器状态信息。

    session     -- 显示 session(当期连接) 级统计结果
    global      -- 显示 global(全局) 级统计结果
    

    下面的命令显示了当前 session 中所有统计参数的值:

    mysql> show global status like 'Com_%';
    +-----------------------------+---------+
    | Variable_name               | Value   |
    +-----------------------------+---------+
    | Com_admin_commands          | 14140   |
    | Com_alter_db                | 1       |
    | Com_alter_table             | 109     |
    | Com_change_db               | 1321    |
    | Com_commit                  | 401428  |
    | Com_create_db               | 2       |
    | Com_create_table            | 95      |
    | Com_delete                  | 751     |
    | Com_drop_table              | 100     |
    | Com_empty_query             | 2       |
    | Com_insert                  | 282107  |
    | Com_rollback                | 18      |
    | Com_select                  | 4173959 |
    | Com_set_option              | 3134324 |
    | Com_show_charsets           | 109     |
    | Com_show_collations         | 120     |
    | Com_show_create_db          | 7       |
    | Com_show_create_func        | 462     |
    | Com_show_create_proc        | 572     |
    | Com_show_create_table       | 17721   |
    | Com_show_databases          | 384     |
    | Com_show_fields             | 2747    |
    | Com_show_function_status    | 109     |
    | Com_show_grants             | 1       |
    | Com_show_keys               | 1814    |
    | Com_show_procedure_status   | 109     |
    | Com_show_processlist        | 58      |
    | Com_show_status             | 297     |
    | Com_show_storage_engines    | 125     |
    | Com_show_table_status       | 2342    |
    | Com_show_tables             | 1705    |
    | Com_show_triggers           | 423     |
    | Com_show_variables          | 407     |
    | Com_show_warnings           | 2196    |
    | Com_stmt_execute            | 56      |
    | Com_stmt_close              | 56      |
    | Com_stmt_fetch              | 0       |
    | Com_stmt_prepare            | 56      |
    | Com_truncate                | 4       |
    | Com_update                  | 300711  |
    +-----------------------------+---------+
    147 行于数据集 (0.04 秒)
    

    相关文章

      网友评论

          本文标题:MySql SQL 优化

          本文链接:https://www.haomeiwen.com/subject/zfixuttx.html