2e81f53a2a134a487483cef89c8bc03f9d823b3b
In #45174, the original_id field was added on ir.attachment, so that derived images in the web-editor (cropped, resized, optimized, ...) could keep a trace of the original, such that if the user wanted to revert it or change the crop/size/optimization parameter, we could do it from the original again so that for example the quality can be increased or the crop region made bigger. The addition of this self-referencing many2one from ir.attachment to itself however will cause DELETE queries on ir.attachment to do a sequential scan on the table to update potential records referencing the deleted record in their original_id field. As the ir.attachment table tends to be one of the biggest tables in production databases (millions of records), this scan can take multiple seconds per DELETE operation, and since attachments are used everywhere in odoo to represent files, DELETE operations on them are frequent. Adding an index on the original_id field should make these DELETE operations substantially faster (scaling with the log of the number of filled original_id fields, which will be very small, instead of scaling linearly with number of records) closes odoo/odoo#54676 X-original-commit: 2b5064a00b7a5c8dc66429869287386f244b1257 Signed-off-by: Olivier Dony (odo) <odo@openerp.com> Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
…
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%