# SQL explain / describe > 可以用來分析 sql statement # 比較重要的 columns https://mariadb.com/kb/en/explain/#columns-in-explain-select | Column 名稱 | 用途 | | -------- | -------- | | type | 有多少資料被撈出來 (join type) | | possible_keys | 可能被用到的 key | | key | 實際用到的 key | | Extra | 額外資訊 | # type https://mariadb.com/kb/en/explain/#type-column - ALL => full table scan 非常不好 - index => full scan 比 ALL 好但還是差 [有列出 type 最優到最差](https://mgleon08.github.io/blog/2017/09/01/mysql-sql-optimization-with-explain/) 最優到最差 - System - const - eq_ref - ref - fulltext - ref_or_null - index_merge - unique_subquery - index_subquery - range - index - ALL # extra https://mariadb.com/kb/en/explain/#extra-column # examples https://mariadb.com/kb/en/explain/#extra-column # 參考資料 - https://mariadb.com/kb/en/explain/#syntax - https://mgleon08.github.io/blog/2017/09/01/mysql-sql-optimization-with-explain/ ###### tags: `2022` `草稿` `sql` `perfromance` `mariadb` `索引` `index` {%hackmd BJrTq20hE %}
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up