summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 91db029)
raw | patch | inline | side by side (parent: 91db029)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 27 Nov 2007 10:30:15 +0000 (10:30 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 27 Nov 2007 10:30:15 +0000 (10:30 +0000) |
rearranged SQL statement. Should be much faster now.
- Slow string operations were done, before fast integer operations.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7904 594d385d-05f5-0310-b6e9-bd551577e9d8
- Slow string operations were done, before fast integer operations.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7904 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/addons/logview/class_gosa_logview.inc | patch | blob | history |
diff --git a/plugins/addons/logview/class_gosa_logview.inc b/plugins/addons/logview/class_gosa_logview.inc
index a3cb6ede6886cb37e31cd739d681e5a640c673c3..a48d5ffe356486b5bb93b04861b879c45a721754 100644 (file)
$start = $date_select_[$this->time];
+
+ $sql_regex =trim(preg_replace("/\*/","%",$this->regex));
+ $sql_regex = "%".trim($sql_regex,"%")."%";
/* Order setting */
if ($this->sort_direction == "down"){
$end= date ("YmdHis",time());
$query_base= " FROM
gosa_log
- WHERE
- result like '".preg_replace("/\*/","%",$this->regex)."' ";
+ WHERE
+ timestamp <= $end AND timestamp >= $start
+ AND
+ result like '".$sql_regex."' OR user like '".$sql_regex."' ";
if($this->action != "!ALL"){
";
}
- $query_base .="
- AND
- timestamp <= $end AND timestamp >= $start";
-
/* Get number of entries */
$query= "SELECT COUNT(*)".$query_base.";";
$result = mysql_query($query);