- MariaDB High Performance
- Pierre MAVRO
- 176字
- 2021-08-05 18:03:18
The show explain command
The show explain
feature is only available in MariaDB 10. It allows you to get an explanation directly from a running process, for example, if you use the loop.sql
script once again. At the time of insertion, execute a show processlist
command:
MariaDB [chapter2]> SHOW PROCESSLIST\G; [...] *************************** 2. row *************************** Id: 81 User: root Host: localhost db: chapter2 Command: Query Time: 0 State: query end Info: INSERT INTO `s_explain`(`id`, `ts`) VALUES (FLOOR(RAND() * @MAX_INSERT), NOW()) Progress: 0.000 2 rows in set (0.00 sec)
We can see here the 81
ID, which is the INSERT
command in the loop.sql
script. We're going to analyze it with the show explain
command:
MariaDB [chapter2]> SHOW EXPLAIN FOR 81\G; *************************** 1. row *************************** id: 1 select_type: INSERT table: s_explain type: ALL possible_keys: NULL key: NULL key_len: NULL ref: NULL rows: NULL Extra: 1 row in set, 1 warning (0.01 sec)
This could be very interesting on a really long slow query, without having to wait till the end of it to perform an explain analysis.
推薦閱讀
- Python概率統(tǒng)計(jì)
- C# 2012程序設(shè)計(jì)實(shí)踐教程 (清華電腦學(xué)堂)
- Raspberry Pi Networking Cookbook(Second Edition)
- Python網(wǎng)絡(luò)爬蟲(chóng)從入門(mén)到實(shí)踐(第2版)
- Git高手之路
- Object-Oriented JavaScript(Second Edition)
- Practical Game Design
- 網(wǎng)站構(gòu)建技術(shù)
- Getting Started with Hazelcast(Second Edition)
- Access 2010數(shù)據(jù)庫(kù)應(yīng)用技術(shù)實(shí)驗(yàn)指導(dǎo)與習(xí)題選解(第2版)
- Fastdata Processing with Spark
- 遠(yuǎn)方:兩位持續(xù)創(chuàng)業(yè)者的點(diǎn)滴思考
- Isomorphic Go
- HTML5 Canvas核心技術(shù):圖形、動(dòng)畫(huà)與游戲開(kāi)發(fā)
- Unity與C++網(wǎng)絡(luò)游戲開(kāi)發(fā)實(shí)戰(zhàn):基于VR、AI與分布式架構(gòu)