How do you optimize the DB queries made by sonata admin in the list and edit views ?
i LeftJoined some queries that i made using the querybuilder in my entity repository , this already helped a lot, brought my queries down from 100+ to about 22.
But the remaining queries are the ones that happen automatically by using the formbuilder and listmapper.
Is there anyway i can further optimize the queries made by those classes ? im not even sure at this point where the queries are made... i tried to overwrite the findBy, findAll methods of the repository but they seem to use something like
$persister = $this->_em->getUnitOfWork()->getEntityPersister($this->_entityName);
return $persister->load($criteria, null, null, array(), 0, 1, $orderBy);
Not sure how i can add a join statement to that...
And i guess it's not just in the sonata admin but also for queries that i use in the front-end that use the built-in EntityRepository find, findAll, findOneBy etc... functions.