Conversation
Additional performance tweaks
| LIMIT 1 | ||
| ) AS "incompletePhaseName" | ||
| ) deliverable_reviews ON TRUE | ||
| ) deliverable_reviews ON r.id IS NOT NULL |
There was a problem hiding this comment.
[❗❗ correctness]
Changing the join condition from ON TRUE to ON r.id IS NOT NULL may alter the behavior of the query, especially if r.id can be NULL. Ensure that this change aligns with the intended logic and does not inadvertently exclude rows that should be included.
| 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.
[❗❗ correctness]
Similar to the previous change, updating the join condition from ON TRUE to ON r.id IS NOT NULL could impact the query results. Verify that this modification is intentional and that it correctly reflects the desired logic.
| WHERE cr."challengeId" = c.id | ||
| AND cr."aiWorkflowId" is not NULL | ||
| ) AS "hasAIReview" | ||
| TRUE AS "hasAIReview" |
There was a problem hiding this comment.
[❗❗ correctness]
Replacing the EXISTS check with TRUE AS "hasAIReview" changes the logic to always return TRUE, regardless of whether there is an AI review. This could lead to incorrect data representation. Confirm that this change is intended and that it does not misrepresent the presence of AI reviews.
No description provided.