I'm no expert, but wouldn't this move load from the mysql box to the web server box as cake would need to resolve all the relationships after it has retrieved the data?
And while we're at it, wouldn't multiple queries on the database where 1 would suffice further hurt performance at the database level? I would suggest keeping the joins, and then run the queries through mysql's EXPLAIN command to see if you can optomize the indexes on your tables. then aggressively cache the returned data to reduce the amount of hits to the database...especially on queries which are known to be slow, or on highly trafficked but not often updated pages. On Thu, Mar 17, 2011 at 11:25 PM, Elte Hupkes <[email protected]> wrote: > Is it possible to specify an option in Cake that will make it use only > separate queries rather than joins? For example, in a has many > association, fetch the parent record with a separate query rather than > left-join it? > > Someone I'm developing for is running MySQL in a cluster; and > apparently the guys hosting it have told him that joins hurt > performance, since the data is distributed over several data nodes and > a join can require it to fetch data from several nodes. His idea: get > rid of the joins and use separate queries instead. I myself am not yet > sure how much of this is true (if you're getting the data anyway, does > it matter if you do it in a separate query or let MySQL do it in a > join?), but either way I am curious if it can be done. > > -- > Our newest site for the community: CakePHP Video Tutorials > http://tv.cakephp.org > Check out the new CakePHP Questions site http://ask.cakephp.org and help > others with their CakePHP related questions. > > > To unsubscribe from this group, send email to > [email protected] For more options, visit this group > at http://groups.google.com/group/cake-php > -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
