diff options
| author | Odoo's Mergebot <robodoo@odoo.com> | 2020-09-23 17:53:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-23 17:53:57 +0200 |
| commit | 1913943265f7b20ae7c26cea33d1f3eb918499d5 (patch) | |
| tree | 8524b14550b73148a04544af60805e877d2775dd /addons/web/static/src/js/fields/basic_fields.js | |
| parent | cb16eccbf18ed80fe0d6284fc272148e89c9d0f0 (diff) | |
| parent | 68b8f1eae653d454538c1552c2553a7d7f06185e (diff) | |
[FW][FIX] mrp: installation on very large inventories
[FIX] mrp: installation on very large inventories
Before this commit, installation of MRP in a database with 4.8M stock.move + 4.8M stock.move.line was not possible at all.
The process lasted for a very long time (>90 min in our tests) then eventually failed after using the whole RAM of your server.
This commit allows installing MRP in databases with large stock.move /stock.move.line tables by bootstrapping the slow parts in SQL.
(A more general fix regarding the time complexity of some parts of the prefetching algorithm is coming later in 13.0-init-computed-fields-rco)
-----
[FIX] mrp: more Voodoo magic
It appears that if you update a record more than once in the same
PostgreSQL transaction, PostgreSQL is going to re-check all the
constraints on the table.
** THIS IS THE PART WHERE THE BLACK MAGIC HAPPENS **
We combine the setting of the default value of stock.move.unit_factor in
the same UPDATE query to avoid the constraint re-check; it saves
approximately 60% of the SQL running time in my case.
** ... AND NOW YOU CAN SAY: WHAT THE F...?! **
Thanks to @rco-odoo for the tip; he knows it from the wise @nseinlet.
-----
opw-[2281585](https://www.odoo.com/web?debug=1#id=2281585&action=3531&model=project.task&view_type=form&cids=&menu_id=4720)
closes odoo/odoo#57943
Forward-port-of: odoo/odoo#57850
Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
0 files changed, 0 insertions, 0 deletions
