1
0
mirror of https://github.com/agdsn/ancient-weatherstation.git synced 2026-06-19 23:07:59 +00:00

heavy database optimizions

git-svn-id: file:///home/jan/tmp/wetterstation/trunk@243 dd492736-c11a-0410-ad51-8c26713eaf7f
This commit is contained in:
jan
2008-03-20 17:09:11 +00:00
parent cbd3151a56
commit 53e83e9fd4
8 changed files with 117 additions and 83 deletions
@@ -126,7 +126,7 @@ class Wind{
/* liefert den Durchschnittswert in einem bestimmtem Interval */
function _getAverage($interval){
$avQuery = "SELECT avg(geschw) as average, count(geschw) as count FROM ".$this->table." WHERE sens_id=".$this->sensId." AND timestamp>(current_timestamp - INTERVAL '".$interval."')";
$avQuery = "SELECT avg(geschw) as average, count(geschw) as count FROM ".$this->table." WHERE sens_id=".$this->sensId." AND timestamp>(select (current_timestamp - INTERVAL '".$interval."'))";
$avData = $this->connection->fetchQueryResultLine($avQuery);
return $avData;
}