When using CakePhp would it be advisable to set recursive = -1 in the AppModel class and then use the Containable Behaviour whenever you need a deeper da开发者_C百科ta relationship?
I believe this would give my applications the best chance of avoiding database related sluggish performance but is the methodology sound?
Thanks
Leo
I use the Containable behaviour on every query. If there is no need for a deeper relationship I use $params['contain'] = array();
-> I don't use recursive at all anymore
leo i see what you are trying to do, and its a pretty good idea, but what i prefer to do on all my relations is set the fields for each relation, so i would just pull the name and id.
this way you have the data and the joins are not to bad.
精彩评论