Monday, December 9, 2024
1 change · 17.0
Enhancements to existing features
This update significantly improves the speed of generating the Profit & Loss report, especially when using multiple analytic filters. The change streamlines the report generation process by avoiding unnecessary table creation, resulting in faster loading times for larger datasets. This enhances user experience and efficiency.
Original PR description
When loading the Profit and Loss report with multiple analytic filters, loading times can be very slow on larger databases. Analytic filtering necessitates the creation of a temporary table which is…
When loading the Profit and Loss report with multiple analytic filters, loading times can be very slow on larger databases. Analytic filtering necessitates the creation of a temporary table which is used to merge the account_move_line and account_analytic_line tables. This process takes an enormous amount of time on large databases and is unnecessary. Since this table is created whenever the analytic filters are changed (it is dropped on commit), it is much faster to only copy the relevant lines into the new table. This PR adds logic to identify the relevant analytic accounts for the given query, and changes the table-making query to only copy lines with the relevant analytic accounts attached to them. Performance Benchmarks Pre: | 100,000 lines | 250,000 lines| 500,000 lines| |--------|--------|--------| | 5.2s | 10.77s | 110s | | 4.86s | 11.43s | 110s | | 5.16s | 12.2s | 115s | Performance Benchmarks Post: | 100,000 lines | 250,000 lines | 500,000 lines | |--------|--------|--------| | 1.56s | 3.19s | 6.22s | | 2.65s | 6.03s | 11.58s | | 3.74s | 8.36s | 16.36s | OPW-4300365