Saturday, May 10, 2025
1 change · saas-18.3
Enhancements to existing features
Live chat reports have been optimized so they load much faster on large databases, reducing wait times from about 30 seconds to around 2 seconds in testing. Demo data was also corrected so chatbot session statistics are more consistent and reliable.
Original PR description
This commit optimizes the channel report query by replacing inefficient CTEs with lateral joins. The previous CTE implementation lacked initial filtering, processing all rows. This change introduces lateral joins, enabling efficient filtering: first for live chat channels and, for the default report, focusing on the significantly smaller dataset of last month's live chats. This significantly improves efficiency. Testing on a large dataset (1.6M+ channels, 600K+ live chats, ~20M messages) shows a significant speedup, from approximately 30 seconds down to around 2 seconds after refactoring. https://github.com/odoo/enterprise/pull/85164