Hmm I think it is something with your current configuration... Just did a test with salaries
table with 2.9m records and 100mb of data.
$start = microtime(true);
$data = \Models\Salaries::find([
'limit' => 50000
]);
foreach ($data as $item) {
echo 'Salary: '. $item->salary . ' from '. $item->date_1 .' to '. $item->date_2 . '<br/>';
}
echo 'Time: ', microtime(true) - $start;
exit;
// Results with version 2.x
...
...
Salary: 78908 from 1995-09-14 to 1996-09-13
Salary: 83245 from 1996-09-13 to 1997-09-13
Time: 0.74881386756897
// Results with version 3.x
...
...
Time: 5.0550677776337
Sample data: https://launchpad.net/test-db/+download
Please note: I just installed version 3.x to do this test, I did not yet have time to dig into the changes and to update my codebase. Perhaps there is something that I'm missing yet, but still the results are far from ~40 seconds.
Also note: Doing my tests on a project which has other services and functionalities going on, it's not just a plain script file.
UPDATE: Same test, but using the QueryBuilder:
$data = $this->modelsManager->createBuilder()
->columns([
'salary',
'date_1',
'date_2'
])
->from('Models\Salaries')
->limit(50000)
->getQuery()->execute();
// Results
...
Time: 0.45169997215271