fix: Increased speed of loading syslog pages. (#6433)

* Increased speed of loading syslog pages.
I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md.

* moved schema 186->189
This commit is contained in:
Tim Stallard
2017-05-03 22:41:55 +01:00
committed by Neil Lathwood
parent 6c555c6fb5
commit 6b2ae00e27
4 changed files with 4 additions and 1 deletions

View File

@@ -200,6 +200,7 @@ LibreNMS contributors:
- Jonathan Price <jonathan@jonathanprice.uk> (Pricetx) - Jonathan Price <jonathan@jonathanprice.uk> (Pricetx)
- Remy de Boer <remy@slowpoke.nl> (remydb) - Remy de Boer <remy@slowpoke.nl> (remydb)
- Ben Klang <ben@alkaloid.net> (bklang) - Ben Klang <ben@alkaloid.net> (bklang)
- Tim Stallard <code@timstallard.me.uk> (TimStallard)
- Svenn D'Hert <admin at svennd.be> (svennd) - Svenn D'Hert <admin at svennd.be> (svennd)
- Dominik Bay <db@rrbone.net> (eimann) - Dominik Bay <db@rrbone.net> (eimann)
- Nick Peelman <nick@peelman.us> (peelman) - Nick Peelman <nick@peelman.us> (peelman)

View File

@@ -42,7 +42,7 @@ if ($_SESSION['userlevel'] >= '5') {
$param = array_merge(array($_SESSION['user_id']), $param); $param = array_merge(array($_SESSION['user_id']), $param);
} }
$count_sql = "SELECT COUNT(timestamp) $sql"; $count_sql = "SELECT COUNT(*) $sql";
$total = dbFetchCell($count_sql, $param); $total = dbFetchCell($count_sql, $param);
if (empty($total)) { if (empty($total)) {
$total = 0; $total = 0;

View File

@@ -1454,6 +1454,7 @@ syslog:
datetime: { Name: datetime, Columns: [timestamp], Unique: false, Type: BTREE } datetime: { Name: datetime, Columns: [timestamp], Unique: false, Type: BTREE }
device_id: { Name: device_id, Columns: [device_id], Unique: false, Type: BTREE } device_id: { Name: device_id, Columns: [device_id], Unique: false, Type: BTREE }
program: { Name: program, Columns: [program], Unique: false, Type: BTREE } program: { Name: program, Columns: [program], Unique: false, Type: BTREE }
priority_level: { Name: priority_level, Columns: [priority, level], Unique: false, Type: BTREE }
tnmsneinfo: tnmsneinfo:
Columns: Columns:
device_id: { Field: device_id, Type: int(11), 'Null': false, Default: null, Extra: '' } device_id: { Field: device_id, Type: int(11), 'Null': false, Default: null, Extra: '' }

1
sql-schema/189.sql Normal file
View File

@@ -0,0 +1 @@
ALTER TABLE syslog ADD INDEX priority_level (priority, level);