I've encountered major problem on one of our applications. Cake is
taking a very long time creating the resulting data array from a DB
query. Here's the scenario:

Models: Order has many OrderLineItem
Data: About 2800 Orders, each with one OrderLineItem

This is part of a function in the Order model:
$this->find('all', array('contain' => array('OrderLineItem')))

This find call is taking about 25 seconds. This is on a dedicated LAMP
based server with minimal traffic and pegs the CPU. The actual code
and relationships are more extensive but I've simplified it for this.
This is not a query issue, the actual DB query takes < 75ms.

The issue seems to be from the function __mergeHasMany() of class
DboSource on line 912 of dbo_source.php (1.2 RC3). However these loops
are being executed seems to create a massive amount of overhead. The
default PHP memory allocation of 32MB wasn't enough.

Has anyone encountered this issue or know how to resolve it? Our
client is pissed off about this. It's only going to continue getting
worse as orders come in. 2800 rows is nothing, this shouldn't take
more than a few hundred ms to execute.

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