Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#2706 Reset accounting takes forever

Core
open
nobody
5
2012-01-10
2012-01-10
Daniel Tamm
No

If there are >thousands/100k of documents and accounting records the reset accounting process takes a _very_ long time to run. It can take many many hours (I ran it for more than 8 hours without completing).

What needs to be done to correct this is to add an index to fact_acct on columns Record_ID and AD_Table_ID (strange it hasn't been done yet).

I also propose adding indexes on c_bpartner_id and m_product_id.'

I suggest adding the following indexes where the last one solves this issue.:

-- Index: fact_acct_bpartner

-- DROP INDEX fact_acct_bpartner;

CREATE INDEX fact_acct_bpartner
ON fact_acct
USING btree
(c_bpartner_id);

-- Index: fact_acct_product

-- DROP INDEX fact_acct_product;

CREATE INDEX fact_acct_product
ON fact_acct
USING btree
(m_product_id);

-- Index: fact_acct_record

-- DROP INDEX fact_acct_record;

CREATE INDEX fact_acct_record
ON fact_acct
USING btree
(ad_table_id, record_id);

Discussion

  • +1 from me

    Armen