MysqlCasualExplain

Highlight problematic MySQL explain results.

Inspired by MySQLCasualLog.pm.

Build Status

Installation

Add this line to your application's Gemfile:

gem 'mysql_casual_explain'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install mysql_casual_explain

Usage

#!/usr/bin/env ruby
require 'active_record'
require 'mysql_casual_explain'

ActiveRecord::Base.establish_connection(
  adapter:  'mysql2',
  username: 'root',
  database: 'employees'
)

class Employee < ActiveRecord::Base; end

puts Employee.all.explain

Test

docker-compose build
docker-compose run client bundle exec appraisal ar60 rake