Re: strange counter cache behavior - is this supposed to be like that?
On Thu, May 15, 2008 at 1:51 AM, Chris Hartjes <[EMAIL PROTECTED]> wrote: > > The worst thing that will happen if you file a ticket is that it will > be rejected along with an explanation. There might be a snarky > comment associated with it, but that's it. Corollary to the above - Don a bit of Asbestos and read http://www.catb.org/~esr/faqs/smart-questions.html You will do great in this community Tarique -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: strange counter cache behavior - is this supposed to be like that?
On Wed, May 14, 2008 at 4:19 PM, Marc Schuetze <[EMAIL PROTECTED]> wrote: > > will do that. > Before submitting a ticket I was gonna ask if there is a purpose in > this that I don't understand. > I'm still fairly new to cake and I just wanted to be sure The worst thing that will happen if you file a ticket is that it will be rejected along with an explanation. There might be a snarky comment associated with it, but that's it. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: strange counter cache behavior - is this supposed to be like that?
will do that. Before submitting a ticket I was gonna ask if there is a purpose in this that I don't understand. I'm still fairly new to cake and I just wanted to be sure thanks for your answer. On Wed, May 14, 2008 at 9:17 PM, Chris Hartjes <[EMAIL PROTECTED]> wrote: > > On Wed, May 14, 2008 at 4:13 PM, MarcS <[EMAIL PROTECTED]> wrote: >> >> I understand that it is this association which is causing the join. >> But I don't understand why that join is required. >> Isn't all the counter cache is supposed to do is update >> foo.dependent_count >> What does it need the join for then? > > It's not a question of "needing" the join, it seems to be doing it > automatically. You should file a ticket for this over at > trac.cakephp.org. I'm betting it's a relatively easy fix. > > -- > Chris Hartjes > Internet Loudmouth > Motto for 2008: "Moving from herding elephants to handling snakes..." > @TheKeyBoard: http://www.littlehart.net/atthekeyboard > > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: strange counter cache behavior - is this supposed to be like that?
On Wed, May 14, 2008 at 4:13 PM, MarcS <[EMAIL PROTECTED]> wrote: > > I understand that it is this association which is causing the join. > But I don't understand why that join is required. > Isn't all the counter cache is supposed to do is update > foo.dependent_count > What does it need the join for then? It's not a question of "needing" the join, it seems to be doing it automatically. You should file a ticket for this over at trac.cakephp.org. I'm betting it's a relatively easy fix. -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: strange counter cache behavior - is this supposed to be like that?
yes there is one > 'foo' itself belongs to 'bar' which has many 'foo' I understand that it is this association which is causing the join. But I don't understand why that join is required. Isn't all the counter cache is supposed to do is update foo.dependent_count What does it need the join for then? On May 14, 9:10 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote: > On Wed, May 14, 2008 at 4:04 PM, MarcS <[EMAIL PROTECTED]> wrote: > > > UPDATE foos as foo LEFT JOIN 'bars' as 'bar' ON ('foo'.bar_id = > > bar.id) SET foo.dependent_count = 99 WHERE foo.id=1 > > > Why does it do that? I can't see the point in creating this join. It > > serves no purpose whatsoever. > > Well, do you have an association in your models between foo and bar? > > -- > Chris Hartjes > Internet Loudmouth > Motto for 2008: "Moving from herding elephants to handling snakes..." > @TheKeyBoard:http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: strange counter cache behavior - is this supposed to be like that?
On Wed, May 14, 2008 at 4:04 PM, MarcS <[EMAIL PROTECTED]> wrote: > > UPDATE foos as foo LEFT JOIN 'bars' as 'bar' ON ('foo'.bar_id = > bar.id) SET foo.dependent_count = 99 WHERE foo.id=1 > > Why does it do that? I can't see the point in creating this join. It > serves no purpose whatsoever. Well, do you have an association in your models between foo and bar? -- Chris Hartjes Internet Loudmouth Motto for 2008: "Moving from herding elephants to handling snakes..." @TheKeyBoard: http://www.littlehart.net/atthekeyboard --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
strange counter cache behavior - is this supposed to be like that?
I came accross an issue with the built in counter cache. My cake version is 1.2.0.6311 The query generated by cake to update the counter uses joins. Suppose I have a model 'foo' which which has many 'dependent 'foo' itself belongs to 'bar' which has many 'foo' The query to update the counter cache ('foo'.'dependent_count) will look something like this: UPDATE foos as foo LEFT JOIN 'bars' as 'bar' ON ('foo'.bar_id = bar.id) SET foo.dependent_count = 99 WHERE foo.id=1 Why does it do that? I can't see the point in creating this join. It serves no purpose whatsoever. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---