Hi !

i have a little problem with de containable behaviour. In the sql log,
i see that cakephp is doing too many queries than it should do :

13      SELECT `Chef`.`id`, `Chef`.`name`, `Chef`.`prenom` FROM
`ressources` AS `Chef` WHERE `Chef`.`id` = 1            1       1       0
14      SELECT `Chef`.`id`, `Chef`.`name`, `Chef`.`prenom` FROM
`ressources` AS `Chef` WHERE `Chef`.`id` = 8            1       1       0
15      SELECT `Chef`.`id`, `Chef`.`name`, `Chef`.`prenom` FROM
`ressources` AS `Chef` WHERE `Chef`.`id` = 8            1       1       0
16      SELECT `Chef`.`id`, `Chef`.`name`, `Chef`.`prenom` FROM
`ressources` AS `Chef` WHERE `Chef`.`id` = 1            1       1       0
17      SELECT `Chef`.`id`, `Chef`.`name`, `Chef`.`prenom` FROM
`ressources` AS `Chef` WHERE `Chef`.`id` = 8            1       1       0
18      SELECT `Chef`.`id`, `Chef`.`name`, `Chef`.`prenom` FROM
`ressources` AS `Chef` WHERE `Chef`.`id` = 8            1       1       0
19      SELECT `Chef`.`id`, `Chef`.`name`, `Chef`.`prenom` FROM
`ressources` AS `Chef` WHERE `Chef`.`id` = 8            1       1       0
20      SELECT `Chef`.`id`, `Chef`.`name`, `Chef`.`prenom` FROM
`ressources` AS `Chef` WHERE `Chef`.`id` = 1            1       1       0
21      SELECT `Chef`.`id`, `Chef`.`name`, `Chef`.`prenom` FROM
`ressources` AS `Chef` WHERE `Chef`.`id` = 8            1       1       0
22      SELECT `Chef`.`id`, `Chef`.`name`, `Chef`.`prenom` FROM
`ressources` AS `Chef` WHERE `Chef`.`id` = 8            1       1       0
23      SELECT `Chef`.`id`, `Chef`.`name`, `Chef`.`prenom` FROM
`ressources` AS `Chef` WHERE `Chef`.`id` = 8

this happens when a use :

'contain' => array('Chef' => array => fields('id', 'name', 'prenom'))

Is there any way to cache the first result, so cake won't look for a
user it already fetched ?

thanks !
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to