- 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.
推薦閱讀
- Visual C++程序設計學習筆記
- 云計算通俗講義(第3版)
- Mastering Ext JS
- Node Cookbook(Second Edition)
- 匯編語言編程基礎:基于LoongArch
- jQuery技術內(nèi)幕:深入解析jQuery架構設計與實現(xiàn)原理
- 實戰(zhàn)Python網(wǎng)絡爬蟲
- 算法超簡單:趣味游戲帶你輕松入門與實踐
- Python數(shù)據(jù)可視化之matplotlib實踐
- 少年小魚的魔法之旅:神奇的Python
- A/B 測試:創(chuàng)新始于試驗
- Comprehensive Ruby Programming
- Expert Angular
- 米思齊實戰(zhàn)手冊:Arduino圖形化編程指南
- 3D Printing Designs:Fun and Functional Projects