From 27bfdedb690e9bd705b78b4e5c41900b3a7afb6e Mon Sep 17 00:00:00 2001
From: diosmosis <benaka@piwik.pro>
Date: Thu, 12 Feb 2015 17:08:08 -0800
Subject: [PATCH] Refs #6436, #7112 fix performance regression, assume there
 are not duplicates in DB when doing segment query foraction since group by in
 sub-query is slow.

---
 core/Tracker/TableLogAction.php | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/core/Tracker/TableLogAction.php b/core/Tracker/TableLogAction.php
index 4308f042f8..fe620035d7 100644
--- a/core/Tracker/TableLogAction.php
+++ b/core/Tracker/TableLogAction.php
@@ -61,10 +61,7 @@ class TableLogAction
     {
         // now, we handle the cases =@ (contains) and !@ (does not contain)
         // build the expression based on the match type
-        $sql = 'SELECT MIN(idaction) AS idaction FROM ' . Common::prefixTable('log_action') . ' WHERE %s AND type = ' . $actionType . ' )'
-             . ' GROUP BY name, hash, type'; // group by is to avoid possible case of duplicates in log_action table
-                                             // (duplicates can exist if php tracker fails right after inserting a duplicate in
-                                             //  Tracker\Model::insertNewAction())
+        $sql = 'SELECT idaction FROM ' . Common::prefixTable('log_action') . ' WHERE %s AND type = ' . $actionType . ' )';
 
         switch ($matchType) {
             case '=@':
-- 
GitLab