Consider the following example
$q = Doctrine::getTable('User')->createQuery('u')
->where('u.username = ?', 'test');
If another related table exists (let’s say a separate address table connected by username) this is also loaded in the results. How can I temporarily disable this relationship so that the query doesn’t do any unnecessary joins? I don’t want to remove it permanently because it’s useful in other pages.
Don’t worry about that, The doctrine use lazy loading for relations, so the sql for join will only be executed when you fetch the relations.