performance issue in stock/product.py
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) | Status tracked in Trunk | |||||
5.0 |
Won't Fix
|
Undecided
|
Unassigned | |||
Trunk |
Fix Released
|
Wishlist
|
OpenERP R&D Addons Team 2 |
Bug Description
no need to read the table twice - once for in once for out
if 'in' in what:
# all moves from a location out of the set to a location in the set
)
results = cr.fetchall()
if 'out' in what:
# all moves from a location in the set to a location out of the set
)
for a similar task I use this
)
b5-proposed=# explain select * from stock_move where location_id in (1,2,3) or location_dest_id in (1,2,3);
-------
Bitmap Heap Scan on stock_move (cost=25.79..114.51 rows=37 width=384)
Recheck Cond: ((location_id = ANY ('{1,2,
-> BitmapOr (cost=25.79..25.79 rows=37 width=0)
-> Bitmap Index Scan on stock_move_
-> Bitmap Index Scan on chircar_
(7 rows)
b5 - current=# explain select * from stock_move where location_id in (1,2,3) or location_dest_id not in (1,2,3);
-------
Seq Scan on stock_move (cost=0.00..183.63 rows=1675 width=384)
Filter: ((location_id = ANY ('{1,2,
(2 rows)
Changed in openobject-addons: | |
status: | New → Confirmed |
assignee: | nobody → Anup (Open ERP) (ach-openerp) |
I suggest to change the index as mentioned in the patch
the postgresql optimizer (and users ) will honor this with enhanced performance