Source
APM, tracing & profiling — found from sitemap — Sentry
Checked for Sentry on 6 Nov 2026
- Page
- https://docs.sentry.io/product/issues/issue-details/performance-issues/n-one-queries/
- Checked
- 6 Nov 2026, 04:36 UTC
- How we may use it
- Public page, crawling permitted
Technical details
- type
- page
- http status
- 200
- content hash
- sha256:2267fe7216d234b96d556e6d851c22b64d9581166683f7c4f28c0a27cd07cf70
- permission
- robots_ok
- screenshot
- Screenshot on file (internal exhibit, not published)
Cited by
Facts read from this source
-
N1 queries definition Report an error
“N+1 Queries are a performance problem in which the application makes database queries in a loop, instead of making a single query that returns or modifies all the information at once.”
-
N1 queries filter Report an error
“Filter database query performance issues with issue.category:db_query in Issues and Dashboards.”
-
N1 queries detection criteria Report an error
“The N+1 Query detector looks for a set of sequential, non-overlapping database spans with similar descriptions. It also uses the following criteria: Total duration of involved spans must exceed 50ms Total count of involved spans must exceed a threshold (usually five spans) Involved spans must have full queries as their descriptions (some SDKs truncate queries and add an ellipsis to the end) There must be at least one database span that precedes the repeating spans (this is called the "source" span, and is used for fingerprinting)”
-
N1 queries configurable thresholds Report an error
“You can configure detector thresholds for N+1 Queries issues in Project Settings > Performance:”
-
N1 queries evidence Report an error
“The evidence for an N+1 Queries problem has four main aspects: Transaction name Parent span - This can be a view, a serializer, or another span that logically groups the queries. Preceding span - The last span recorded before the N+1 query spans. Repeating span - This is the "N" of N+1 queries. This is the looped query that should have been part of a bulk query. Waterfall trace view - Shows the relevant sequential, non-overlapping database spans.”
-
N1 queries fingerprinting Report an error
“Sentry computes the issue fingerprint based on the parent span, the source span, and the repeating spans. If you're finding that Sentry is failing to correctly group N+1 query issues, make sure that the database spans in your transactions have parameterized queries as the span description.”
-
N1 queries orm context Report an error
“This problem often occurs when you use an object-relational mapping (ORM) tool in web frameworks like Django or Ruby on Rails.”
Scores citing this record
- The Agency Tech Lead APM, tracing & profiling
- The Data Protection Officer APM, tracing & profiling
- The Mobile Team Lead APM, tracing & profiling
- The SaaS CTO APM, tracing & profiling
- The Skeptic APM, tracing & profiling
- The Site Reliability Engineer APM, tracing & profiling