Fix rake task getting killed error
Manually call GC.start
unwrap csv writer
try and just append to the file on the loops
Use update_column instead of update_attribute