perf: speed up learning_outcome presence db check
perf: speed up learning_outcome presence db check

test plan:
* load a course home page on a empty redis cache
* in the tabs_available code it will issue a db query to see if there
  are any learning outcomes for that course
* the log for that query should look something like:
Redis (0.283ms) get has_outcomes/courses/1-...
  SQL LearningOutcome Exists (0.9ms)  SELECT DISTINCT 1 AS one FROM
  "learning_outcomes" INNER JOIN "content_tags" ON
  "learning_outcomes"."id" = "content_tags"."content_id" WHERE
  "content_tags"."context_id" = 1 AND "content_tags"."context_type" =
  'Course' AND (content_tags.tag_type='learning_outcome_association'
  AND content_tags.workflow_state<>'deleted') AND
  "content_tags"."content_type" = 'LearningOutcome' LIMIT 1

* instead of:
Redis (0.267ms) get shard_7549:has_outcomes/courses/1-...
SQL  (4.5ms)  SELECT COUNT(DISTINCT "learning_outcomes"."id") FROM
"learning_outcomes" INNER JOIN "content_tags" ON
"learning_outcomes"."id" = "content_tags"."content_id" WHERE
"content_tags"."context_id" = 1 AND "content_tags"."context_type" =
'Course' AND (content_tags.tag_type='learning_outcome_association' AND
content_tags.workflow_state<>'deleted') AND
"content_tags"."content_type" = 'LearningOutcome'

* and the query should be faster since it has a limit 1 and it only
  needs to find one row instead of exhaustively looking for all rows
  for that course

Change-Id: If2366e423c2e64c13db444ea25295e6c4339e234
Reviewed-on: https://gerrit.instructure.com/210809
Tested-by: Jenkins
Reviewed-by: James Williams <3a5f4ed991dbfa5c9ef76ad729d240ca12f62180@instructure.com>
QA-Review: James Williams <3a5f4ed991dbfa5c9ef76ad729d240ca12f62180@instructure.com>
Product-Review: James Williams <3a5f4ed991dbfa5c9ef76ad729d240ca12f62180@instructure.com>

sfu/canvas-lms,sfu/canvas-lms,djbender/canvas-lms,djbender/canvas-lms,instructure/canvas-lms,sfu/canvas-lms,instructure/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,instructure/canvas-lms,djbender/canvas-lms,sfu/canvas-lms,instructure/canvas-lms,instructure/canvas-lms,instructure/canvas-lms,sfu/canvas-lms,instructure/canvas-lms,djbender/canvas-lms