re-build databases with proper indexes