avamingli commented on code in PR #1178: URL: https://github.com/apache/cloudberry/pull/1178#discussion_r2158267043
########## src/backend/executor/nodeAgg.c: ########## @@ -2276,7 +2300,7 @@ lookup_hash_entries(AggState *aggstate) initialize_hash_entry(aggstate, hashtable, entry); pergroup[setno] = entry->additional; } - else + else if (!aggstate->streaming) Review Comment: Not sure, could we get here if using streaming hashagg? ########## src/backend/executor/nodeAgg.c: ########## @@ -2092,6 +2095,25 @@ hash_agg_update_metrics(AggState *aggstate, bool from_tape, int npartitions) } } } + + if(DEBUG1 >= log_min_messages && aggstate->streaming) + { + for (int setno = 0; setno < aggstate->num_hashes; setno++) + { + AggStatePerHash perhash = &aggstate->perhash[setno]; + if (perhash->chain_count > 0) + { + elog(DEBUG1, "hash_agg_update_metrics streaming: setno=%d, chain_length_total=%.1f, chain_length_max=%d, bucket_used=%lu, bucket_total=%lu, num_expansions=%u", + setno, + (double)perhash->chain_length_total / perhash->chain_count, + perhash->chain_length_max, + perhash->bucket_used, + perhash->bucket_total, + perhash->num_expansions); + } + } + } + Review Comment: 1. codes indent 2.Is it advisable to log messages in the executor? Could this introduce overhead during execution? -- 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: commits-unsubscr...@cloudberry.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cloudberry.apache.org For additional commands, e-mail: commits-h...@cloudberry.apache.org