Skip to content

Commit

Permalink
Fixed issue: High memory usage on db upgrade from older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Sep 18, 2014
1 parent d0c51fc commit ac074d1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions application/helpers/expressions/em_manager_helper.php
Expand Up @@ -8018,15 +8018,15 @@ private static function getConditionsForEM($surveyid=NULL, $qid=NULL)
}

$query = "SELECT DISTINCT c.*, q.sid, q.type
FROM conditions AS c
LEFT JOIN questions q ON c.cqid=q.qid
LEFT JOIN questions qa ON c.qid=qa.qid
FROM {{conditions}} AS c
LEFT JOIN {{questions}} q ON c.cqid=q.qid
LEFT JOIN {{questions}} qa ON c.qid=qa.qid
WHERE {$where} 1=1
UNION
SELECT DISTINCT c.*, q.sid, '' AS TYPE
FROM conditions AS c
LEFT JOIN questions q ON c.cqid=q.qid
LEFT JOIN questions qa ON c.qid=qa.qid
FROM {{conditions}} AS c
LEFT JOIN {{questions}} q ON c.cqid=q.qid
LEFT JOIN {{questions}} qa ON c.qid=qa.qid
WHERE {$where} c.cqid = 0";

$databasetype = Yii::app()->db->getDriverName();
Expand Down

0 comments on commit ac074d1

Please sign in to comment.