feat(issues): Skip Snuba for issue.id-only searches#111740
Closed
feat(issues): Skip Snuba for issue.id-only searches#111740
Conversation
When the search query is exclusively an issue.id filter (e.g. issue.id:[1,2,3]), short-circuit the full Snuba/ClickHouse search pipeline and resolve groups directly from Postgres. This avoids multi-category ClickHouse queries, hit count sampling, and the chunked search loop for a simple ID lookup. The optimization detects issue.id filters via a cheap substring check before invoking the query parser, adding zero overhead to requests that don't contain issue.id. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use explicit isinstance checks instead of to_list to satisfy mypy's type narrowing for SearchValue.raw_value.
ac232b1 to
af968b8
Compare
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
I think its more clear to search on
issue.id:[1, 2, 3]than remember that?group=1&group=2&group=3exists, pipe them through the same shortcut.Skip the full Snuba/ClickHouse search pipeline when the issue search query is exclusively an
issue.idfilter, resolving groups directly from Postgres instead. This eliminates multi-category ClickHouse queries, hit count sampling, and the chunked search loop — replacing it all with a single PostgresWHERE id IN (...).Frontend call sites that benefit:
groupRelatedIssues/index.tsx) — fetches same-root-cause and same-trace issues by IDsupergroups/supergroupDrawer.tsx) — displays issues within a supergroupdashboards/issueFieldRenderers.tsx) — links from dashboard widgets to specific issues