Jairo Llopis
|
ed559bbb7b
|
[IMP] account_reconciliation_widget: reduce heavy queries count
This specific query is quite expensive, and what's worse, it's also done twice: once to count records and once to get them.
By using a window function, we can get the count and results in one query, thus almost doubling performance in this operation.
Related resources:
- [Explanation](https://stackoverflow.com/a/22353886/1468388).
- [Explain of the 1st SELECT COUNT(*), before the patch](https://explain.dalibo.com/plan/TgL).
- [Explain of the 2nd SELECT, before the patch](https://explain.dalibo.com/plan/Yc9).
- [Explain of the new, unified SELECT, after the patch](https://explain.dalibo.com/plan/9MA).
@Tecnativa TT28595 TT29916 https://github.com/odoo/odoo/pull/73765
|
2021-07-15 13:02:44 +01:00 |
|