Improve performance of a subscriber listing on MySQL 5.5 and lower [MAILPOET-867]
This commit is contained in:
@ -787,20 +787,13 @@ class Subscriber extends Model {
|
|||||||
|
|
||||||
static function withoutSegments($orm) {
|
static function withoutSegments($orm) {
|
||||||
return $orm->select(MP_SUBSCRIBERS_TABLE.'.*')
|
return $orm->select(MP_SUBSCRIBERS_TABLE.'.*')
|
||||||
->rawJoin(
|
->whereRaw(
|
||||||
'LEFT OUTER JOIN (
|
MP_SUBSCRIBERS_TABLE . '.id NOT IN (
|
||||||
SELECT `subscriber_id`
|
SELECT `subscriber_id`
|
||||||
FROM '.MP_SUBSCRIBER_SEGMENT_TABLE.'
|
FROM '.MP_SUBSCRIBER_SEGMENT_TABLE.'
|
||||||
WHERE `status` = "'.self::STATUS_SUBSCRIBED.'"
|
WHERE `status` = "'.self::STATUS_SUBSCRIBED.'"
|
||||||
)',
|
)'
|
||||||
array(
|
);
|
||||||
MP_SUBSCRIBERS_TABLE.'.id',
|
|
||||||
'=',
|
|
||||||
MP_SUBSCRIBER_SEGMENT_TABLE.'.subscriber_id'
|
|
||||||
),
|
|
||||||
MP_SUBSCRIBER_SEGMENT_TABLE
|
|
||||||
)
|
|
||||||
->whereNull(MP_SUBSCRIBER_SEGMENT_TABLE.'.subscriber_id');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static function createMultiple($columns, $values) {
|
static function createMultiple($columns, $values) {
|
||||||
|
Reference in New Issue
Block a user