If you just want one big query, then you will need to code it yourself 
and use $this->Profile->query() to run it.

Multiple queries is the price you pay for Cake's automation of 
relationships.  If you are worried about this for performance reasons, 
then I would suggest that you do some bench marks.  Work out how much 
each approach differs, then decide if its worth bothering with.

To me, one of the biggest benefits of using Cake is that I don't have to 
maintain mountains of SQL code.  For that price I will gladly pay for 
some extra server horse power if required.

Just my personal opinion of course.

Regards,
Langdon


> The problem is that when i do a findAll on the Users, it first runs a
> query that selects Users with left joined Profiles, then it runs a
> query for each Profile, and then one query for each Country in each
> Profile.
> So to select 2 Users it uses 5 queries.
> I would like to have one big query... or at least avoid the query that
> selectes the Profile since that is already selected in the Users query
> (with joins)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to