diff options
| author | Olivier Dony <odo@odoo.com> | 2018-11-16 16:35:22 +0100 |
|---|---|---|
| committer | Olivier Dony <odo@odoo.com> | 2018-11-16 16:35:22 +0100 |
| commit | 8545e05fc0aaad1c942317f6b4ac120da415b3cc (patch) | |
| tree | 62d4226f9189e964db3144d463d3e650b5093c7c /addons/digest/data | |
| parent | a103d4a43effd815e51de02804d6588580ce62f3 (diff) | |
[FIX] mass_mailing: fix slow contact number query
The query was computing the count for all mailing lists, not just the
one being requested. This prevents optimizing the SELECT with indexes.
In addition, using a subselect for the blacklist forced a full table
scan on the contacts - switching to a LEFT JOIN avoids that.
With a blacklist of a few hundred thousand entries, and a table of
mailing list contacts in the same order of magnitude, this brings the
SELECT from 3+ seconds down to 3 milliseconds - with the same result.
Bonus: no need to perform the regexp extraction of emails to test for
NULL values -> substring(x) is NULL iff x is NULL.
Diffstat (limited to 'addons/digest/data')
0 files changed, 0 insertions, 0 deletions
