Community: Framework mailing list archives

expert-framework@mail.odoo.com

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

by
Camptocamp France SAS, Alexandre Fayolle - Camptocamp
- 04/06/2016 15:38:36
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