Skip to content

perf: pin polyglot with faster column qualification - #923

Merged
kvlonge merged 2 commits into
mainfrom
perf/polyglot-column-sets
Oct 3, 2026
Merged

kvlonge merged 2 commits into
mainfrom
perf/polyglot-column-sets

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Why

Polyglot's column qualification cloned source column sets per column reference and built a full scope tree under each SELECT, so wide joins and wide SELECT * subqueries analysed slowly. Commented UNION ALL chains were still quadratic (CHI-450, CHI-478).

Changes

Verification

  • Polyglot: 16 wide joins 93 → 10.2 ms; commented 240-branch chain compile 150 → 29 ms; strict differential over 3,922 queries × 10 dialects shows no real differences; independent review.
  • The new guard case fails on the previous pin (13–17x vs a 6x budget) and passes on this one (3.7x).
  • Semantic fingerprint pins unchanged; make test, make check-ci.

…ented set operations

Bump polyglot-sql to a revision that borrows source column sets during
schema-aware column qualification, so wide relations and SELECT * over
derived tables qualify in linear time, and that builds scopes for
set-operation chains with comments before the operators in linear time.
Analysis results are unchanged.

Extend the long UNION ALL fixture guard with an input fixture whose rows
are separated by a comment before each UNION ALL; 200-row commented
fixtures previously took about 17 times as long as 50-row fixtures.
@kvlonge
kvlonge enabled auto-merge (squash) October 3, 2026 08:05
@kvlonge
kvlonge merged commit cbe710d into main Oct 3, 2026
34 checks passed
@kvlonge
kvlonge deleted the perf/polyglot-column-sets branch October 3, 2026 08:32
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