php - How to get good performances when using symfony 2 ACL system with a large number of object? -
in our project using symfony 2 acl system control access entities stored in database (postgresql).
everything works fine until want check permission on large quantity of object (a few hundreds). performance getting bad. on pages number of query database above 4000. number in fact in direct relation number of entities in our database. more grows more query on page need done.
is there way check user's authorization on many object while conserving descent performance (keeping number of query db low)?
there way load acl data related 1 or many different entities. system tries load them in small amount of query , keeps data around can reused without going database again.
private function loadblogpostsacls($blogpostrepository) { $oids = array(); foreach ($blogpostrepository->findby(array(), array('date' => 'asc')) $blogpost) { $oids[] = objectidentity::fromdomainobject($blogpost); } $this->aclprovider->findacls($oids); }
Comments
Post a Comment