Saturday, December 9, 2023
1 change · 17.0
Enhancements to existing features
This update adds database indexes to key financial tables (accounting moves and bank statements) to dramatically speed up record deletion operations. By optimizing how the system handles foreign key updates during deletion, the change delivers a 700x performance improvement—reducing deletion time from 7.4 seconds to milliseconds—making bulk data operations significantly faster.
Original PR description
On deletion of records, foreign keys are updated. For larger tables (like account.move, account.bank.statement.line) this could take some time. adding a "not null btree index" on sparsely populated many2one fields significantly improves performance. In the analysis of deleting a bank statement line. Before: 7.4s to delete the bank statement line (missing index on suspense_statement_line_id consuming 99% of the execution time) 3.8s to delete the corresponding account move After: With the indexes a 700x performance improvement was found. This opportunity is taken to add an index on all many2one fields to account.move & bank.statement.line. Issue report by @tsb-odoo Forward-Port-Of: odoo/enterprise#51613