You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#17886 introduced segmented aggregation. In the current implementation, it uses linear search to look for the start row of the last segment in each page. We tried binary search which was implemented as follows:
privateintfindLastSegmentStart(PagesHashStrategypagesHashStrategy, Pagepage)
{
intleft = 0;
intright = page.getPositionCount() - 1;
while (left < right) {
intmiddle = left + (right - left) / 2;
if (pagesHashStrategy.rowEqualsRow(page.getPositionCount() - 1, page, middle, page)) {
// Same segment - The last segment starts somewhere in [lo, mid]right = middle;
}
else {
// Different segment - The last segment starts somewhere in (mid ~ hi]left = middle + 1;
}
}
returnright;
}
As no significant improvement was observed based on our testing, we switched it back to linear search given that the code would be more readable and concise.
However, ideally we'd like to keep both implementations and introduce a config to let the user decide to use which approach.
The text was updated successfully, but these errors were encountered:
#17886 introduced segmented aggregation. In the current implementation, it uses linear search to look for the start row of the last segment in each page. We tried binary search which was implemented as follows:
As no significant improvement was observed based on our testing, we switched it back to linear search given that the code would be more readable and concise.
However, ideally we'd like to keep both implementations and introduce a config to let the user decide to use which approach.
The text was updated successfully, but these errors were encountered: