Skip to content

Instantly share code, notes, and snippets.

@juslintek
Created September 16, 2017 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juslintek/85913ff3fc55d8da3cfb750c17913ca3 to your computer and use it in GitHub Desktop.
Save juslintek/85913ff3fc55d8da3cfb750c17913ca3 to your computer and use it in GitHub Desktop.
Explain of WP_Queries
mysql> EXPLAIN SELECT COUNT( 1 ) FROM sjwd_posts WHERE post_type = 'page' AND post_status NOT IN ( 'trash','auto-draft','inherit' ) AND post_author = 1;
+----+-------------+------------+------------+-------+------------------------------+------------------+---------+------+------+----------+------------------------------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+------------+------------+-------+------------------------------+------------------+---------+------+------+----------+------------------------------------+
| 1 | SIMPLE | sjwd_posts | NULL | range | type_status_date,post_author | type_status_date | 164 | NULL | 24 | 36.87 | Using index condition; Using where |
+----+-------------+------------+------------+-------+------------------------------+------------------+---------+------+------+----------+------------------------------------+
1 row in set, 1 warning (0.00 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment