qapper.net

SELECT SUM(a.nBytesTotal) AS nBytesTotal, a.sensor, SUM(minCalc) / (UNIX_TIMESTAMP(MAX(a.dTUTCMax)) - UNIX_TIMESTAMP(MIN(a.dTUTCMin))) AS auslastungMin, SUM(avgCalc) / (UNIX_TIMESTAMP(MAX(a.dTUTCMax)) - UNIX_TIMESTAMP(MIN(a.dTUTCMin))) AS auslastungAvg, SUM(maxCalc) / (UNIX_TIMESTAMP(MAX(a.dTUTCMax)) - UNIX_TIMESTAMP(MIN(a.dTUTCMin))) AS auslastungMax FROM `tbInfoE2I` AS a WHERE a.dTUTCMax > UTC_TIMESTAMP - INTERVAL 1 HOUR AND sensor < 4 GROUP BY a.sensor UNION ALL ( SELECT SUM(a.nBytesTotal) AS nBytesTotal, a.sensor, SUM(infoMin * ctr) * 100 / (UNIX_TIMESTAMP(MAX(a.dTUTCMax)) - UNIX_TIMESTAMP(MIN(a.dTUTCMin))) AS auslastungMin, SUM(infoAvg * ctr) * 100 / (UNIX_TIMESTAMP(MAX(a.dTUTCMax)) - UNIX_TIMESTAMP(MIN(a.dTUTCMin))) AS auslastungAvg, SUM(infoMax * ctr) * 100 / (UNIX_TIMESTAMP(MAX(a.dTUTCMax)) - UNIX_TIMESTAMP(MIN(a.dTUTCMin))) AS auslastungMax FROM `tbInfoE3I` AS a WHERE a.dTUTCMax > UTC_TIMESTAMP - INTERVAL 3 DAY AND sensor BETWEEN 4 AND 8 GROUP BY a.sensor ) UNION ALL ( SELECT SUM(a.nBytesTotal) AS nBytesTotal, a.sensor, SUM(infoMin * ctr) * 100 / (UNIX_TIMESTAMP(MAX(a.dTUTCMax)) - UNIX_TIMESTAMP(MIN(a.dTUTCMin))) AS auslastungMin, SUM(infoAvg * ctr) * 100 / (UNIX_TIMESTAMP(MAX(a.dTUTCMax)) - UNIX_TIMESTAMP(MIN(a.dTUTCMin))) AS auslastungAvg, SUM(maxCalc) / (UNIX_TIMESTAMP(MAX(a.dTUTCMax)) - UNIX_TIMESTAMP(MIN(a.dTUTCMin))) AS auslastungMax FROM `tbInfoE4I` AS a WHERE a.dTUTCMax > UTC_TIMESTAMP - INTERVAL 1 WEEK AND sensor BETWEEN 9 AND 13 GROUP BY a.sensor ) UNION ALL ( SELECT SUM(a.nBytesTotal) AS nBytesTotal, a.sensor, SUM(infoMin * ctr) * 100 / (UNIX_TIMESTAMP(MAX(a.dTUTCMax)) - UNIX_TIMESTAMP(MIN(a.dTUTCMin))) AS auslastungMin, SUM(infoAvg * ctr) * 100 / (UNIX_TIMESTAMP(MAX(a.dTUTCMax)) - UNIX_TIMESTAMP(MIN(a.dTUTCMin))) AS auslastungAvg, SUM(maxCalc) / (UNIX_TIMESTAMP(MAX(a.dTUTCMax)) - UNIX_TIMESTAMP(MIN(a.dTUTCMin))) AS auslastungMax FROM `tbInfoE5I` AS a WHERE a.dTUTCMax > UTC_TIMESTAMP - INTERVAL 1 MONTH AND (sensor = 12 OR sensor = 20) GROUP BY a.sensor );14.4
0.014876127243