Giving Fatal Error in memory allocation for query reading more than 20000 records from the database and also its taking too much of time to load
So please help us good suggestion to export more than 20000 records.
If you are exporting that many records as Excel then the issue will be more bad than memory limit.
If you are exporting data to CSV via the PHP script then you can use the following
set_time_limit(6000); ini_set("memory_limit", -1);
The first one will set the script limit and the 2nd one will erase the memory issue.
But its always good to avoid exporting or importing at once with huge data set, but I agree sometime we have no choice but to do as per the requirement.
Just allocate more memory and time. The default are usually low anayway. These parameters are set in php.ini, or at runtime with php. Below for setting first of all in php.
ini_set('memory_limit','300M'); // mem
ini_set('max_execution_time', 3000); // time
It might however be smarter to export smaller chunks of the data. It is a more "correct" way to do this. But i realise that for such things as a one time operation/export etc, a large dump and more memory might be desirable.