Skip to content

Commit 19d7797

Browse files
authored
Merge pull request #140 from topcoder-platform/develop
Further performance updates
2 parents 2933666 + 641df60 commit 19d7797

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/api/my-review/myReview.service.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ export class MyReviewService {
281281
cp_incomplete.name ASC
282282
LIMIT 1
283283
) AS "incompletePhaseName"
284-
) deliverable_reviews ON TRUE
284+
) deliverable_reviews ON r.id IS NOT NULL
285285
`,
286286
Prisma.sql`
287287
LEFT JOIN LATERAL (
@@ -301,7 +301,7 @@ export class MyReviewService {
301301
WHERE rv_pending."resourceId" = r.id
302302
AND apr.id IS NULL
303303
) AS "hasPendingAppealResponses"
304-
) pending_appeals ON TRUE
304+
) pending_appeals ON r.id IS NOT NULL
305305
`,
306306
Prisma.sql`
307307
LEFT JOIN LATERAL (
@@ -322,12 +322,11 @@ export class MyReviewService {
322322
Prisma.sql`
323323
LEFT JOIN LATERAL (
324324
SELECT
325-
EXISTS (
326-
SELECT 1
327-
FROM challenges."ChallengeReviewer" cr
328-
WHERE cr."challengeId" = c.id
329-
AND cr."aiWorkflowId" is not NULL
330-
) AS "hasAIReview"
325+
TRUE AS "hasAIReview"
326+
FROM challenges."ChallengeReviewer" cr
327+
WHERE cr."challengeId" = c.id
328+
AND cr."aiWorkflowId" IS NOT NULL
329+
LIMIT 1
331330
) cr ON TRUE
332331
`,
333332
];

0 commit comments

Comments
 (0)