Skip to content

Conversation

@jmgasper
Copy link
Contributor

No description provided.

@jmgasper jmgasper merged commit 27916f3 into master Nov 11, 2025
5 of 6 checks passed
FROM challenges."Challenge" c
JOIN bill b
ON b.challenge_id = c.id
JOIN LATERAL (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ performance]
The use of JOIN LATERAL with ON TRUE is correct here, but ensure that the performance impact is acceptable. LATERAL joins can be more expensive than regular joins, especially if the subquery is complex or returns a large number of rows. Consider testing the query performance if this section is a bottleneck.

AND cb."billingAccountId" = '80000062'
) ba ON TRUE
WHERE c."createdAt" >= now() - interval '4 months'
AND ba.billing_account_id IS NOT NULL

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[💡 maintainability]
The condition AND ba.billing_account_id IS NOT NULL is redundant since the subquery already filters for billingAccountId = '80000062'. This condition can be removed to simplify the query.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants