db
db copied to clipboard
Needs to refactor `Query::each()`
Query::each() returns data reader to get data row by row.
foreach ($query->each() as $row) {}
Current realization of the data reader reads batch of rows then read each row from the rows.
https://github.com/yiisoft/db/blob/e380ae2ffb6f3a466e6f168fafa93548e50f0d8c/src/Query/BatchQueryResult.php#L70-L85
If read the result of query row by row (instead of batch of rows), this will be more efficient and will use less memory.