Issue 11027

Title
Use SQL query to validate balanced move
Priority
feature
Status
resolved
Nosy list
ced, reviewbot, roundup-bot
Assigned to
ced
Keywords
review

Created on 2021-12-08.17:00:51 by ced, last changed 9 months ago by roundup-bot.

Messages

New changeset deb1e35c6ddb by Cédric Krier in branch 'default':
Use SQL queries to check if move lines are balanced
https://hg.tryton.org/tryton-env/rev/deb1e35c6ddb
New changeset 5a15561b28ce by Cédric Krier in branch 'default':
Use SQL queries to check if move lines are balanced
https://hg.tryton.org/modules/account/rev/5a15561b28ce
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-12-08.21:25:22

I measured that the creation of 30K lines before it spent more than 10 hours (I stopped when it was at 20K) and after it takes 10 minutes.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-12-08.17:00:51

For a migration I'm importing using proteus the account balances which is a move with about 20K lines. In proteus I create the lines per group of 1000 lines to optimize the cache usage. But this is still very slow. I think the main issue is the Move.validate_move which browses all the move lines to compute the balance.
I think it will be better to perform this operation with SQL only.
The same applies to the check in Move.post which check also that lines are balanced.

History
Date User Action Args
2021-12-21 23:28:30roundup-botsetmessages: + msg72875
2021-12-21 23:28:23roundup-botsetmessages: + msg72874
nosy: + roundup-bot
status: testing -> resolved
2021-12-08 21:25:22cedsetmessages: + msg72054
2021-12-08 17:04:25reviewbotsetmessages: + msg72052
nosy: + reviewbot
2021-12-08 17:01:41cedsetkeyword: + review
reviews: 377641002
status: in-progress -> testing
2021-12-08 17:00:51cedcreate