Community: Framework mailing list archives

expert-framework@mail.odoo.com

Re: report models based on sql views and search_read performance issue

by
Jean-Sébastien Hederer
- 04/06/2016 16:27:33

I've rewritten core code, not search_read for a model. Something was particularly badly written in core
 


Cordialement
Jean-Sébastien Hederer
Conseil, intégration, hébergement de systèmes informatiques spécialisé en solutions logiciel libre de gestion d'entreprise
Spécialiste Odoo/OpenERP, OpenDAS et Magento
Mob.: 06 69 56 21 49
Tél.: 09 80 08 25 41
Fax.: 09 80 08 25 49
Support commercial ASPerience: 09 80 08 25 47
Support technique ASPerience: 09 80 08 25 48
*********************************************************************
Ce courriel et les documents qui sont attachés peuvent contenir des informations confidentielles. Si vous n'êtes pas le destinataire escompté, merci d'en informer l'expéditeur immédiatement et de détruire ce courriel ainsi que tous les documents attachés de votre système informatique. Toute divulgation, distribution ou copie du présent courriel et des documents attachés sans autorisation préalable de son émetteur est interdite.

This e-mail and any attached documents may contain confidential or proprietary information. If you are not the intended recipient, please advise the sender immediately and delete this e-mai land all attached documents from your computer system. Any unauthorised disclosure, distribution or copying hereof is prohibited."
**********************************************************************
 
----------------message d'origine-----------------
De: Alexandre Fayolle [alexandre.fayolle@camptocamp.com]
A: Jean Sébastien HEDERER ASPerience [hedererjs@asperience.fr]
Copie à: "Odoo S.A. Community: Framework" [expert-framework@mail.odoo.com]
Date: Wed, 6 Apr 2016 22:16:15 +0200
----------------------------------------------------------
 
I guess if it comes to this, yes rewriting search_read for that model could be an option... Kind of "last resort", though...
 
2016-04-06 22:08 GMT+02:00 Jean Sébastien HEDERER ASPerience <hedererjs@asperience.fr>:
Hi,
For some of my clients with this problem, I have rewritten part of core code that was not optimized and it works far better. I've done this in v5 for example. I don't know if this could be used for next versions. Rewrite consist in making only one request.
I can remember that I've rewritten some other SQL views too and added some indexes, which must be used with precaution because it raises write delays

 
Cordialement
Jean-Sébastien Hederer
Conseil, intégration, hébergement de systèmes informatiques spécialisé en solutions logiciel libre de gestion d'entreprise
Spécialiste Odoo/OpenERP, OpenDAS et Magento
Mob.: 06 69 56 21 49
Tél.: 09 80 08 25 41
Fax.: 09 80 08 25 49
Support commercial ASPerience: 09 80 08 25 47
Support technique ASPerience: 09 80 08 25 48
*********************************************************************
Ce courriel et les documents qui sont attachés peuvent contenir des informations confidentielles. Si vous n'êtes pas le destinataire escompté, merci d'en informer l'expéditeur immédiatement et de détruire ce courriel ainsi que tous les documents attachés de votre système informatique. Toute divulgation, distribution ou copie du présent courriel et des documents attachés sans autorisation préalable de son émetteur est interdite.

This e-mail and any attached documents may contain confidential or proprietary information. If you are not the intended recipient, please advise the sender immediately and delete this e-mai land all attached documents from your computer system. Any unauthorised disclosure, distribution or copying hereof is prohibited."
**********************************************************************
 
----------------message d'origine-----------------
De: Alexandre Fayolle [alexandre.fayolle@camptocamp.com]
A: "Community: Framework" [expert-framework@mail.odoo.com]
Date: Wed, 06 Apr 2016 19:42:21 -0000
----------------------------------------------------------
 
sorry....


In my current project, I have a report model class with _auto = False and which initializes an SQL view which is fairly complex. It worked fine with test data, but I'm hitting a performance limitation with my customers real data. After digging a bit, I found that the main issue is that the id column of the view is not indexed, and I have no easy way to map that column to an underlying indexed column which could help, because the view has a group by to perform some aggregations.
 
What happens is that search_read makes 2 SQL queries: first the search to find the ids first 80 rows of the table, this takes a couple of seconds, which is acceptable. Then the read makes a query with a where id in (list of ids) clause, which takes several minutes to run because the whole view needs to be processed as the domain from the search is no longer available.
 
I'm certainly not the first one to run into this, and I'm curious how people handle this.
 
Thanks for your insights.
 
 
2016-04-06 21:28 GMT+02:00 Alexandre Fayolle <alexandre.fayolle@camptocamp.com>:
Hello,
 
In my current project, I have a report model class with _auto = False and which initializes

--
Alexandre Fayolle
Chef de Projet
Tel : + 33 (0)4 58 48 20 30

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac Cedex
http://www.camptocamp.com

 



--
Alexandre Fayolle
Chef de Projet
Tel : + 33 (0)4 58 48 20 30

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac Cedex
http://www.camptocamp.com
 

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-framework-62
Post to: mailto:expert-framework@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe




--
Alexandre Fayolle
Chef de Projet
Tel : + 33 (0)4 58 48 20 30

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac Cedex
http://www.camptocamp.com