i am developing with cakephp (2.4.7) and i am using the containable option.
I have a few find statements with about 15 Tables/Models inside the containable array and my query log shows about 60-100 queries.
Should i use joins instead of containable due to better performance?
My site requires high performance standard.
And is it possible to join automatically based on the linking models like containable, or do i have to set up the joins manually like:
Example:
$this->Message->find('all', array(
'joins' => array(
array(
'table' => 'users',
'alias' => 'UserJoin',
'type' => 'INNER',
'conditions' => array(
'UserJoin.id = Message.from'
)
)
),
'conditions' => array(
'Message.to' => 4
),
'fields' => array('UserJoin.*', 'Message.*'),
'order' => 'Message.datetime DESC'
));
Guide me the correct way to achieve my objective.