PROD-9: Fix badly performing database query for bulk email by using the union() function to combine multiple querysets together, rather than the or (|) operator.  This avoids a very inefficient OUTER JOIN query that reads the entire user table.
PROD-9: Fix badly performing database query for bulk email by using
the union() function to combine multiple querysets together, rather
than the or (|) operator.  This avoids a very inefficient OUTER
JOIN query that reads the entire user table.

edx-solutions/edx-platform,stvstnfrd/edx-platform,angelapper/edx-platform,stvstnfrd/edx-platform,appsembler/edx-platform,edx-solutions/edx-platform,appsembler/edx-platform,ESOedX/edx-platform,mitocw/edx-platform,eduNEXT/edx-platform,mitocw/edx-platform,jolyonb/edx-platform,jolyonb/edx-platform,arbrandes/edx-platform,cpennington/edx-platform,jolyonb/edx-platform,jolyonb/edx-platform,ESOedX/edx-platform,EDUlib/edx-platform,edx-solutions/edx-platform,EDUlib/edx-platform,msegado/edx-platform,edx/edx-platform,angelapper/edx-platform,mitocw/edx-platform,appsembler/edx-platform,cpennington/edx-platform,ESOedX/edx-platform,edx/edx-platform,EDUlib/edx-platform,angelapper/edx-platform,arbrandes/edx-platform,appsembler/edx-platform,msegado/edx-platform,eduNEXT/edunext-platform,eduNEXT/edx-platform,msegado/edx-platform,edx/edx-platform,edx-solutions/edx-platform,EDUlib/edx-platform,eduNEXT/edunext-platform,cpennington/edx-platform,eduNEXT/edunext-platform,stvstnfrd/edx-platform,angelapper/edx-platform,cpennington/edx-platform,arbrandes/edx-platform,msegado/edx-platform,eduNEXT/edunext-platform,mitocw/edx-platform,arbrandes/edx-platform,stvstnfrd/edx-platform,eduNEXT/edx-platform,msegado/edx-platform,edx/edx-platform,ESOedX/edx-platform,eduNEXT/edx-platform