Export to CSV file is very slow