Hi,
I measure the load on DNS servers every minute and store that into an SQL DB. I want to draw a chart of the load for the last 48 hours. That's 69120 (48*24*60) data points but my chart's only 800 pixels wide so to make things faster I would like my SQL query to return only ~800 data points.
It's seems to me like a pretty standard thing to do, but I've been searching the web and in books for such a thing for a while now and the closest I was able to find was a rolling average. What I'm looking for a more of a "segmented average": divide the 69120 data points in ~800 segments, then average each segment.
My SQL table is:
CREATE TABLE measurements (
ip int, measurement_time int, queries int, query_time float
)
My query looks like this
SELECT measurement_time, ip, queries FROM measurements WHERE measurement_time>(time()-172800)
Thanks a lot!