-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
executor: remove childrenResult from baseExecutor #7076
executor: remove childrenResult from baseExecutor #7076
Conversation
/run-all-tests |
executor/aggregate.go
Outdated
@@ -795,6 +801,15 @@ func (e *StreamAggExec) Open(ctx context.Context) error { | |||
return nil | |||
} | |||
|
|||
// Close implements the Executor Close interface. | |||
func (e *StreamAggExec) Close() error { | |||
if err := e.baseExecutor.Close(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could firstly release the resources handled by itself, then release the resources handled by its children.
@@ -216,6 +225,9 @@ func (e *ProjectionExec) prepare(ctx context.Context) { | |||
|
|||
// Close implements the Executor Close interface. | |||
func (e *ProjectionExec) Close() error { | |||
if e.isUnparallelExec() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need this check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it paired for Open. It seems that alloc/dealloc child result chunk is required only when isUnparallel==true
/run-integration-common-test |
Is there a related issue about this PR? |
/run-integration-common-test |
LGTM |
remove childrenResult from baseExecutor and push down them to real implements if they real need children chunk. cut off useless childrenResult and childResult slice alloc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
executor/aggregate.go
Outdated
// Close implements the Executor Close interface. | ||
func (e *StreamAggExec) Close() error { | ||
e.childResult = nil | ||
if err := e.baseExecutor.Close(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return errors.Trace(e.baseExecutor.Close()) // I prefer this.
or
err := e.baseExecutor.Close()
return errors.Trace(err)
executor/executor.go
Outdated
// Close implements the Executor Close interface. | ||
func (e *LimitExec) Close() error { | ||
e.childResult = nil | ||
if err := errors.Trace(e.baseExecutor.Close()); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could just return it. It's ok not to have this if branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I mean in the previous comments.😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done 😂😂
executor/executor.go
Outdated
// Close implements the Executor Close interface. | ||
func (e *ExistsExec) Close() error { | ||
e.childResult = nil | ||
if err := errors.Trace(e.baseExecutor.Close()); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What have you changed? (mandatory)
This is 1 of 3 PRs of "reduce chunk capacity". issue ref #7077
In this PR, we remove
childrenResult
frombaseExecutor
and push down them to real implementsonly create result chunk for children only when it's really needed, and try create single chunk if no needed to use more than one.
What is the type of the changes? (mandatory)
How has this PR been tested? (mandatory)
This change is