-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] stock_account: stock valuation report performances
Basically, computation of the `inventory_value` is now done in batch instead of one by one. In a real use case, the computation of the stock valuation passed from 20+ minutes to less than a minute. This revision contains an unusual SQL request: `SELECT DISTINCT ON` Basically, it returns the most recent line of table product_price_history for each tuple `(product_template_id, company_id)` which is actually what we want, with good performances. See postgresql doc for more information: http://www.postgresql.org/docs/9.0/static/sql-select.html#SQL-DISTINCT opw-641154
- Loading branch information
1 parent
0d5b015
commit 55b7f15
Showing
1 changed file
with
29 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters