Reduce memory consumption in synclegacydb