Conversation
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
1 similar comment
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
| ORDER BY | ||
| msa."activityCount" ${direction} NULLS LAST | ||
| LIMIT ${prefetchLimit} | ||
| ), |
There was a problem hiding this comment.
Prefetch excludes filtered members with low activity counts
The top_msa CTE prefetches members by activity count without applying any filters, then top_members applies filters to this subset. If a user searches or filters for members who have low activity counts, those members won't be in the prefetched set and will be incorrectly excluded from results. The previous logic applied filters before limiting, ensuring all matching members were considered. This can cause queries to return incomplete or missing results when filter criteria don't correlate with activity count.
Note
Performance-focused query refactor with safer joins and better prefiltering.
displayNamefilter uselower(m."displayName")for case-insensitive matchingbuildActivityCountOptimizedQuery:top_msaprefetches by activity,top_membersapplies filters/joinsprefetchLimit,totalNeeded)member_searchandmemberSegmentsAggjoins only when needed for filteringmsain the outer SELECT only if requested byfields; orders bytm."activityCount"Written by Cursor Bugbot for commit a31edb5. This will update automatically on new commits. Configure here.