optimize some quiz lti queries
optimize some quiz lti queries

fixes USERS-538

use a subquery instead of a join to force postgres to look at assignments on the course
_first_, instead of iterating all content_tags in the database. in an extreme case,
takes the query from 75s to 2.4ms

Change-Id: Ib317738a49b3ac4622249283fdc9d5674a2a539c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236030
Reviewed-by: Rob Orton <7e09c9d3e96378bf549fc283fd6e1e5b7014cc33@instructure.com>
QA-Review: Rob Orton <7e09c9d3e96378bf549fc283fd6e1e5b7014cc33@instructure.com>
Product-Review: Rob Orton <7e09c9d3e96378bf549fc283fd6e1e5b7014cc33@instructure.com>
Tested-by: Service Cloud Jenkins <9144042a601061f88f1e1d7a1753ea3e2972119d@instructure.com>

sfu/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,sfu/canvas-lms