My rails app is set up using a mysql database.
When I do a simple find eg:
Pin.find(:all).size
will result in the following
Pin Load (130.1ms) SELECT `pins`.* FROM `pins`
EXPLAIN (0.6ms) EXPLAIN SELECT `pins`.* FROM `pins`
EXPLAIN for: SELECT `pins`.* FROM `pins`
+----+-------------+-------+------+---------------+------+---------+------+-------+-------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+------+---------+------+-------+-------+
| 1 | SIMPLE | pins | ALL | NULL | NULL | NULL | NULL | 33385 | |
+----+-------------+-------+------+---------------+------+---------+------+-------+-------+
1 row in set (0.00 sec)
=> 33385
How do I turn off the EXPLAIN SELECT so that:
Pin.find(:all).size
will return
Pin Load (1719.6ms) SELECT `pins`.* FROM `pins`
=> 43774
In environments/development set
and this will turn auto explain off.