See this thread for a direct solution to your problem (use a finder
query):
http://groups.google.com/group/cake-php/msg/c10840be78a34df0
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 sub
Have you try caching the queries? Just add var $cacheQueries=true; in
your app_model.php
Cache query will not make a query twice example;
$this->set('name',$this->Model->field('name',array('id'=>$id)));
//more code
if($this->Model->field('name',array('id'=>$id))=='something'){
//doSomethin
On Tue, Jul 13, 2010 at 12:24 PM, Mike Karthauser
wrote:
> refining by writing custom queries can be useful but having found an issue
> recently where repeated custom queries were stealing memory and not being
> cleared by garbage collection, i'd be a bit wary of this as a solution.
>
> if you do
hi alex
On Tue, July 13, 2010 11:57 am, Alex Bovey wrote:
> Well, my debug level is 0 for production but since I can't see the SQL log
> I'm turning it to 2 for debugging.
>
> Can I get cake to log the SQL somewhere and still set debug to 0?
>
> Interestingly I found this, which seems to imply tha
Well, my debug level is 0 for production but since I can't see the SQL log
I'm turning it to 2 for debugging.
Can I get cake to log the SQL somewhere and still set debug to 0?
Interestingly I found this, which seems to imply that Containable is the
cause of the problem, rather than the solution:
Out of interest, what is your debug level?
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 13 Jul 2010, at 10:57, Alex Bovey wrote:
> Hi Nick,
>
> Thanks for the reply.
>
> Sorry I should have said in my original post - I'm already using Containable
> AND
Hi Nick,
Thanks for the reply.
Sorry I should have said in my original post - I'm already using Containable
AND setting recursive to -1 in app_model.php.
But still the selects are incredibly inefficient - a single query to fetch
each individual row?!
I'm not specifying 'fields' but surely that'
Use a mixture of:
fields option key (so you're not retrieving data you don't intend to
use),
containable (so you're not selecting associative models and their
fields you don't care about),
and set recursive = -1 in your app_model.php
The first thing I do whenever I start any new CakePHP project i
Hi all,
Using Cake 1.2.0.6311 I'm having real problems with the number of SQL
queries in my app.
For example, I have Enquiry belongsTo User and User hasMany Enquiry.
A simple $this->Enquiry->find('all') results in one query to fetch the
enquiries, and then a separate query for every single Enqui