Skip to content

Instantly share code, notes, and snippets.

@AlphaWong
Last active July 26, 2017 09:26
Show Gist options
  • Save AlphaWong/dcd83b6691ca12665eb95edfda82cfb4 to your computer and use it in GitHub Desktop.
Save AlphaWong/dcd83b6691ca12665eb95edfda82cfb4 to your computer and use it in GitHub Desktop.
sql leaning 2

Sql

explain select * from vanrating_latest_backup where rating=3 or rating=4;

Result

+------+-------------+-------------------------+------+---------------+------+---------+------+------+-------------+
| id   | select_type | table                   | type | possible_keys | key  | key_len | ref  | rows | Extra       |
+------+-------------+-------------------------+------+---------------+------+---------+------+------+-------------+
|    1 | SIMPLE      | vanrating_latest_backup | ALL  | NULL          | NULL | NULL    | NULL |   12 | Using where |
+------+-------------+-------------------------+------+---------------+------+---------+------+------+-------------+

Importance

type

  1. Ref (Best)
  2. ALL (Worst)

possible_keys

That the keys will be consider as index of mysql engine

key

Key for indexing

Rows

How many row has been read

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment