Skip to content

fix(planner): avoid duplicate planning work - #750

Merged
kvlonge merged 1 commit into
mainfrom
perf/reduce-planner-duplicate-work
Sep 20, 2026
Merged

kvlonge merged 1 commit into
mainfrom
perf/reduce-planner-duplicate-work

Conversation

@kvlonge

@kvlonge kvlonge commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Why

Large projects repeated model change detection for optional selection diagnostics and rebuilt project-wide SQL-test indexes for every test case. That work scaled with both project and test counts even when the results were identical.

Changes

  • skip stale-warning detection and identity work when selection diagnostics are disabled
  • reuse execution change results only when scope identities and query-tracking semantics match
  • preserve independent diagnostic detection when query tracking is disabled
  • treat complete diagnostic results as authoritative during warning assembly
  • share SQL-test model/function indexes, fixture model maps, and identical chain topology within one plan
  • add deterministic work-count and semantic-equivalence regression coverage

Verification

  • uv run pytest tests/unit/src/sqlbuild/compiler/planner/_helpers/planning/test_identities.py tests/unit/src/sqlbuild/compiler/planner/_helpers/test_selection_staleness.py tests/unit/src/sqlbuild/compiler/planner/_helpers/changes/test_detect.py tests/unit/src/sqlbuild/compiler/planner/_helpers/test_fixture_planning_work.py tests/unit/src/sqlbuild/compiler/planner/_helpers/sql_test_assembly/test_plan_test.py tests/unit/src/sqlbuild/compiler/planner/main/test_execution.py tests/integration/src/sqlbuild/compiler/planner/_helpers/test_fixture_planning.py tests/integration/src/sqlbuild/compiler/planner/main/test_build_execution_plan.py -n auto --dist loadfile
  • make check-ci
  • make test (6,771 passed)

@kvlonge
kvlonge enabled auto-merge (squash) September 20, 2026 06:46
@kvlonge
kvlonge merged commit 0219c74 into main Sep 20, 2026
17 checks passed
@kvlonge
kvlonge deleted the perf/reduce-planner-duplicate-work branch September 20, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant