github-actions[bot] commented on code in PR #63612:
URL: https://github.com/apache/doris/pull/63612#discussion_r4489745186


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/OlapTableSqlCacheVersion.java:
##########
@@ -151,36 +152,55 @@ private static List<Long> 
getPartitionVersions(List<Partition> partitions) throw
 
     /** Check metadata first, and refresh partition dependencies when the 
table's data version changes. */
     public boolean matches(OlapTable table, long currentVersion) throws 
RpcException {
-        if (!metadataMatches(table)) {
+        List<Partition> partitions = new ArrayList<>(partitionVersions.size());

Review Comment:
   [P2] Allocate partition storage after the unchanged-version fast path
   
   Every partition-aware cache hit reaches `matches()`, and this constructor 
allocates an array with one slot per tracked partition before the 
`currentVersion == validatedTableVersion` return. Previously, unchanged-version 
hits returned before allocating it. A cached aggregate can scan thousands of 
partitions but return one row, so result-size limits do not prevent tens of KB 
or more of avoidable garbage per hit, adding FE allocation/GC work to repeated 
cache hits. Construct the list after the metadata and unchanged-version checks 
while retaining the new locking. This is distinct from the prior 
transaction-publication scan issue: it occurs on an ordinary cache hit with no 
intervening write.



-- 
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]

Reply via email to