Monday, August 24, 2026
1 change · 18.0
Enhancements to existing features
Financial reports that count accounting entries now run much faster on standard queries by avoiding unnecessary duplicate counting. This improves responsiveness for large companies while keeping report results unchanged.
Original PR description
On standard AML-backed domain-engine queries, `id` is unique. `COUNT(DISTINCT id)` is therefore redundant and prevents PostgreSQL from using a partial hash aggregation. Analytic-groupby and cash-basis modes retain `DISTINCT`, as their temporary AML relations can contain duplicate AML IDs. Benchmark on the Balance Sheet query, 5 runs per size: | Matching AMLs | Before | After | |---:|---:|---:| | 2.3M | 3.19 s | 2.06 s | | 5.8M | 6.51 s | 2.91 s | | 11.5M | 9.78 s | 3.64 s | | 17.2M | 15.63 s | 4.67 s | | 23.0M | 16.01 s | 4.68 s | At 23M AMLs, execution time drops from 16.01 s to 4.68 s (3.42x). Result sets are identical before and after. opw-6459372