Modify forum roles query for Aurora performance.

This is a fix for the performance issues in EDUCATOR-3374

AWS's Aurora backend for MySQL selects the wrong index on the
django_comment_client_role_users table, leading to performance issues.
This commit replaces that join with individual requests for permissions
for each role (of which there may be several for any given user).
It's dumber SQL, but Aurora will do the right thing.
This commit is contained in:
David Ormsbee
2018-08-31 15:07:16 -04:00
parent b024159147
commit ebbd262710
2 changed files with 13 additions and 9 deletions

View File

@@ -406,7 +406,7 @@ class TestXBlockQueryLoad(SharedModuleStoreTestCase):
# * django_comment_client_role
# * django_comment_client_permission
# * lms_xblock_xblockasidesconfig
num_queries = 3
num_queries = 2
for discussion in discussions:
discussion_xblock = get_module_for_descriptor_internal(
user=user,