mysql statement in model/sync.php

Please ignore the diff with preloads modifications.