zhengshengjun opened a new issue, #10603: URL: https://github.com/apache/doris/issues/10603
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues. ### Description Currently I found merge aggregation's performance is several times slower than 1st aggregation phase in a 2 phase aggregate query. After analysis with some perf-tools, the main causes are the following extra steps : 1. aggregate data in 1st phase are serialized to StringColumn, then serialized to corresponding data types again in merge aggregate 2. frequently allocate and destroy aggregate state  Then we tried to serialize 1 aggregation's result directly its actual data type to avoid deserializing from StringColumn to actual data type, and merge with add_batch function to avoid frequently allocate and destroy aggregate state. The enhancement are tested: Before optimization:   After optimization:   ### Solution _No response_ ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- 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]
