Vote count:
0
Currently, I am experimenting with an EAV+Single Table Inheritance approach in Doctrine 2.
I have a Base-Class that has multiple Values and I have multiple Sub-Classes of the Base-Class. The Sub-Classes are related.
In the following CodeExample all Entities are SubClasses of the BaseClass except for Value:
$qb = $this->createQueryBuilder('p')
->select('p', 'rip', 'rs', 'c', 'pv', 'ripv', 'rsv', 'cv')
->leftJoin("p.revisionsInProject", "rip")
->leftJoin("rip.revisionState", "rs")
->leftJoin("rs.component", "c")
->leftJoin("p.values", "pv")
->leftJoin("c.values", "cv")
->leftJoin("rs.values", "rsv")
->leftJoin("rip.values", "ripv")
->where("p.id = '".$id."'");
$q = $qb->getQuery();
return $q->getArrayResult();
However, this Query is super slow and also massively slows down my Controller Reaction time (From about 84ms down to 1818ms) the Query itself is not too bad in the DB (From about 10ms down to 60).
Am I doing something wrong or is there any better version of the Query. Especially since I only query two tables (p,c,rs,rip are all in the same table due to Single Table Inheritance).
The Code itself can viewed at Github
asked 43 secs ago
Effective Query - EAV+Single Table Inheritance - Doctrine2
Aucun commentaire:
Enregistrer un commentaire