Skip to content

Instantly share code, notes, and snippets.

@webdevilopers
Created February 13, 2017 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webdevilopers/a0c7e16a416fa6d99ee8064b1f8f887b to your computer and use it in GitHub Desktop.
Save webdevilopers/a0c7e16a416fa6d99ee8064b1f8f887b to your computer and use it in GitHub Desktop.
OutOfMemoryException in PDOConnection using Doctrine iterate result
<?php
// 7041 rows with content being BLOB content - total table size ~ 2.4 GB
$instructionRepository = $this->getDoctrine()->getRepository('PlusquamContractBundle:Instruction');
$instructionQueryBuilder = $instructionRepository->createQueryBuilder('i')
->where('i.content IS NOT NULL')
->orderBy('i.id', 'desc');
$instructions = $instructionQueryBuilder->getQuery()->iterate();
?>
@mablae
Copy link

mablae commented Feb 13, 2017

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment