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
<[email protected]> 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to