add caching around primary_keys db query
add caching around primary_keys db query

Change-Id: I04de69d1e8c0c13e4e3e110b603bdeb2ee975baa
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/229017
Tested-by: Service Cloud Jenkins <9144042a601061f88f1e1d7a1753ea3e2972119d@instructure.com>
Reviewed-by: Cody Cutrer <c4fe2b1d90ef8f2548c8aeabfa633434316f0305@instructure.com>
QA-Review: Cody Cutrer <c4fe2b1d90ef8f2548c8aeabfa633434316f0305@instructure.com>
Product-Review: Cody Cutrer <c4fe2b1d90ef8f2548c8aeabfa633434316f0305@instructure.com>

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