mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-26 11:19:26 +02:00
Enhanced search performance in disk logstream, specially when filtering in LARGE files!
This commit is contained in:
parent
2b7d1d790b
commit
7bf38af1a4
@ -656,8 +656,8 @@ abstract class LogStream {
|
||||
// "+",
|
||||
);
|
||||
|
||||
$this->_filters[$tmpKeyName][$iNum][FILTER_VALUE] = preg_replace( $searchArray, $replaceArray, $this->_filters[$tmpKeyName][$iNum][FILTER_VALUE] );
|
||||
// $this->_filters[$tmpKeyName][$iNum][FILTER_VALUE] = str_replace( '+', ' ', $this->_filters[$tmpKeyName][$iNum][FILTER_VALUE]);
|
||||
$this->_filters[$tmpKeyName][$iNum][FILTER_VALUE] = preg_replace( $searchArray, $replaceArray, $this->_filters[$tmpKeyName][$iNum][FILTER_VALUE] );
|
||||
// ---
|
||||
}
|
||||
|
||||
|
@ -523,7 +523,9 @@ class LogStreamDisk extends LogStream {
|
||||
*/
|
||||
public function GetLastPageUID()
|
||||
{
|
||||
// Obtain last UID if enough records are available!
|
||||
// Only perform lastUID scan if there are NO filters, for performance REASONS!
|
||||
if ( $this->_filters != null )
|
||||
return UID_UNKNOWN;
|
||||
|
||||
// Helper variables
|
||||
$myuid = -1;
|
||||
|
@ -230,10 +230,6 @@ if ( isset($content['Sources'][$currentSourceID]) )
|
||||
// TODO Implement ORDER
|
||||
$stream->SetReadDirection($content['read_direction']);
|
||||
|
||||
// Read First and LAST UID's before start reading the stream!
|
||||
$content['uid_last'] = $stream->GetLastPageUID();
|
||||
$content['uid_first'] = $stream->GetFirstPageUID();
|
||||
|
||||
// Set current ID and init Counter
|
||||
$uID = $content['uid_current'];
|
||||
$counter = 0;
|
||||
@ -830,9 +826,12 @@ if ( isset($content['Sources'][$currentSourceID]) )
|
||||
// Increment Counter
|
||||
$counter++;
|
||||
} while ($counter < $content['ViewEntriesPerPage'] && ($ret = $stream->ReadNext($uID, $logArray)) == SUCCESS);
|
||||
|
||||
//print_r ( $content['syslogmessages'] );
|
||||
|
||||
// Move below processing - Read First and LAST UID's before start reading the stream!
|
||||
$content['uid_last'] = $stream->GetLastPageUID();
|
||||
$content['uid_first'] = $stream->GetFirstPageUID();
|
||||
|
||||
if ( $content['main_recordcount'] == -1 || $content['main_recordcount'] > $content['ViewEntriesPerPage'] )
|
||||
{
|
||||
// Enable Pager in any case here!
|
||||
|
Loading…
x
Reference in New Issue
Block a user