Investigated in zabbix server v 3.0.0 alpha4
Suppose we have numeric items which have keep history or keep trends set to 0 days.
According to documentation, zabbix server will not store history or trends if corresponding keep parameter is 0.
But housekeeper process still each time is trying to delete data for such items, disregarding that they could not store any data. From 2nd and for following executions:
note that the time stamps in "clock<1445961215" conditions are always
= now(), which is sort of correct.
The same happens if you change some item "keep" parameter to 0 days when server is running - those SQLs will start to appear.
One interesting point that such unneeded delete SQLs performed starting from 2nd housekeeper execution only.
I've tested another case - when an item has history/trends data, but on server start the items settings is 0 for keep history or trends.
In this case housekeeper correctly starts to delete already outdated data in 4*HousekeepingFrequency batches (note, from 1st housekeeper execution).
But would be good if it would stop to do unneeded deletions if it deleted everything (has deleted 0 rows during last batch) and the item has 0 days in settings.
Yeah, I understand that this request will improve housekeeper just a little, but still ...
I always look with suspicion on unneeded SQL queries, and it has happened this time too
Also, taking into account that those deletes performed from 2nd housekeeper execution only, I suppose that there could be a small bug.