- 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.
推薦閱讀
- Objective-C Memory Management Essentials
- Android Jetpack開(kāi)發(fā):原理解析與應(yīng)用實(shí)戰(zhàn)
- Rake Task Management Essentials
- Mastering Spring MVC 4
- x86匯編語(yǔ)言:從實(shí)模式到保護(hù)模式(第2版)
- Python高級(jí)機(jī)器學(xué)習(xí)
- MariaDB High Performance
- QTP自動(dòng)化測(cè)試進(jìn)階
- 表哥的Access入門(mén):以Excel視角快速學(xué)習(xí)數(shù)據(jù)庫(kù)開(kāi)發(fā)(第2版)
- The Complete Coding Interview Guide in Java
- 學(xué)習(xí)正則表達(dá)式
- Vue.js光速入門(mén)及企業(yè)項(xiàng)目開(kāi)發(fā)實(shí)戰(zhàn)
- Mastering VMware Horizon 7(Second Edition)
- Functional Python Programming
- Python Linux系統(tǒng)管理與自動(dòng)化運(yùn)維