subqueries where appropriate Use ARRAY hydration when possible Avoid lazy-loading in most cases Also look into database optimization (index columns, de-normalization, storage engine, etc.) This also applies to Doctrine 2.0
the results on-demand in an iteration COUNT(inv.Items) ... GROUP BY inv.Items COUNT relations $item1->persist(); $item2->persist(); $entityManager->flush(); Smart batch saving