Hey fellow PHP-codemonkeys. :)
Let me start by laying out some facts:
SELECT e.NAME AS customer, g.NAME AS driver_lastname, g.FIRSTNAME AS
driver_firstname, $CommonSQL, COUNT(g.NAME) AS number FROM ENTITY e, ENTITY
g, EXPERTISE_FILE f, DAMAGE_CASE d WHERE (f.CUSTOMER = '$CustomerID') AND
(e.ID = f.CUSTOMER) AND (g.ID = f.DRIVER) AND (d.OWNER_EXP_FILE = f.ID) AND
(f.DATE_REPORT BETWEEN '$StartDate' AND '$EndDate') GROUP BY e.NAME, g.NAME,
The query above is one of the statistics gathering queries in my application.
This one will run flawlessly.
If however I add this condition: "AND (f.DRIVER = '$DriverID')" before "AND
(g.ID = f.DRIVER), the script will eat all CPU and RAM (and eventually swap
aswell) on my PowerEdge 2500SC.
If I run both queries from inside psql (I use PostgreSQL), they -both- (!)
complete within split seconds...
If I leave set_time_limit() on the default of 30 secs, my script will time
out somewhere around these lines (though it seems like coincidence...):
$Denied = $Requested - $Agreed; --> Timeout here
if ($Denied < 0) --> Sometimes here
$Denied = 0;
To me, this does not seem to make any sense, especially since the first query
(without the additional condition) runs fine, whilst it has to return many
Does anyone have any idea what could be going on?
If you reply, please include a CC for me, as I am on digest (I don't have
time to sort through all the messages at work anyway, but I do contribute
from home. :)
Alexander Deruwe ([EMAIL PROTECTED])
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]