[FIX] account_financial_report: Avoid slow vacuum due to ondelete=cascade
`report_journal_ledger` is auto-vacuumed as any transient model, but has some ondelete="cascade" constraints that auto-remove subtables when a record is removed, doing this operation very slow when selecting these sub-records. Letting default ondelete="set null" would result in same performance bottleneck, as the select on sub-table is performed the same for setting "null" value on them. As a solution, and for avoiding a costly index operation, we delete by SQL sub-tables rows in advance. A bit of extra logic has been added for avoiding to remove that records if it's not the turn of vacuum the parent table.
This commit is contained in:
@@ -465,6 +465,11 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
||||
<li>Alexis de Lattre <<a class="reference external" href="mailto:alexis@via.ecp.fr">alexis@via.ecp.fr</a>></li>
|
||||
<li>Mihai Fekete <<a class="reference external" href="mailto:feketemihai@gmail.com">feketemihai@gmail.com</a>></li>
|
||||
<li>Miquel Ra??ch <<a class="reference external" href="mailto:miquel.raich@eficent.com">miquel.raich@eficent.com</a>></li>
|
||||
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
|
||||
<li>Pedro M. Baeza</li>
|
||||
<li>Sergio Teruel</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Much of the work in this module was done at a sprint in Sorrento, Italy in
|
||||
April 2016.</p>
|
||||
|
||||
Reference in New Issue
Block a user