From 1f3cda12bd870a15c5ac2ffc9a8db8ab33a2e33a Mon Sep 17 00:00:00 2001 From: Florent de Labarre Date: Tue, 22 Nov 2022 13:55:24 +0000 Subject: [PATCH] [IMP] base: remove unused index On database with 5 million attachaments, the index of checksum is 250 Mo, but this field is never used to search. closes odoo/odoo#106253 Signed-off-by: Raphael Collet --- odoo/addons/base/models/ir_attachment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/models/ir_attachment.py b/odoo/addons/base/models/ir_attachment.py index 11cbbc96871..5267a2f2166 100644 --- a/odoo/addons/base/models/ir_attachment.py +++ b/odoo/addons/base/models/ir_attachment.py @@ -412,7 +412,7 @@ class IrAttachment(models.Model): db_datas = fields.Binary('Database Data', attachment=False) store_fname = fields.Char('Stored Filename', index=True, unaccent=False) file_size = fields.Integer('File Size', readonly=True) - checksum = fields.Char("Checksum/SHA1", size=40, index=True, readonly=True) + checksum = fields.Char("Checksum/SHA1", size=40, readonly=True) mimetype = fields.Char('Mime Type', readonly=True) index_content = fields.Text('Indexed Content', readonly=True, prefetch=False)