Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 136321c

Browse files
committed
made active_members_count more efficient
1 parent d9664fa commit 136321c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

queries/tc_direct_facts

+2-4
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,15 @@ WHERE ce.contest_id = p.project_id)
3131
AND r.round_type_id in (13,15,19,22,24,25)
3232
) AS active_contests_count,
3333

34-
(select count (unique u.user_id)
34+
(select count (unique rur.user_id)
3535
from resource rur
3636
, resource_info ri
3737
, project p
3838
, user u
39-
where 1 = 1
40-
and p.project_id = rur.project_id
39+
where p.project_id = rur.project_id
4140
and rur.resource_id = ri.resource_id
4241
and rur.resource_role_id = 1
4342
and ri.resource_info_type_id = 1
44-
and ri.value = u.user_id
4543
and p.project_status_id = 1) AS active_members_count,
4644

4745
(SELECT COUNT(*)

0 commit comments

Comments
 (0)