Performance issue in invoice analysis
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Medium
|
OpenERP Publisher's Warranty Team |
Bug Description
The sale-module produces a lot of selects to the account_
This select takes 8000 ms with 450 invoices in the database
SELECT month,price_total FROM "account_
The company creats over 200 000 invoices per year, which was OK with series 5 of OpenERP. It will not be possible now after upgrade to 6.1. There are many installations who creates more than 400 invoices per year, many that creats 400 invoinces per day.
I think we need a temporary table or something instead of this database view. Every time a salesman opens his saleview he hits this problem.
Related branches
- OpenERP R&D Team: Pending requested
-
Diff: 220 lines (+108/-88)1 file modifiedaccount/report/account_invoice_report.py (+108/-88)
Changed in openobject-addons: | |
assignee: | nobody → OpenERP Publisher's Warranty Team (openerp-opw) |
tags: | added: maintenance |
Changed in openobject-addons: | |
status: | Confirmed → Fix Released |
Changed in openobject-addons: | |
importance: | Undecided → Medium |
milestone: | none → 6.1 |
Hello, same problem here.
Maybe this is related to bug 932524 .
Our customer has ~2500 invoices and ~1000 rows in res_currency_rate table.
While opening
accounting -> reporting -> statistics reports -> invoices analysis
on our server, postgresql logs the following durations:
2012-05-18 09:44:14 CEST [1458]: [1-1] user=openerp, db=xxxxx, remote= 127.0.0. 1(49168) LOG: duration: 12964.719 ms statement: SELECT min(account_ invoice_ report. id) AS id, count(account_ invoice_ report. id) AS categ_id_ count," account_ invoice_ report" .categ_ id, sum("account_ invoice_ report" ."nbr") AS nbr, sum("account_ invoice_ report" ."product_ qty") AS product_qty, sum("account_ invoice_ report" ."price_ total") AS price_total FROM "account_ invoice_ report" WHERE ((((account_ invoice_ report. "date" <= '2012-05-18') AND (account_ invoice_ report. "date" >= '2012-01-01')) AND ((account_ invoice_ report. "state" not in ('draft','cancel')) OR account_ invoice_ report. "state" IS NULL)) AND ((account_ invoice_ report. "type" = 'out_invoice') OR (account_ invoice_ report. "type" = 'out_refund'))) GROUP BY "account_ invoice_ report" .categ_ id
2012-05-18 09:51:23 CEST [1458]: [2-1] user=openerp, db=xxxxx, remote= 127.0.0. 1(49168) LOG: duration: 429323.694 ms statement: SELECT "account_ invoice_ report" .id FROM "account_ invoice_ report" LEFT JOIN "product_category" ON ("account_ invoice_ report" ."categ_ id" = "product_ category" ."id") WHERE (account_ invoice_ report. "id" in (4219)) ORDER BY "product_ category" ."parent_ left"
2012-05-18 09:58:42 CEST [1458]: [3-1] user=openerp, db=xxxxx, remote= 127.0.0. 1(49168) LOG: duration: 438652.536 ms statement: SELECT account_ invoice_ report. "categ_ id",account_ invoice_ report. id FROM "account_ invoice_ report" WHERE account_ invoice_ report. id IN (4219) ORDER BY date desc