Perf: Render scope upstream snapshots#5917
Draft
fresioAS wants to merge 3 commits into
Draft
Conversation
Add --use-project-index to targeted and full lint. The default path preserves the existing full context load. With both --use-project-index and --model, SQLMesh uses a persistent model-to-file dependency index to load, resolve, and validate only the selected models and their transitive upstream dependencies. A full indexed lint still loads and lints every model, but creates or refreshes the index for later targeted commands. Missing or expanded dependencies safely retry with a full indexed load. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Andreas Fredhøi <andreas.fredhoi@fresio.no>
fresioAS
force-pushed
the
render-scope-upstream-snapshots
branch
from
July 24, 2026 12:25
4e386ea to
82a30cd
Compare
Signed-off-by: Andreas Fredhøi <andreas.fredhoi@fresio.no>
Signed-off-by: Andreas Fredhøi <andreas.fredhoi@fresio.no>
fresioAS
force-pushed
the
render-scope-upstream-snapshots
branch
from
July 24, 2026 13:14
82a30cd to
54a0685
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-on from #5913 - solves #5905
Adds an opt-in --use-project-index flag to sqlmesh render.
When enabled, SQLMesh loads only the target model and its upstream dependencies, reducing unnecessary project loading and snapshot creation. It safely falls back to a full load if the project index is missing or stale.
Includes CLI documentation and tests for scoped loading and fallback behavior.
Test Plan
395 model live plan
=== Timing summary ===
sqlmesh --gateway core_dev_new render sap.exposed.project 24.98s ok
sqlmesh --gateway core_dev_new render sap.exposed.person 20.52s ok
sqlmesh --gateway core_dev_new render sap.exposed.calendar 18.99s ok
sqlmesh --gateway core_dev_new render --use-project-index sap.exposed.project 7.13s ok
sqlmesh --gateway core_dev_new render --use-project-index sap.exposed.person 5.91s ok
sqlmesh --gateway core_dev_new render --use-project-index sap.exposed.calendar 6.37s ok
Checklist
make styleand fixed any issuesmake fast-test)git commit -s) per the DCO