github-actions[bot] commented on code in PR #67150:
URL: https://github.com/apache/doris/pull/67150#discussion_r3862039344
##########
fe/fe-core/src/main/java/org/apache/doris/planner/OlapScanNode.java:
##########
@@ -1058,13 +1058,16 @@ private void computeTabletInfo() throws UserException {
}
}
} else {
- tablets.addAll(selectedTable.getTablets());
- scanTabletIds.addAll(allTabletIds);
+ for (Tablet tablet : selectedTable.getTablets()) {
+ tablets.add(tablet);
+ scanTabletIds.add(tablet.getId());
+ }
}
if (!isPointQuery()) {
- for (int i = 0; i < allTabletIds.size(); i++) {
- tabletId2BucketSeq.put(allTabletIds.get(i), i);
+ List<Tablet> allTablets = selectedTable.getTablets();
+ for (int i = 0; i < allTablets.size(); i++) {
+ tabletId2BucketSeq.put(allTablets.get(i).getId(), i);
Review Comment:
**[P1] Reuse the boxed tablet IDs when building bucket sequences**
Non-point scans still need one ID per tablet as a `tabletId2BucketSeq` key,
but this loop now boxes each ID again after the selected/result path has
already boxed it. Previously `allTabletIds` created N `Long`s once and both
`scanTabletIds` and this map retained those same objects. On a
no-predicate/all-bucket scan, the new code therefore retains two distinct
`Long`s per tablet; production IDs are outside the small `Long` cache, so
removing the N-reference list can actually increase allocation on this common
path. Please build the ordered boxed IDs once—or otherwise share each boxed ID
between selection and bucket bookkeeping—so the optimization does not regress
non-point/full-scan planning memory.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]