Skip to content

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

Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

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

LGTM

@jycor jycor changed the title cache sql.Schema cache sql.Schema in plan.Project and plan.TableAlias Aug 19, 2025
@jycor jycor merged commit f927685 into main Aug 19, 2025
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.

2 participants