ExplainAnalyzer

ExplainAnalyzer contains utility methods for getting and manipulating EXPLAIN data.  It also has methods to save and retrieve information, so it actually has state itself if used in this way -- it is not a data-less collection of methods.

Summary
ExplainAnalyzerExplainAnalyzer contains utility methods for getting and manipulating EXPLAIN data.
Functions
new
explain_query
normalize
get_alternate_indexes
get_index_usage
get_usage_for
save_usage_for
fingerprintCreate a fingerprint of EXPLAIN data from normalize().
sparklineCreate a sparkline of EXPLAIN data from normalize().
_d

Functions

new

sub new

explain_query

sub explain_query

normalize

sub normalize

get_alternate_indexes

sub get_alternate_indexes

get_index_usage

sub get_index_usage

get_usage_for

sub get_usage_for

save_usage_for

sub save_usage_for

fingerprint

sub fingerprint

Create a fingerprint of EXPLAIN data from normalize().

Parameters

%argsArguments

Required Arguments

explainHashref of normalized EXPLAIN data

Returns

Fingerprint/sparkline string

sparkline

sub sparkline

Create a sparkline of EXPLAIN data from normalize().  A spark line is a very compact, terse fingerprint that represents just the following.  See issue 1141.

access (for each table)

  • a: ALL
  • c: const
  • e: eq_ref
  • f: fulltext
  • i: index
  • m: index_merge
  • n: range
  • o: ref_or_null
  • r: ref
  • s: system
  • u: unique_subquery

Extra

  • uppsercaes access code: Using extra
  • T: Using temprary
  • F: Using filesort

Parameters

%argsArguments

Required Arguments

explainHashref of normalized EXPLAIN data

Returns

Sparkline string like (start code)TF>Ree(end code)

_d

sub _d
sub new
sub explain_query
sub normalize
sub get_alternate_indexes
sub get_index_usage
sub get_usage_for
sub save_usage_for
sub fingerprint
Create a fingerprint of EXPLAIN data from normalize().
sub sparkline
Create a sparkline of EXPLAIN data from normalize().
sub _d
Close