Conversation
| -- filter by challenge status | ||
| AND ($3::text[] IS NULL OR c.status::text = ANY($3::text[])) | ||
| -- exclude task challenge types from this report | ||
| AND LOWER(ct.name) NOT IN ('task', 'topgear task') |
There was a problem hiding this comment.
[performance]
The use of LOWER(ct.name) NOT IN ('task', 'topgear task') could potentially lead to performance issues if the name column is not indexed or if there are a large number of rows. Consider ensuring that there is an index on LOWER(ct.name) to optimize this filter.
| ), | ||
| registrants AS ( | ||
| -- keep one submitter resource row per challenge/member | ||
| SELECT DISTINCT ON (fc.id, res."memberId") |
There was a problem hiding this comment.
[correctness]
Using SELECT DISTINCT ON with multiple columns can lead to non-deterministic results if the ordering is not clear or if there are ties. Ensure that the ORDER BY clause is correctly defined to handle ties deterministically.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.