Module: WtActiverecordIndexSpy::QueryAnalyser::Mysql

Extended by:
Mysql
Included in:
Mysql
Defined in:
lib/wt_activerecord_index_spy/query_analyser/mysql.rb

Overview

It analyses the result of an EXPLAIN query to see if any index is missing.

Constant Summary collapse

ALLOWED_EXTRA_VALUES =
[
  # https://bugs.mysql.com/bug.php?id=64197
  "Impossible WHERE noticed after reading const tables",
  "no matching row",
].freeze

Instance Method Summary collapse

Instance Method Details

#analyse(results) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/wt_activerecord_index_spy/query_analyser/mysql.rb', line 16

def analyse(results)
  results.find do |result|
    certainity_level = analyse_explain(result)

    break certainity_level if certainity_level
  end
end