-
Notifications
You must be signed in to change notification settings - Fork 9
Further performance updates #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -281,7 +281,7 @@ export class MyReviewService { | |
| cp_incomplete.name ASC | ||
| LIMIT 1 | ||
| ) AS "incompletePhaseName" | ||
| ) deliverable_reviews ON TRUE | ||
| ) deliverable_reviews ON r.id IS NOT NULL | ||
| `, | ||
| Prisma.sql` | ||
| LEFT JOIN LATERAL ( | ||
|
|
@@ -301,7 +301,7 @@ export class MyReviewService { | |
| WHERE rv_pending."resourceId" = r.id | ||
| AND apr.id IS NULL | ||
| ) AS "hasPendingAppealResponses" | ||
| ) pending_appeals ON TRUE | ||
| ) pending_appeals ON r.id IS NOT NULL | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [❗❗ |
||
| `, | ||
| Prisma.sql` | ||
| LEFT JOIN LATERAL ( | ||
|
|
@@ -322,12 +322,11 @@ export class MyReviewService { | |
| Prisma.sql` | ||
| LEFT JOIN LATERAL ( | ||
| SELECT | ||
| EXISTS ( | ||
| SELECT 1 | ||
| FROM challenges."ChallengeReviewer" cr | ||
| WHERE cr."challengeId" = c.id | ||
| AND cr."aiWorkflowId" is not NULL | ||
| ) AS "hasAIReview" | ||
| TRUE AS "hasAIReview" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [❗❗ |
||
| FROM challenges."ChallengeReviewer" cr | ||
| WHERE cr."challengeId" = c.id | ||
| AND cr."aiWorkflowId" IS NOT NULL | ||
| LIMIT 1 | ||
| ) cr ON TRUE | ||
| `, | ||
| ]; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗
correctness]Changing the join condition from
ON TRUEtoON r.id IS NOT NULLmay alter the behavior of the query, especially ifr.idcan beNULL. Ensure that this change aligns with the intended logic and does not inadvertently exclude rows that should be included.