Skip to content

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 01 Dec 03:02
· 23 commits to main since this release
b78d392

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 as lineage in 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 route and source
    (file:line), and with a W3C traceparent repetitions are grouped per
    request instead of per connection.
  • Query budgets in .n1scan.yaml (or --config): max_queries,
    max_unique_queries, max_n1 and max_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
    with plan_cache_mode = force_generic_plan, then EXPLAIN EXECUTE), and
    expression indexes for lower(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.