File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
services/libs/data-access-layer/src/members Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -197,13 +197,15 @@ const hasNonIdMemberFieldReferences = (filterString: string): boolean => {
197197const canUseActivityCountOptimization = ( {
198198 filterHasMe,
199199 filterHasMo,
200+ includeMemberOrgs,
200201 sortField,
201202 withAggregates,
202203} : {
203204 filterHasMe : boolean
204205 filterHasMo : boolean
205206 sortField : string | undefined
206207 withAggregates : boolean
208+ includeMemberOrgs : boolean
207209} ) : boolean => {
208210 // Need aggregates to access activityCount
209211 if ( ! withAggregates ) return false
@@ -214,6 +216,8 @@ const canUseActivityCountOptimization = ({
214216 // Cannot use if filter requires expensive joins (me.*, mo.*)
215217 if ( filterHasMe || filterHasMo ) return false
216218
219+ if ( includeMemberOrgs ) return false
220+
217221 return true
218222}
219223
@@ -406,6 +410,7 @@ export const buildQuery = ({
406410 const useActivityCountOptimized = canUseActivityCountOptimization ( {
407411 filterHasMe,
408412 filterHasMo,
413+ includeMemberOrgs,
409414 sortField,
410415 withAggregates,
411416 } )
You can’t perform that action at this time.
0 commit comments