-
Notifications
You must be signed in to change notification settings - Fork 6.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
Fix mbm with aio on top of query plan #45892
Fix mbm with aio on top of query plan #45892
Conversation
be63bb4
to
b39a653
Compare
e82c5e5
to
a4cee17
Compare
5c523ba
to
74c7816
Compare
74c7816
to
8a14081
Compare
WHERE query_id IN (SELECT query_id FROM system.query_log WHERE query_id != '$1' AND initial_query_id = '$1' AND event_date >= yesterday()) | ||
AND event_date >= yesterday() AND logger_name = 'MergeTreeInOrderSelectProcessor'" | ||
} | ||
|
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'd be nice to have comments what exactly the tests are checking
SELECT URL, EventDate, max(URL) | ||
FROM remote(test_cluster_one_shard_two_replicas, test.hits) | ||
WHERE CounterID = 1704509 AND UserID = 4322253409885123546 | ||
GROUP BY CounterID, URL, EventDate, EventDate |
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.
GROUP BY CounterID, URL, EventDate, EventDate | |
GROUP BY CounterID, URL, EventDate |
SELECT URL, EventDate, max(URL) | ||
FROM remote(test_cluster_one_shard_two_replicas, test.hits) | ||
WHERE CounterID = 1704509 AND UserID = 4322253409885123546 | ||
GROUP BY URL, EventDate, EventDate |
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.
GROUP BY URL, EventDate, EventDate | |
GROUP BY URL, EventDate |
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 with comments
wow, all green ) |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Improved how memory bound merging and aggregation in order on top query plan interact. Previously we fell back to explicit sorting for AIO in some cases when it wasn't actually needed. So it is a perf issue, not a correctness one.
Documentation entry for user-facing changes
When initiator choses AIO it sends special setting
force_aggregation_in_order
to remote nodes. Previously it led to insertion of explicit sorting step into the plan ifgroup_by_info == nullptr
(e.g. whenquery_plan_aggregation_in_order == true
). In this case optimisation on top of plan wasn't applied because it doesn't expectSortingStep
in betweenAggregatingStep
andRead*Step
. It led to not using reading in order and we were need to sort explicitly.Now we will not insert
SortingStep
(sorting transforms will be added byAggregatingStep
if needed) and should correctly initiate reading in order.