i am running below script to select list of users from my DB and pass it over to my service.
$qb = $this->getEntityManager()->createQueryBuilder(); $qb -> select('s') -> from('AppBundle\Entity\SubscriberDetails', 's') -> where($qb->expr()->not($qb->expr()->exists($qb1->getDQL()))) -> setMaxResults($numcampaigns) ; $subscribers = $qb->getQuery()->getResult();
WHERE
$qb1 = $this->getEntityManager()->createQueryBuilder();
$qb1
->select('send')
->from('AppBundle\Entity\Subscribers', 'send')
->where('DATE_FORMAT(now(), \'%e-%b-%Y\') - DATE_FORMAT(FROM_UNIXTIME(send.last_campaign), \'%e-%b-%Y\') <=360')
->andwhere('send.bounced <> 1')
->andwhere('send.complaint <> 1')
->andwhere('s.emailaddress = send.emailaddress');
Below scripts works for 30k users while i am trying to expand it for 300k users selection. When running 300k users i get below error:
6.0662 132446208 15. Doctrine\ORM\Internal\Hydration\ObjectHydrator->hydrateRowData()/Applications/MAMP/htdocs/mediaff/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:165 6.0663 132448496 16. Doctrine\ORM\Internal\Hydration\ObjectHydrator->getEntity()/Applications/MAMP/htdocs/mediaff/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:494 6.0663 132448496 17. Doctrine\ORM\UnitOfWork->createEntity() /Applications/MAMP/htdocs/mediaff/vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php:273 6.0663 132449488 18. ReflectionProperty->setValue() /Applications/MAMP/htdocs/mediaff/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:2586 6.0781 132445688 19. Symfony\Component\Debug\ErrorHandler::handleFatalError()/Applications/MAMP/htdocs/mediaff/vendor/symfony/symfony/src/Symfony/Component/Debug/ErrorHandler.php:0 6.0782 132434104 20. spl_autoload_call() /Applications/MAMP/htdocs/mediaff/vendor/symfony/symfony/src/Symfony/Component/Debug/ErrorHandler.php:613 6.0782 132434264 21. Symfony\Component\Debug\DebugClassLoader->loadClass()/Applications/MAMP/htdocs/mediaff/vendor/symfony/symfony/src/Symfony/Component/Debug/ErrorHandler.php:613
where second column is memory used i believe.
Any idea how can i overcome this issue. Any help will be highly appreciated.