diff options
author | Arthur Nogueira Neves <arthurnn@gmail.com> | 2014-05-24 18:28:38 -0400 |
---|---|---|
committer | Arthur Nogueira Neves <arthurnn@gmail.com> | 2014-05-24 18:28:38 -0400 |
commit | 0bd909abea076ee63a93ca1833f712c215e29915 (patch) | |
tree | ce776967226b44ed53b0d9f258392c1e76f32ab8 | |
parent | a9ced732ad66cba3f37101c77d0475febe8b5926 (diff) | |
parent | 5ec797e2ca802ef04226b373d11c256d7f30e132 (diff) | |
download | rails-0bd909abea076ee63a93ca1833f712c215e29915.tar.gz rails-0bd909abea076ee63a93ca1833f712c215e29915.tar.bz2 rails-0bd909abea076ee63a93ca1833f712c215e29915.zip |
Merge pull request #15303 from JohnKellyFerguson/guides-ar-querying
Improve readability of Explain Queries table in guides
-rw-r--r-- | guides/CHANGELOG.md | 5 | ||||
-rw-r--r-- | guides/source/active_record_querying.md | 52 |
2 files changed, 41 insertions, 16 deletions
diff --git a/guides/CHANGELOG.md b/guides/CHANGELOG.md index 0b52db5670..e692708076 100644 --- a/guides/CHANGELOG.md +++ b/guides/CHANGELOG.md @@ -1,3 +1,8 @@ +* Split up rows in the Explain Queries table of the ActiveRecord Querying section +in order to improve readability. + + * John Kelly Ferguson * + * Change all non-HTTP method 'post' references to 'article'. *John Kelly Ferguson* diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md index 697ddd70cb..ee8cf4ade6 100644 --- a/guides/source/active_record_querying.md +++ b/guides/source/active_record_querying.md @@ -1703,12 +1703,19 @@ may yield ``` EXPLAIN for: SELECT `users`.* FROM `users` INNER JOIN `articles` ON `articles`.`user_id` = `users`.`id` WHERE `users`.`id` = 1 -+----+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+ -| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | -+----+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+ -| 1 | SIMPLE | users | const | PRIMARY | PRIMARY | 4 | const | 1 | | -| 1 | SIMPLE | articles | ALL | NULL | NULL | NULL | NULL | 1 | Using where | -+----+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+ ++----+-------------+----------+-------+---------------+ +| id | select_type | table | type | possible_keys | ++----+-------------+----------+-------+---------------+ +| 1 | SIMPLE | users | const | PRIMARY | +| 1 | SIMPLE | articles | ALL | NULL | ++----+-------------+----------+-------+---------------+ ++---------+---------+-------+------+-------------+ +| key | key_len | ref | rows | Extra | ++---------+---------+-------+------+-------------+ +| PRIMARY | 4 | const | 1 | | +| NULL | NULL | NULL | 1 | Using where | ++---------+---------+-------+------+-------------+ + 2 rows in set (0.00 sec) ``` @@ -1742,19 +1749,32 @@ yields ``` EXPLAIN for: SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 -+----+-------------+-------+-------+---------------+---------+---------+-------+------+-------+ -| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | -+----+-------------+-------+-------+---------------+---------+---------+-------+------+-------+ -| 1 | SIMPLE | users | const | PRIMARY | PRIMARY | 4 | const | 1 | | -+----+-------------+-------+-------+---------------+---------+---------+-------+------+-------+ ++----+-------------+-------+-------+---------------+ +| id | select_type | table | type | possible_keys | ++----+-------------+-------+-------+---------------+ +| 1 | SIMPLE | users | const | PRIMARY | ++----+-------------+-------+-------+---------------+ ++---------+---------+-------+------+-------+ +| key | key_len | ref | rows | Extra | ++---------+---------+-------+------+-------+ +| PRIMARY | 4 | const | 1 | | ++---------+---------+-------+------+-------+ + 1 row in set (0.00 sec) EXPLAIN for: SELECT `articles`.* FROM `articles` WHERE `articles`.`user_id` IN (1) -+----+-------------+-------+------+---------------+------+---------+------+------+-------------+ -| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | -+----+-------------+-------+------+---------------+------+---------+------+------+-------------+ -| 1 | SIMPLE | articles | ALL | NULL | NULL | NULL | NULL | 1 | Using where | -+----+-------------+-------+------+---------------+------+---------+------+------+-------------+ ++----+-------------+----------+------+---------------+ +| id | select_type | table | type | possible_keys | ++----+-------------+----------+------+---------------+ +| 1 | SIMPLE | articles | ALL | NULL | ++----+-------------+----------+------+---------------+ ++------+---------+------+------+-------------+ +| key | key_len | ref | rows | Extra | ++------+---------+------+------+-------------+ +| NULL | NULL | NULL | 1 | Using where | ++------+---------+------+------+-------------+ + + 1 row in set (0.00 sec) ``` |