hey guys, ive posted some time back regarding this issue, however this is another problem that i have encountered and need help in. it'll be great if you guys could helped me out. ok here goes...
SELECT h.host, i.key_, FROM_UNIXTIME(hs.clock) when_ , hs.value
FROM hosts AS h
JOIN items AS i ON h.hostid = i.hostid
JOIN history AS hs ON hs.itemid = i.itemid
WHERE h.host = 'host name' AND i.key_ = 'system.cpu.util[,idle,avg5]'
AND hs.clock BETWEEN UNIX_TIMESTAMP('2009-07-01 00:00:00')
AND UNIX_TIMESTAMP('2009-07-28 00:00:00')
ORDER BY hs.clock DESC;
the above is my sql query on cpu utilization. The problem is that, my company takes in new data every 30 seconds which its not feasible, imagine a month whole of data when i query. So how do i tweak the system, or the query so that it only retrieves data in 15 mins interval or even longer? please help out professionals...
SELECT h.host, i.key_, FROM_UNIXTIME(hs.clock) when_ , hs.value
FROM hosts AS h
JOIN items AS i ON h.hostid = i.hostid
JOIN history AS hs ON hs.itemid = i.itemid
WHERE h.host = 'host name' AND i.key_ = 'system.cpu.util[,idle,avg5]'
AND hs.clock BETWEEN UNIX_TIMESTAMP('2009-07-01 00:00:00')
AND UNIX_TIMESTAMP('2009-07-28 00:00:00')
ORDER BY hs.clock DESC;
the above is my sql query on cpu utilization. The problem is that, my company takes in new data every 30 seconds which its not feasible, imagine a month whole of data when i query. So how do i tweak the system, or the query so that it only retrieves data in 15 mins interval or even longer? please help out professionals...