Skip to content

cache sql.Schema in plan.Project and plan.TableAlias#3158

Merged
jycor merged 12 commits intomainfrom
james/schema
Aug 19, 2025
Merged

cache sql.Schema in plan.Project and plan.TableAlias#3158
jycor merged 12 commits intomainfrom
james/schema

Conversation

@jycor
Copy link
Contributor

@jycor jycor commented Aug 13, 2025

Changes:

  • plan.Project.Schema() and plan.TableAlias.Schema() create a new sql.Schema every time they are called, which can be a lot during analysis. So, the results are cached.
  • sql.Index.Expressions() retrieves a new []string, so we should cache that as well. Additionally, many times we unqualify the results, so I added a UnqualifiedExpressions() to avoid doing this extra processing every time.
  • changes idxExprsColumns to avoid using strings.Split to avoid extra allocations

Loading
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.

2 participants