MySQL 5.7 Added Sys.session table to view system running status

Source: Internet
Author: User

MySQL 5.7 Added Sys.session table to view system running status

Before MySQL 5.6, we looked at all the processes that were running on the system through the show Processlist\g command. Starting with 5.7, we can also view all the processes that the system is running through the Sys.session table, and the records in this table are processlist more complete:

Mysql> SELECT * from Sys.session\g

1. Row ***************************

Thd_id:29

Conn_id:4

User: [Email protected]

Db:test

Command:query

state:alter table (read PK and internal sort)

Time:6

Current_statement:alter TABLE b Add index (b)

statement_latency:5.78 s

progress:19.19

lock_latency:203.70 ms

rows_examined:0

rows_sent:0

rows_affected:0

tmp_tables:0

tmp_disk_tables:0

Full_scan:no

Last_statement:null

Last_statement_latency:null

current_memory:4.85 MiB

Last_wait:wait/io/file/innodb/innodb_data_file

Last_wait_latency:still Waiting

source:fil0fil.cc:5623

trx_latency:5.68 s

Trx_state:active

Trx_autocommit:yes

pid:23988

Program_name:mysql

2. Row ***************************

Thd_id:28

Conn_id:3

User: [Email protected]

Db:test

Command:query

State:sending data

time:0

Current_statement:insert to a SELECT null, repeat (' B ', 255) from a

statement_latency:303.54 ms

Progress:null

lock_latency:291.00 US

rows_examined:0

rows_sent:0

rows_affected:0

Tmp_tables:1

tmp_disk_tables:0

Full_scan:no

Last_statement:null

Last_statement_latency:null

current_memory:1.43 MiB

Last_wait:wait/io/table/sql/handler

Last_wait_latency:still Waiting

source:handler.cc:3056

Trx_latency: 410.06 ms

Trx_state:active

Trx_autocommit:yes

pid:23969

Program_name:mysql

3. Row ***************************

Thd_id:27

Conn_id:2

User: [Email protected]

Db:mysql

Command:query

State:sending data

time:0

Current_statement:select * from Sys.session

statement_latency:23.01 ms

Progress:null

lock_latency:10.02 ms

rows_examined:0

rows_sent:0

rows_affected:0

Tmp_tables:4

Tmp_disk_tables:1

Full_scan:yes

Last_statement:null

Last_statement_latency:null

current_memory:3.25 MiB

Last_wait:wait/synch/mutex/innodb/file_format_max_mutex

last_wait_latency:31.69 NS

source:trx0sys.cc:781

trx_latency:4.94 m

Trx_state:active

Trx_autocommit:no

pid:23950

Program_name:mysql

3 rows in Set (0.20 sec)


We can see from the output of line 1th that the ALTER TABLE command is currently running to add an index to a table and to read the current language

The execution phase of the sentence (currently reading PK and internal sorting), and can show the progress of the command completion (19%), also includes the current execution

Time (5.78s).

We can see from the output of line 2nd that we are currently performing an insert operation, which is an autocommit transaction that has already run

In 410.06 milliseconds, we can even read from it that a temporary table is required to execute the statement.

We can see from the output of line 3rd that from the execution of select * from Sys.session to now there is a transaction already held

Continued for 4.94 minutes.

From the above, we can get more information through the SELECT * from Sys.session. Try to be familiar with and accustomed to using

SELECT * FROM Sys.session!


More Wonderful free learning materials:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7F/73/wKiom1cfCSKiAVjSAAA5Qqq7ArI528.png "style=" float: none; "Title=" I win the workplace two-dimensional. png "alt=" Wkiom1cfcskiavjsaaa5qqq7ari528.png "/>

Also can add my QQ

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M01/7F/71/wKioL1cfCg3yghXVAACCBz5V3-g367.jpg "style=" float: none; "title=" Fawn teacher qr code. jpg "alt=" wkiol1cfcg3yghxvaaccbz5v3-g367.jpg "/>





This article is from the "11493456" blog, please be sure to keep this source http://11503456.blog.51cto.com/11493456/1767857

MySQL 5.7 Added Sys.session table to view system running status

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.