Unfortunately, setting $this->MyModel->recursive = -1; doesn't help :( My code is the following: function _sort($id = null) { $this->CompanyCategory->recursive = -1; $this->CompanyCategory->reorder(array ( 'id' => $id, 'field' => 'name' )); $miscs = $this->CompanyCategory->findAllByName(array('прочее', 'прочие услуги')); foreach ($miscs as $misc) { $this->CompanyCategory->movedown($misc['CompanyCategory']['id'], true); } }
10 января 2009 г. 18:39 пользователь Adam Royle <a...@sleekgeek.com.au>написал: > > I've had a tree with that many records and had no issues re-ordering > it (maybe 1-2 seconds max). > > I seem to remember needing to set $this->MyModel->recursive = -1; > before calling the reorder methods. Maybe that is your problem - you > might be selecting more than you need to? > > Maybe you should show your code though, because 100000 queries is a > lot! > > Cheers, > Adam > > On Jan 10, 8:40 pm, "Peter A. Shevtsov" <webmas...@mera.com.ru> wrote: > > Hello, > > > > I have a tree with about 400+ records and when I try to call reorder > method > > it executes about 100000 SQL queries and takes several minutes to finish. > Is > > there any way to optimize it? > > > > Thanks! > > > > -- > > Пётр Шевцов > > > -- Пётр Шевцов --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---