I got the problem when i was trying to paginate results of big query with several joins and groupBy inside. Part of my code here:
$lots = Lot::select('lots.id', 'lots.name', 'lots.slug', 'lots.description', 'lots.customer as lot_customer',
'lots.created_at', 'lots.measure', 'lots.delivery_place', 'lots.amount as real_amount', 'lots.amount')
->leftJoin('tenders', 'tenders.id', '=', 'lots.tender_id')
->leftJoin('customers', 'lots.customer_id', '=', 'customers.id')
->groupBy('lots.id')
->paginate(25);
I had 420650 - total records in database, but for pagination i wanted to show only 25 records per page. I got message:
Allowed memory size exhausted (tried to allocate 16777224 bytes)...
If you have way to resolve such problem, please share. Thank you!