EllisLab/CodeIgniter — Issue #945: Memory using of DB_result
Author: amccausl
Created: 2012-01-19 17:18:24+00:00
State: open

I need to do a CSV dump of a rather large query. I'm using a Codeigniter db query, db_util->csv_from_result and force_download. The way DB results are stored and processed makes the memory requirements too high (entire result set is stored in DB_Result and as string from csv_from_result, when they should really be able to stream directly from DB to download with minimal memory requirements.

Potential solutions:

1) adding a new method to the DB_result that enables the standard iterator style results fetch, change db_util to use this method if the result has not already been initialized
2) manually do CSV dump and force_download of the results in a streaming manner

I need to implement a solution on my end which, but need to know if the same fix would be desired as a patch, or if I should just hack it into my version.

Thanks,