-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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: support window func for aggregate without frame clause #8899
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8899 +/- ##
==========================================
+ Coverage 67.14% 67.16% +0.01%
==========================================
Files 371 372 +1
Lines 76515 76642 +127
==========================================
+ Hits 51379 51477 +98
- Misses 20546 20558 +12
- Partials 4590 4607 +17
Continue to review full report at Codecov.
|
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.
No mem tracker currently?
@winoros Yes, we can add it latter. |
return errors.Trace(err) | ||
} | ||
|
||
childResult := e.children[0].newFirstChunk() |
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.
should we allocate a Chunk
with tidb_max_chunk_size
capacity?
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.
tidb_max_chunk_size
may result in unnecessary results.
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.
Yeah, to avoid unnecessary results, we should use a smaller chunk size for the first Chunk
used to fetch child result. But in the next time, we should use a bigger chunk size. This function always use newFirstChunk()
to fetch the child result, it's not efficient for big tables.
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.
I tried the way mentioned in the comment, currently, we need to call chunk.Renew
to create a larger chunk, and it requires to remember the last chunk... Maybe we can refine it after we can pass down the chunk size to the child.
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.
Okay.
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.
Could you file an issue to trace this problem?
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, #9045
return errors.Trace(err) | ||
} | ||
|
||
childResult := e.children[0].newFirstChunk() |
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.
Yeah, to avoid unnecessary results, we should use a smaller chunk size for the first Chunk
used to fetch child result. But in the next time, we should use a bigger chunk size. This function always use newFirstChunk()
to fetch the child result, it's not efficient for big tables.
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
/run-all-tests |
/run-all-tests |
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
PTAL @eurekaka, I resolved the conflicts. |
What problem does this PR solve?
Support the execution of aggregations without frame clause for window functions.
What is changed and how it works?
Add a new executor and evaluation framework for window functions.
Check List
Tests
Code changes
Side effects
Related changes
This change is