mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-25 18:59:12 +02:00
Added some performance tweaks into mysql db driver, which will make searching for strings within messages faster.
This commit is contained in:
parent
69089e7543
commit
5c43460fdd
@ -432,6 +432,10 @@ class LogStreamDB extends LogStream {
|
||||
{
|
||||
global $querycount, $dbmapping;
|
||||
$szTableType = $this->_logStreamConfigObj->DBTableType;
|
||||
|
||||
// Only perform query if row counting is enabled!
|
||||
if ( strlen($this->_SQLwhereClause) > 0 && !$this->_logStreamConfigObj->DBEnableRowCounting )
|
||||
return $this->_firstPageUID;
|
||||
|
||||
$szSql = "SELECT MAX(" . $dbmapping[$szTableType][SYSLOG_UID] . ") FROM " . $this->_logStreamConfigObj->DBTableName . $this->_SQLwhereClause;
|
||||
$myQuery = mysql_query($szSql, $this->_dbhandle);
|
||||
@ -461,6 +465,10 @@ class LogStreamDB extends LogStream {
|
||||
global $querycount, $dbmapping;
|
||||
$szTableType = $this->_logStreamConfigObj->DBTableType;
|
||||
|
||||
// Only perform query if row counting is enabled!
|
||||
if ( strlen($this->_SQLwhereClause) > 0 && !$this->_logStreamConfigObj->DBEnableRowCounting )
|
||||
return $this->_lastPageUID;
|
||||
|
||||
$szSql = "SELECT MIN(" . $dbmapping[$szTableType][SYSLOG_UID] . ") FROM " . $this->_logStreamConfigObj->DBTableName . $this->_SQLwhereClause;
|
||||
$myQuery = mysql_query($szSql, $this->_dbhandle);
|
||||
if ($myQuery)
|
||||
@ -1097,6 +1105,9 @@ class LogStreamDB extends LogStream {
|
||||
// Append precreated where clause
|
||||
$sqlString .= $this->_SQLwhereClause;
|
||||
|
||||
// Output SQL Query into DEBUG
|
||||
// OutputDebugMessage( "CreateSQLStatement result: " . $sqlString );
|
||||
|
||||
// Append ORDER clause
|
||||
if ( $this->_readDirection == EnumReadDirection::Forward )
|
||||
$sqlString .= " ORDER BY " . $dbmapping[$szTableType][$szSortColumn];
|
||||
|
Loading…
x
Reference in New Issue
Block a user