@@ -2610,13 +2610,13 @@ Running EXPLAIN
2610
2610
2611
2611
You can run [ ` explain ` ] [ ] on a relation. EXPLAIN output varies for each database.
2612
2612
2613
- For example, running
2613
+ For example, running:
2614
2614
2615
2615
``` ruby
2616
2616
Customer .where(id: 1 ).joins(:orders ).explain
2617
2617
```
2618
2618
2619
- may yield
2619
+ may yield this for MySQL and MariaDB:
2620
2620
2621
2621
``` sql
2622
2622
EXPLAIN SELECT ` customers` .* FROM ` customers` INNER JOIN ` orders` ON ` orders` .` customer_id` = ` customers` .` id` WHERE ` customers` .` id` = 1
@@ -2636,11 +2636,9 @@ EXPLAIN SELECT `customers`.* FROM `customers` INNER JOIN `orders` ON `orders`.`c
2636
2636
2 rows in set (0 .00 sec)
2637
2637
```
2638
2638
2639
- under MySQL and MariaDB.
2640
-
2641
2639
Active Record performs a pretty printing that emulates that of the
2642
2640
corresponding database shell. So, the same query running with the
2643
- PostgreSQL adapter would yield instead
2641
+ PostgreSQL adapter would yield instead:
2644
2642
2645
2643
``` sql
2646
2644
EXPLAIN SELECT " customers" .* FROM " customers" INNER JOIN " orders" ON " orders" ." customer_id" = " customers" ." id" WHERE " customers" ." id" = $1 [[" id" , 1 ]]
@@ -2658,7 +2656,7 @@ EXPLAIN SELECT "customers".* FROM "customers" INNER JOIN "orders" ON "orders"."c
2658
2656
2659
2657
Eager loading may trigger more than one query under the hood, and some queries
2660
2658
may need the results of previous ones. Because of that, ` explain ` actually
2661
- executes the query, and then asks for the query plans. For example,
2659
+ executes the query, and then asks for the query plans. For example, running:
2662
2660
2663
2661
``` ruby
2664
2662
Customer .where(id: 1 ).includes(:orders ).explain
0 commit comments