Re: range columns including datetime column
Posted by:
Rick James
Date: August 19, 2012 10:55PM
> but period is (5-hourly, 4-daily, 3-weekly, 2-monthly, 1-yearly)
I would consider 5 separate tables, with separate purge policies.
With separate tables, you can change the datatypes, and possibly the number of columns, to be more appropriate. Hourly: DATETIME, Daily/Weekly/Monthly: DATE, Year: YEAR. Also, some fields may shift between MEDIUMINT to INT (etc.) Smaller datatypes --> more cacheable --> faster.
Usually Weekly stuff can be fetched directly from daily, and yearly directly from Monthly. This would cut it back to only 3 tables.
(Sorry, Mattias, for stepping on the new compound range feature, but I think it is inappropriately used here.)