Skip to content

optimizer: make optimizeSourcePaths work with sub queries - #7248

Merged
mattnibs merged 1 commit into
mainfrom
subquery-optimize
Aug 27, 2026
Merged

optimizer: make optimizeSourcePaths work with sub queries#7248
mattnibs merged 1 commit into
mainfrom
subquery-optimize

Conversation

@mattnibs

Copy link
Copy Markdown
Collaborator

Fixes #6206

Comment thread compiler/dag/op.go
}
}

func WalkTWithError[T any](v reflect.Value, post func(T) (T, error)) error {

@mattnibs mattnibs Aug 26, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@nwt I don't like adding this, would be better to have a single WalkT but there are places where optimizer returns errors during analysis. My intuition is that the optimizer should just panic when it encounters errors since these should have already been caught in the semantic pass- stuff like a length 0 sequential, an unexpected source operator, a failed pool lookup, etc.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think your intuition is probably right.

Comment thread compiler/dag/op.go
}
}

func WalkTWithError[T any](v reflect.Value, post func(T) (T, error)) error {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think your intuition is probably right.

Comment thread compiler/dag/op.go Outdated
Comment thread compiler/optimizer/optimizer.go Outdated
Comment thread compiler/ztests/pruner.yaml
@mattnibs
mattnibs merged commit 2210587 into main Aug 27, 2026
2 checks passed
@mattnibs
mattnibs deleted the subquery-optimize branch August 27, 2026 22:04
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.

Fast query runs much slower as subquery (not using vector engine?)

2 participants