Slow response time with 300 000 products
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
When you have a product table with more more than 300 000, a search request can take a long time (20-30s).
We have managed to bring that time back to 1-2s by adding some indexes.
We have added the following definition for class ir_property in file base/res/
def _auto_init(self, cr, context={}):
if not cr.fetchone():
if not cr.fetchone():
if not cr.fetchone():
Wouldn't it be better to alter the 'columns' definition (adding select=1), so the ORM creates the indexes by itself?
Something like:
class ir_property( osv.osv) : reference( 'Value' , selection= _models_ get2, size=128, select=1), reference( 'Resource' , selection= _models_ get, size=128, select=1),
'company_ id': fields. many2one( 'res.company' , 'Company', select=1),
'fields_ id': fields. many2one( 'ir.model. fields' , 'Fields', ondelete='cascade', required=True, select=1)
...
_columns = {
...
'value': fields.
'res_id': fields.
}
...