refs #6720 patch activity query improvements to prod