Skip to content

Commit

Permalink
IMP mail_tracking performances
Browse files Browse the repository at this point in the history
On our server,
queries based on "mail_tracking_event"."tracking_email_id" improved from 501,924 ms to 1,840 ms
queries based on "mail_tracking_email"."mail_message_id" improved from 167,436 ms to 3,223 ms

The last ones are run several times when a thread has many messages
  • Loading branch information
eLBati authored and yajo committed May 7, 2018
1 parent 2c03062 commit 4173794
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mail_tracking/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Email tracking",
"summary": "Email tracking system for all mails sent",
"version": "10.0.1.0.1",
"version": "10.0.1.1.0",
"category": "Social Network",
"website": "http://www.tecnativa.com",
"author": "Tecnativa, "
Expand Down
3 changes: 2 additions & 1 deletion mail_tracking/models/mail_tracking_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class MailTrackingEmail(models.Model):
date = fields.Date(
string="Date", readonly=True, compute="_compute_date", store=True)
mail_message_id = fields.Many2one(
string="Message", comodel_name='mail.message', readonly=True)
string="Message", comodel_name='mail.message', readonly=True,
index=True)
mail_id = fields.Many2one(
string="Email", comodel_name='mail.mail', readonly=True)
partner_id = fields.Many2one(
Expand Down
2 changes: 1 addition & 1 deletion mail_tracking/models/mail_tracking_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MailTrackingEvent(models.Model):
string="Date", readonly=True, compute="_compute_date", store=True)
tracking_email_id = fields.Many2one(
string='Message', readonly=True, required=True, ondelete='cascade',
comodel_name='mail.tracking.email')
comodel_name='mail.tracking.email', index=True)
event_type = fields.Selection(string='Event type', selection=[
('sent', 'Sent'),
('delivered', 'Delivered'),
Expand Down

0 comments on commit 4173794

Please sign in to comment.