Skip to content

perf: reuse table mapping during snapshot promotion - #6127

Draft
perjmi wants to merge 1 commit into
SQLMesh:mainfrom
perjmi:perf/6018-reuse-table-mapping
Draft

perjmi wants to merge 1 commit into
SQLMesh:mainfrom
perjmi:perf/6018-reuse-table-mapping

Conversation

@perjmi

@perjmi perjmi commented Oct 11, 2026 •

Copy link
Copy Markdown

Description

Rendering virtual properties and ON_VIRTUAL_UPDATE statements rebuilds and normalizes the full snapshot table mapping for each model during promotion. Prepare the physical mapping and environment overrides once per promotion, share its normalized keys across workers, and give table replacement only the entries referenced by each expression.

Preserve representative-snapshot selection, override precedence, macro table resolution, and embedded-model expansion. Embedded-model scans remain unchanged.

Refs #6018.

Test Plan

  • python -m pytest tests/core/test_snapshot_evaluator.py tests/core/test_model.py: 514 passed.
  • make style: passed, including Ruff, mypy, and migration validation.
  • make fast-test: all four phases passed (2,668 fast, 5 isolated, 1 registry isolation, and 190 dialect isolation test executions), using Python 3.11.15, four workers, the declared development dependencies, and an isolated UnixODBC runtime.
  • Regression coverage verifies one full mapping per promotion with one and four workers, view overrides, changed versions and deployability across promotions, macro resolution, embedded expansion, and dialect-equivalent key precedence.

Checklist

  • I have run make style and fixed any issues
  • I have added tests for my changes (if applicable)
  • All existing tests pass (make fast-test)
  • My commits are signed off (git commit -s) per the DCO

Signed-off-by: perjmi <perjmi@yahoo.com>
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