Skip to content

When applying indexes from outer scopes, resolve references to table aliases#3383

Merged
nicktobey merged 4 commits intomainfrom
nicktobey/lateral3
Jan 15, 2026
Merged

When applying indexes from outer scopes, resolve references to table aliases#3383
nicktobey merged 4 commits intomainfrom
nicktobey/lateral3

Conversation

@nicktobey
Copy link
Copy Markdown
Contributor

The previous implementation of the applyIndexesFromOuterScopes optimization uses the getTablesByName function to map table name references onto tables. But this function only locates ResolvedTables, and other optimizations rely on this behavior.

I've split getTablesByName into two different functions: getResolvedTablesByName, which has the original behavior, and getNamedChildren, which takes a parent node and identifies all nameable nodes in its children, including both ResolvedTables and TableAliases.

Copy link
Copy Markdown
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nicktobey nicktobey merged commit eeb3f7f into main Jan 15, 2026
8 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.

3 participants