Re: Optimising cake
If you just want that single field, use the Model::field() function. $this->StockedItem.id = $stock_item_id; $stocked_item_price = $this->StockedItem->field('unit_price'); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Optimising cake
Also look at the query caching - If you've already queried the model before (maybe in a seperate controller using requestAction), if you make the two queries the exact same cake automatically eliminates one whole query due to caching. Because of this, it is occassionally faster to make a second call without restricting recursive or limiting fields --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Optimising cake
Hi Guys, Thanks for the responses. I had completely forgotten about the recursive '0' and '-1' options. Thanks for the link also. Much appreciated. Sonic --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Optimising cake
set $recursive to 0 (if you only want stocked item) set fields to the wanted field (StockedItem.name,StockedItem.quantity, ...) the rest is cake's magic : look for $persistModel to understand the number of query difference --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Re: Optimising cake
also if you do not need/want the associated models you can user recursive = 0 or -1 (I forget which) to have cake not even try t oget them... On 8/29/06, DJ Spark <[EMAIL PROTECTED]> wrote: > > Hi sonic, > > In debug mode > 0 , cakephp caches models for a few seconds (20 sec) > . In production mode, it's much longer (a day ? i'm not sure). > Besides that, this thread goes deeper on optimization issues: > > http://groups.google.com/group/cake-php/browse_thread/thread/75ecc8bee3f7ddfe/0572659f27913ca2 > > spark > > > > On 8/29/06, Sonic Baker <[EMAIL PROTECTED]> wrote: > > Update: > > > > Something strange is happening. If I refresh the page both the number of > > queries and time changes. Ok the time changing is expected, but the number > > of queries??? > > Is this something to do with caching? > > > > > > Cheers, > > > > Sonic > > > > > > > > > > -- > [web] http://synapsisdi.com.br > [livesets] http://djspark.com.br > > > > -- == S. DeVore (the old fart) the advice is free, the lack of crankiness will cost you --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Optimising cake
Hi sonic, In debug mode > 0 , cakephp caches models for a few seconds (20 sec) . In production mode, it's much longer (a day ? i'm not sure). Besides that, this thread goes deeper on optimization issues: http://groups.google.com/group/cake-php/browse_thread/thread/75ecc8bee3f7ddfe/0572659f27913ca2 spark On 8/29/06, Sonic Baker <[EMAIL PROTECTED]> wrote: > Update: > > Something strange is happening. If I refresh the page both the number of > queries and time changes. Ok the time changing is expected, but the number > of queries??? > Is this something to do with caching? > > > Cheers, > > Sonic > > > > -- [web] http://synapsisdi.com.br [livesets] http://djspark.com.br --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Optimising cake
Update: Something strange is happening. If I refresh the page both the number of queries and time changes. Ok the time changing is expected, but the number of queries??? Is this something to do with caching? Cheers, Sonic --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---