C++ daemon for resorting and preparing MySQL rows ( table history, hashing and some optimization method )