th_db compacting added