I have a query that looks like this:
My user entity has a one-to-one relation that looks like this:
/**
* @var UserProfile
*
* @ORM\\OneToOne(targ
It seems that this is a open issue in Doctrine, see also
4.7.1. Why is an extra SQL query executed every time I fetch an entity with a one-to-one relation?
If Doctrine detects that you are fetching an inverse side one-to-one association it has to execute an additional query to load this object, because it cannot know if there is no such object (setting null) or if it should set a proxy and which id this proxy has. To solve this problem currently a query has to be executed to find out this information.
Source