Rewrite file selection for performance gain