Skip to content

perf: skip requalification for stars no scope consumes - #29

Merged
kvlonge merged 1 commit into
mainfrom
fix/root-star-fallback
Sep 27, 2026
Merged

kvlonge merged 1 commit into
mainfrom
fix/root-star-fallback

Conversation

@kvlonge

@kvlonge kvlonge commented Sep 27, 2026

Copy link
Copy Markdown

Why

After #28, validation still fell back to whole-statement qualification whenever a star remained after ordered CTE expansion, including a star in the root SELECT's own projection (for example SELECT * FROM (SELECT ...) AS nested). That star feeds no expression in the statement, so the fallback cost qualification time without adding any type check.

Changes

  • Fall back to full qualification only for unresolved stars that an outer scope or a set operation consumes.
  • Regression cases: a root star over an explicit derived table still type-checks the derived table's expressions; a root star over a derived star with an outer predicate still qualifies and reports the conflict.
  • Version 0.13.6.

Verification

  • cargo test --lib -p polyglot-sql: 1340 passed; make test-rust-feature-gates passed.
  • Downstream profile: removes the validation-side qualification samples (~1 CPU-s) on a 3,000-model synthetic project with 300 root-star models.

Validation fell back to whole-statement qualification whenever a star
remained after ordered CTE expansion, including a star in the root
SELECT's own projection. That star feeds no expression in the statement,
so type checks never need its expansion. Only fall back for unresolved
stars read by an outer scope or a set operation. Bump to 0.13.6.
@kvlonge
kvlonge merged commit 54bfb70 into main Sep 27, 2026
24 checks passed
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