← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 693339] Re: Regression: Huge performance decrease with fields.related (v5 and v6)

 

Dukai,
Thanks for the detailed analysis and tracking of the commits in 5.0 and trunk!
This has been corrected in trunk by revision 3148 odo@xxxxxxxxxxx-20101223150253-zumk5entx9heb8q0.

I am assigning the port of this fix in 5.0 to the maintenance team, and this will give Jay the opportunity to review his original commit and explain why he disabled the use of the database column for search on function fields that have fnct_search.
Related fields are an example of a function field that always has a "fnct_search" method, but it should not be used if the field is stored, because searching the stored column in the database will be faster 99% of cases (and we can't detect the cases where it could possibly be slower anyway)

Thanks!

** Changed in: openobject-server
   Importance: Undecided => Medium

** Changed in: openobject-server
       Status: Triaged => Fix Released

** Changed in: openobject-server
    Milestone: None => 6.0-rc2

** Also affects: openobject-server/5.0
   Importance: Undecided
       Status: New

** Changed in: openobject-server/5.0
   Importance: Undecided => Medium

** Changed in: openobject-server/5.0
       Status: New => Confirmed

** Changed in: openobject-server/5.0
    Milestone: None => 5.0.16

** Changed in: openobject-server/5.0
     Assignee: (unassigned) => Jay (OpenERP) (jvo-openerp)

** Tags added: maintenance

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/693339

Title:
  Regression: Huge performance decrease with fields.related (v5 and v6)

Status in OpenObject Server:
  Fix Released
Status in OpenObject Server 5.0 series:
  Confirmed

Bug description:
  Hi!

A regression created in jvo@xxxxxxxxxxx-20100202150454-x9kne83yzkjciidw
for v5: http://bazaar.launchpad.net/~openerp/openobject-server/5.0/revision/1950
for v6: http://bazaar.launchpad.net/~openerp/openobject-server/trunk/revision/1844.4.90

If a fields.related with store=True is searched, it doesn't use the stored value but calculates the values like it was not stored at all.
Because of this, for example with a fields.related location_id on stock.picking a search for one location could result in sql queries having 30000 ids instead of a simple stock_picking.location_id in (%s).

There's a stock_location_restrict module in the community addons as an example: http://bazaar.launchpad.net/~openerp-community/openobject-addons/trunk-addons-community/annotate/head%3A/stock_location_restrict/stock.py







References