How to implement a time series sampler in MySQL system?
I want to record the growth rate of values in columns of MySQL table.
What is the quickest开发者_Go百科 way to implement a sub-program that automatically writes the values to another table at given-time intervals? combination of stored procs / triggers / functions?
I have a table that gets over 2 million detailed rows/day.
I have a trigger that writes summary data to another table. I summarize the data into 5-minute "buckets" by converting the original datetime, yielding about 350K rows/day.
After a week, I have a cronjob that rolls the 5-minute buckets into hourly buckets, even further reducing storage to about 80K rows/day.
We use the summary data for reporting and also for longer storage.
It's a poor-man's RRD structure.
Hope that helps.
精彩评论