# What counts as an N+1 query?

> The same query shape run 5 or more times on one connection within 1 second, with differing values.

Source: https://sqleye.com/docs/faq/what-counts-as-an-n-plus-one-query/ · Last updated: 2026-11-29 · Publisher: CodeROG (https://coderog.com)

By default SQLEye flags an N+1 when the same query shape runs at least 5 times on the same connection within 1,000 ms, with differing literal values. A loop that fires one SELECT per row is the classic case. The thresholds are settings, so you can change both the repeat count and the time window.

Repeating the identical statement with identical values is not flagged. Transaction and session statements such as BEGIN, COMMIT, SET and SHOW are never counted. Statements with unbound placeholders such as $1 or ? count as differing. A gap longer than the window ends a run.

When SQLEye detects a group, the Live screen collapses it into one expandable row showing the repeat count. Read [N+1 detection](/docs/live-eye/n-plus-one/) for the rule in full, and the glossary entry on the [N+1 query](/docs/glossary/n-plus-one-query/) for background.
