Commit 3fde1ea
perf(issues): Avoid slow double-join in source-map-debug-blue-thunder-edition (#112627)
The `has_uploaded_some_artifact_with_a_debug_id` existence check joins
DebugIdArtifactBundle -> ArtifactBundle -> ProjectArtifactBundle with
only org_id + project_id filters. For large orgs this scans millions of
rows in DebugIdArtifactBundle.
Replace the double join with a correlated `EXISTS` subquery so Postgres
can use the `(project_id, artifact_bundle)` composite index on
ProjectArtifactBundle directly.
Skip the query entirely when the event's own debug IDs already matched
uploaded artifacts.
fixes
[SENTRY-2JS6](https://sentry.sentry.io/issues/4945181039/events/064fada92c3d47e2876e955f14f1a1b5/?project=1&referrer=previous-event&statsPeriod=14d)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 889b54d commit 3fde1ea
File tree
1 file changed
+19
-5
lines changed- src/sentry/api/endpoints
1 file changed
+19
-5
lines changedLines changed: 19 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
179 | 181 | | |
180 | 182 | | |
181 | 183 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | 184 | | |
188 | 185 | | |
189 | 186 | | |
| |||
212 | 209 | | |
213 | 210 | | |
214 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
215 | 229 | | |
216 | 230 | | |
217 | 231 | | |
| |||
0 commit comments