Regression: Huge performance decrease with fields.related with store=True/{}(v5 and v6)

Bug #693339 reported by Dukai Gábor
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Medium
OpenERP's Framework R&D
5.0
Fix Released
Medium
Jay Vora (Serpent Consulting Services)

Bug Description

Hi!

A regression created in <email address hidden>
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

Tags: maintenance
Dukai Gábor (gdukai)
summary: - Regression: Huge perfomance decrease with fields.related (5.0)
+ Regression: Huge perfomance decrease with fields.related (v5 and v6)
summary: - Regression: Huge perfomance decrease with fields.related (v5 and v6)
+ Regression: Huge performance decrease with fields.related (v5 and v6)
description: updated
description: updated
Revision history for this message
Vinay Rana (OpenERP) (vra-openerp) wrote : Re: Regression: Huge performance decrease with fields.related (v5 and v6)

We Let the Framework team decide.

Thanks.

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
status: New → Triaged
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

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 <email address hidden>.

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
milestone: none → 6.0-rc2
status: Triaged → Fix Released
tags: added: maintenance
Revision history for this message
Dukai Gábor (gdukai) wrote :

Thank you.

In some cases this prevented using record rules because they were a few hundred times slower than normal. In some less problematic cases it just made the gui a bit sluggish even if the values were stored.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thanks Dukai and Olivier.

I corrected my previous commit by revision 2164 <email address hidden>.

I might have not considered any test case for related field with store attribute,as this is not really a common practice to use.

Thanks again.

summary: - Regression: Huge performance decrease with fields.related (v5 and v6)
+ Regression: Huge performance decrease with fields.related with
+ store=True/{}(v5 and v6)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.