A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

MySQL explain plan cheat sheet

Explanation of explain output:

  • select_type: SIMPLE/SUBQUERY/UNION/DERIVED
  • partitions: NULL ??
  • type: (from worst to the best): ALL, index, range, ref, eq_ref, const, system
  • possible_keys: food,bar,baz,id (good)
  • key: foo(good)
  • key_len: 334 ??
  • ref: const,const,const ??
  • rows: 1 (lower is better. must be less than total rows)
  • filtered: 100.00 (lower is better, but only used if there's a join)
  • Extra: NULL
Bad extra values:
  • using where
  • using temporary
  • using filesort
Good extra values:
  • using index