Skip to content
Snippets Groups Projects
Unverified Commit 43e4d63d authored by Olivier Dony's avatar Olivier Dony
Browse files

[IMP] mass_mailing: add missing indexes

These two columns are used to compute the mailing statistics, to be
displayed in the kanban dashboards. Adding them makes the dashboards
a lot faster on large databases (e.g. a few milliseconds instead of
several seconds)
parent a5edf6e0
Branches
Tags
No related merge requests found
......@@ -27,11 +27,11 @@ class MailMailStats(models.Model):
model = fields.Char(string='Document model')
res_id = fields.Integer(string='Document ID')
# campaign / wave data
mass_mailing_id = fields.Many2one('mail.mass_mailing', string='Mass Mailing')
mass_mailing_id = fields.Many2one('mail.mass_mailing', string='Mass Mailing', index=True)
mass_mailing_campaign_id = fields.Many2one(
related='mass_mailing_id.mass_mailing_campaign_id',
string='Mass Mailing Campaign',
store=True, readonly=True)
store=True, readonly=True, index=True)
# Bounce and tracking
scheduled = fields.Datetime(help='Date when the email has been created', default=fields.Datetime.now)
sent = fields.Datetime(help='Date when the email has been sent')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment