-
Notifications
You must be signed in to change notification settings - Fork 409
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
auto pass through hashagg #9167
auto pass through hashagg #9167
Conversation
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
2. auto_pass: support context Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
del only_lookup template for HashMethodBase Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
@@ -312,10 +313,20 @@ String PhysicalPlan::toString() const | |||
return PhysicalPlanVisitor::visitToString(root_node); | |||
} | |||
|
|||
void recursiveSetBlockInputStreamParent(BlockInputStreamPtr self, const IBlockInputStream * parent) | |||
{ |
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 think you need first check if parent
is set, otherwise it may meet performance issues like #4494
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
@@ -12,12 +12,17 @@ | |||
// See the License for the specific language governing permissions and | |||
// limitations under the License. | |||
|
|||
#include <AggregateFunctions/AggregateFunctionFactory.h> |
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.
Is this todo finished?
{ | ||
void AutoPassThroughHashAggContext::onBlockAuto(Block & block) | ||
{ | ||
RUNTIME_CHECK_MSG(!already_start_to_get_data, "Shouldn't insert into HashMap if already start to get data"); |
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.
aggregator->executoeOnBlock()
could only aggregate part of the data in block
, is this case considered?
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.
void AutoPassThroughHashAggContext::forceState() | ||
{ | ||
if (many_data[0]->need_spill) | ||
state = State::PassThrough; |
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.
will the hash table be converted to block after check need_spill
is true?
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.
When need_spill
is true, follow will happend:
- stop insert new data into hashtable
- will convert hashtable to block in advance(
getDataInAdvance()
) to help reduce memory.
#undef DISPATCH_NUMBER_INNER | ||
#undef DISPATCH_NUMBER_OUTER | ||
#undef FOR_NUMBER_TYPES_INNER | ||
#undef FOR_NUMBER_TYPES_OUTER |
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 mean when user input is sum(long), TiDB will convert it to sum(cast(long to decimal))?
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
void PhysicalPlan::buildBlockInputStream(DAGPipeline & pipeline, Context & context, size_t max_streams) | ||
{ | ||
RUNTIME_CHECK(root_node); | ||
root_node->buildBlockInputStream(pipeline, context, max_streams); | ||
pipeline.transform([](auto & stream) { recursiveSetBlockInputStreamParent(stream, nullptr); }); |
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 think you need call this recursiveSetBlockInputStreamParent
in BlockInputStreamPtr Planner::execute()
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
Signed-off-by: guo-shaoge <shaoge1994@163.com>
close pingcap#8982 Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
This reverts commit c3be1a9.
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: windtalker, yibin87 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
What problem does this PR solve?
Issue Number: ref #9196
Problem Summary:
What is changed and how it works?
This PR mainly includes four modifications:
only_lookup
andcollect_hit_rate
Check List
Tests
Side effects
Documentation
Release note