Skip to content
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

[Issue #1835] Remove distinct from inner query of search #1836

Merged
merged 2 commits into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def search_opportunities(
a set of opportunity IDs for the outer query to filter against. This query
ends up looking like (varying based on exact filters):

SELECT DISTINCT
SELECT
opportunity.opportunity_id
FROM opportunity
JOIN current_opportunity_summary ON opportunity.opportunity_id = current_opportunity_summary.opportunity_id
Expand All @@ -220,9 +220,6 @@ def search_opportunities(
) # Only ever return non-drafts
# Filter anything without a current opportunity summary
.where(Opportunity.current_opportunity_summary != None) # noqa: E711
# Distinct the opportunity IDs returned so that the outer query
# has fewer results to query against
.distinct()
)

# Current + Opportunity Summary are always needed so just add them here
Expand Down
Loading