Hi Jim,
Thanks for the information.
You are correct about the low resolution tables only being populated if you run the hourly cron script. I don't believe the MAX_ROWS table option is relevant here. That won't actually enforce a limit on the size of the tables. Here's what the MySQL documentation says about MAX_ROWS:
The maximum number of rows you plan to store in the table.
This is not a hard limit, but rather a hint to the storage
engine that the table must be able to store at least this many
rows.
Source:
http://dev.mysql.com/doc/refman/5.1/en/create-table.htmlIn fact, the MAX_ROWS value in the LMT schema is 2,000,000,000, which is about half the maximum allowed value for MAX_ROWS. I think this means it's there to tell the storage engine that the table will potentially get very big.
You said that an option to purge old data would be a reasonable addition to the aggregation cron job script. I agree that the functionality should be added to LMT, but maybe it could be added as a separate shell script that could be set up as a cron job. I'm thinking a shell script that does something like this would do the trick:
#!/bin/sh
# Delete all MDS_OPS_DATA before a given time
TIMESTAMP="2013-10-16 00:00:00"
mysql --password=$(cat /etc/lmt/rwpasswd) -e "DELETE MDS_OPS_DATA FROM MDS_OPS_DATA INNER JOIN TIMESTAMP_INFO ON MDS_OPS_DATA.TS_ID=TIMESTAMP_INFO.TS_ID WHERE TIMESTAMP < '$TIMESTAMP';"
I think this would be useful for deleting the raw data which gets added every 5 seconds. A script could also be written that deletes aggregated data, and that could be set up to run less frequently as a cron job. I suppose it's important to also keep old data around long enough for the lmt_agg.cron script to aggregate it into the lower resolution tables. What do you think?
-Ryan