Repository navigation
v0.3.0
Detector v2: n1scan proves which query a loop iterates over, and uses that
proof to stop guessing.
Added
- Lineage: n1scan hashes the first rows of every result and proves which
query a loop iterates over (parent proven: 20/20 values of $1 came from its column "id", in row order), also across the connections of a pool.
Reported aslineagein JSON and reports. - Kinds
parallel(independent overlapping requests with no parent) and
pagination(each value from the previous page), not N+1s; shown with
--all. - sqlcommenter and Rails query-log tags: findings carry
routeandsource
(file:line), and with a W3Ctraceparentrepetitions are grouped per
request instead of per connection. - Query budgets in
.n1scan.yaml(or--config):max_queries,
max_unique_queries,max_n1andmax_burst, for the whole run or per
route; reported in the summary and PR comment, enforced with--ci.
Unknown keys are rejected. - Index suggestions on PostgreSQL 12-15 for parameterised queries (
PREPARE
withplan_cache_mode = force_generic_plan, thenEXPLAIN EXECUTE), and
expression indexes forlower(col)/upper(col)filters. Suggestions
mention the extra write cost. eval/: 20 scenarios with a known answer, run in CI with a precision and
recall gate. Current: precision 1.00, recall 1.00.
Fixed
- Loops that pause between iterations (longer than
--gap) are detected
when each value keeps coming from the same parent column. - 60 independent lookups on a pool are no longer reported as an N+1.