Hello Brian,

I made the time edit to remove the describe query.

For example on the USER/PROFILE page I use AJAX to let the USER edit his
COUNTRY for example. The queries after the COUNTRY save are all the tables
that are associated with the USER. I guess that’s normal? The USER has a
quite a few hasManyAndBelongToMany and belongsTo.

Is that normal then?

Thanks,
Dave

-----Original Message-----
From: brian [mailto:bally.z...@gmail.com] 
Sent: March-05-09 2:11 AM
To: cake-php@googlegroups.com
Subject: Re: Conditions in Controller


Are the queries mostly DESCRIBE? Cake does that occasionally when debug > 0.
I believe it has to do with freshening the model cache.

Otherwise, I'd guess it might have something to do with the fact you're
running a find on an associated model. Although it's a 'list'
type, maybe the assoc. has something to do with it.

Actually, you'd be able to tell by looking at the order of the queries. If
they're mostly after your save, then I'd think that's probably it.

On Wed, Mar 4, 2009 at 11:32 PM, Dave Maharaj :: WidePixels.com
<d...@widepixels.com> wrote:
> Question about conditions. I am updating a <DIV> using Ajax, I have 
> Configure::write('debug', 2); so I can see what is being requested 
> from the database. Now when I update the info -> save I see 25 queries 
> yet the element I was updating is independent of any of the queries being
run.
>
> I am updating info in the USER profile (checkboxes) but the info being 
> updated is their ARTISTS checkbox selection. Yet the query returns 
> queries from AUTHORS, USER, ARTISTS, BIO tables and so on.... Is that 
> normal? I thought it should only query the tables used in the update.
>
> CONTROLLER CODE:
>
> function update_artists($slug = null)
>     {
>         if ($this->RequestHandler->isAjax()) {
>             $this->set('user', $this->User->findBySlug($slug));
>             if (!empty($this->data)) {
>                 if ($this->User->save($this->data)) {
>                     $this->view_artists($slug);
>                 }
>             }
>             $artists= $this->User->Artist->find('list', array('fields' 
> => artists, 'order' => artists ASC'));
>             $this->set(compact(artists));
>         }
>         if (empty($this->data)) {
>             $this->data = $this->User->findBySlug($slug);
>         }
>     }
>
> How can I set it so it only queries the tables that are relevant?
>
> Thanks,
>
> Dave
> >
>



--~--~---------~--~----~------------~-------~--~----~
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