I don't know if MySQL have this function, I will check... eventually I should make a cron job I suppose...
Do you think that make a lighter table be a good improvement using more than 70.000 records ?
Actually I am running another query on the same table where I have just added the index to date field, is it something like this:
SELECT DISTINCT a.ida, a.name, Sum(c.click) AS AddClick
FROM autors AS a, clicks_autor AS c
WHERE a.ida = c.ida
AND (TO_DAYS(CURDATE()) - TO_DAYS(c.date)) <= 15
GROUP BY a.ida, a.name
ORDER BY AddClick DESC
LIMIT 10;
this query is wasting a lot of resources, is it good SQL enought in your opinion ?
The strange thing is that it is not using the new index on date field :-? ... so it is processing all rows of the ckicks table :-(
Do you know the reason or the solution ?
...my SQL knowledge is not so good..
Thank you for any help about !