[IMP] stock: set index on stock_move_line.picking_id
This commit set an index on column `picking_id` of table `stock_move_line`. Many sql requests on stock_move_line have picking_id in their where-clause. On a database filled with 1M pickings, reading a picking of 10 stock_move_lines is 60 times faster. Closes https://github.com/odoo/odoo/issues/44623 closes odoo/odoo#46153 X-original-commit: a36a693733579e1e8bdaa3aa00fcc482c6299acf Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
This commit is contained in:
@@ -17,6 +17,7 @@ class StockMoveLine(models.Model):
|
||||
picking_id = fields.Many2one(
|
||||
'stock.picking', 'Transfer', auto_join=True,
|
||||
check_company=True,
|
||||
index=True,
|
||||
help='The stock operation where the packing has been made')
|
||||
move_id = fields.Many2one(
|
||||
'stock.move', 'Stock Move',
|
||||
|
||||
Reference in New Issue
Block a user