I have two entities with one-to-many relation using annotation in my DQL Query. What is the difference between those two queries?
1-
SELECT p, c FROM AcmeStoreBundle:Product p
JOIN p.category c
WHERE p.id = :id
2-
SELECT p, c FROM AcmeStoreBundle:Product p
JOIN AcmeStoreBundle:Category c
ON p.categoryid = c.id
WHERE p.id = :id
When I check the benchmark I found the second approach take less time. Can someone list the pros and cons for each way and when each one is useful?