In a fresh commit, Rails edge now has the ability to automatically add query plan info to the standard Rails logger:
# Log the query plan for queries taking more than this (works # with SQLite, MySQL, and PostgreSQL) config.active_record.auto_explain_threshold_in_seconds = 0.5… which will yield something like:
+----+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+ | 1 | SIMPLE | users | const | PRIMARY | PRIMARY | 4 | const | 1 | | | 1 | SIMPLE | posts | ALL | NULL | NULL | NULL | NULL | 1 | Using where | +----+-------------+-------+-------+---------------+---------+---------+-------+------+-------------+ 2 rows in set (0.00 sec)Hot.
Benjamin Ste.in Pro
It's Business Time
Rails gets automatic EXPLAIN logging for slow SQL queries
-
multipleto89 liked this
-
repositoryyu8 liked this
-
emileeyou89 liked this
-
dominquezpop liked this
-
mildredbod8 liked this
-
carp89d liked this
-
getupdatenews liked this
-
dylanfm liked this
-
romainmuller liked this
-
romainmuller reblogged this from thechangelog
-
hrstr liked this
-
script-scrappy reblogged this from thechangelog
-
davidcooki liked this
-
cnicolaou liked this
-
cnicolaou reblogged this from thechangelog
-
david liked this
-
benjaminsteinpro reblogged this from thechangelog
-
luminae liked this
-
wevnote reblogged this from thechangelog
-
dhotson liked this
-
nepalonrails liked this
-
paul-yamamoto reblogged this from thechangelog
-
thechangelog posted this
