Eager load site for filtered mappings
Eager load taggings => tags for mappings

* also rephrase the _tags partial so it uses the eager-loaded collection
  over tag_list, which doesn't participate in load caching
* this means that we don't query tags once per row in the index, instead
  just referring to things we pre-loaded in the filter
* Around 70-80% improvement in filtered mapping load speed
Switch Host#excluding_aka to an indexed column

* Was using unindexed with a LIKE
Optimise User#can_edit_site?

* It won't change within a request, so cache the result on first
  access.
Switch location of scope periods in filter
Cache the default host on first hit

* Avoids deeper SQL cache hit
Cache show_preview_links? result

* Avoids requerying @site.default_host.aka_host every row
  (would still hit SQL cache, but slower than cache)
* Also switch to shorter (no block) form of link_to
Eager load hosts for sites

* Get hosts data access out of the view
* Into a slightly-simplified SitesController with eager load for
  aka_hosts
Remove most_used_tags(_for_site)

* Get data access out of the helper
* Put it into Site#most_used_tags
* Optimise against our case rather than AATO's general case
  (AATO's case gives three subqueries, ours is simple JOINs)
Memoise User#can_edit_site? per-site

* Remove assumption that this is only used in context of web request
Codify our assumptions

* At present, one performance-related assumption that we're only
  tagging one type of thing
Merge pull request #301 from alphagov/eager-load-mapping-relations

Eager load mapping relations