Currently I’m using something like
$records = table::model()->findAll($criteria);
foreach ($records as $record) {
// do the processing here
}
But with a table having millions of records it’s simply impossible or inappropriate to load the whole table into memory. What’s the best practice to process all the records from the table but at a given time having just several records in the memory? (Let’s assume, processing time doesn’t matter)