Thursday, September 10, 2026
1 change · 18.0
Enhancements to existing features
The follow-up process now checks whether a customer has related accounting activity much more efficiently. This reduces waiting time for users and improves performance for customers with large volumes of accounting records.
Original PR description
Before this commit, _compute_has_moves built a UNION of four subselects over account_move and account_move_line, collecting every matching row before reducing it to a boolean. For a partner with many…
Before this commit, _compute_has_moves built a UNION of four subselects over account_move and account_move_line, collecting every matching row before reducing it to a boolean. For a partner with many moves that scans the full match set on all four sources, plus a sort or hash to deduplicate the UNION, to answer a question that only needs one row. I have modified this to use EXISTS subqueries instead, which can short-circuit on the first match of a subquery + the `OR` operator which will short-circuit on the first match of any of the four subqueries. # Benchmark | Number of moves | Before | After | Plans | | --- | --- | --- | --- | | 3×10⁵ | 7 s | 100 ms | [before][b1] / [after][a1] | | 3×10⁴ | 2.1 s | 0.056 ms | [before][b2] / [after][a2] | | 6×10³ | 3.3 s | 0.076 ms | [before][b3] / [after][a3] | [b1]: https://explain.dalibo.com/plan/119d7e947e61ee01 [a1]: https://explain.dalibo.com/plan/23d2da2d5g466a27 [b2]: https://explain.dalibo.com/plan/6c98e3817c638078 [a2]: https://explain.dalibo.com/plan/2522603e1649d3ba [b3]: https://explain.dalibo.com/plan/df1404a63fa56df9 [a3]: https://explain.dalibo.com/plan/d6gfac48g54815a7