From 731afc846353e75ebc1b327db8037e4da8f3657e Mon Sep 17 00:00:00 2001 From: Jan Verbeek Date: Fri, 22 Jan 2021 18:44:42 +0100 Subject: [PATCH] [FIX] account_financial_report: add index to report_move_id When running `DELETE FROM report_journal_ledger_move` this column is checked repeatedly, even though the table is empty. On our setup that caused the query to take hours. Adding an index solved it. --- account_financial_report/report/journal_ledger.py | 1 + 1 file changed, 1 insertion(+) diff --git a/account_financial_report/report/journal_ledger.py b/account_financial_report/report/journal_ledger.py index 3e4d7293..fbb66941 100644 --- a/account_financial_report/report/journal_ledger.py +++ b/account_financial_report/report/journal_ledger.py @@ -722,6 +722,7 @@ class ReportJournalLedgerMoveLine(models.TransientModel): comodel_name='report_journal_ledger_move', required=True, ondelete='cascade', + index=True, ) move_line_id = fields.Many2one( comodel_name='account.move.line',