I have a hits table with millions of records. I need to show some charts on the data of the last month.
Does the solution of create a view something like :
CREATE VIEW ReportMonth AS SELECT * FROM Report
WHERE DayDate > DATE_SUB(CONCAT(CURDATE(), ' 00:00:00'), INTERVAL 30
DAY)
is good in terms of performance ,
Is there a better solution like cron that create this table every some hours ?
thanks