cake-php@googlegroups.com
[Top] [All Lists]

Re: My App is Getting too Slow

Subject: Re: My App is Getting too Slow
From: Jon Bennett
Date: Sat, 10 Apr 2010 16:28:53 +0100
Hi Ayman,

> var $hasOne = array("MODEL");

^ looks ok

> var $hasMany =
> array("MODEL","MODEL","MODEL","MODEL","MODEL","MODEL","MODEL","MODEL","MODEL","MODEL","MODEL","MODEL","MODEL","MODEL"=>array("order"=>"MODEL.created
> ASC"));

^ looks ok

>        var $belongsTo = array(
>                                'MODEL', MODEL', 'MODEL', 'MODEL', 'MODEL',
>                                'Source' => array(
>                                'className' => 'Source',
>                                'foreignKey' => 'source_id'
>                                ),
>                                'SubSource' => array(
>                                'className' => 'Source',
>                                'foreignKey' => 'sub_source_id'
>                                ),
>                'Staff' => array(
>                                'className' => 'Staff',
>                                'foreignKey' => 'staff_id'
>                                ),
>                'DelegatedTo' => array(
>                                'className' => 'Staff',
>                                'foreignKey' => 'delegated_to'
>                                ) );
>

^ Looks wrong - you have MODEL MODEL MODEL then source, is that
actually what you have?

> So as you can see there a a number of few models attached. And I am
> still expecting this to increase... but this shouldn't be a problem
> too cuz I am using containable

No, the models are all connected when the app is instanciated,
containable only affects things when you're querying the database.

Remove some associations to see if that fixes it. If it does, rethink
you're data model or look into the lazy loading behaviour.

Cheers,

Jon

-- 
jon bennett - www.jben.net - blog.jben.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe, reply using "remove me" as the subject.

<Prev in Thread] Current Thread [Next in Thread>