-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Make aggregate state merge parallel for key8 and key16. #87366
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
Conversation
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
some notes https://pastila.nl/?029696d4/e8c50f64d3799b6e0cc1f9da7770dfe7#w6qdcZYrJ67XJhbWGV8TEw== also pipeline how coordinate, state transition is key. almost like still sequential for single level. Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
… via prepareBlockAndFillSingleLevel Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
|
Workflow [PR], commit [8b9cac5] Summary: ❌
|
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
5eb06ca to
32a2b55
Compare
a471df8 to
c5a3c05
Compare
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
23367a0 to
79b9ad8
Compare
a2fb81f to
dce079f
Compare
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
dce079f to
7cc9b44
Compare
|
Yeah. That's because we check fixed hashmap size during the merge, via checkLimits which require iterate all element in the buffer to see if they are zero. Meanwhile other threads are adding new entries to the first map. I think we might be able to skip |
It's fine to do the check on a single thread once a merge is done |
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
22bcb38 to
b00fc8e
Compare
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
b00fc8e to
6b7ff25
Compare
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
1450e9d to
e677112
Compare
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
|
Hi @nickitat this is ready for another look, thanks! |
4303e6d to
6ef5b27
Compare
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
6ef5b27 to
6c34c81
Compare
|
|
|
Hi @nickitat all comments have been addressed, PTAL, thanks! |
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
Signed-off-by: Jianfei Hu <hujianfei258@gmail.com>
nickitat
left a comment
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.
great work!
f9948b3
Signed-off-by: Jianfei Hu hujianfei258@gmail.com
Resolves #63666 Implemented the idea from #63667 (comment)
mergeToViaIndexFilterto FixedHashMapmax_threads. Each thread uses their own thread id to invokemergeToViaIndexFilterto avoid race condition on the fixed hash map.We can see noticeable performance improvement for the original query, which uses fixed hash map during aggregation.
Changelog category (leave one):
Changelog entry
When a query uses fixed hash map for aggregation state(group by a small integer), ClickHouse would merge the aggregation state in parallel to speed up the query. Resolves #63666