mysql_free_result isn't needed...(as can be read in the manual 😃)http://de2.php.net/manual/en/function.mysql-free-result.php
only needs to be called if you are concerned about how much memory is being used for queries that return large result sets. All associated result memory is automatically freed at the end of the script's execution.
Why does this simple query takes so much memory?
Here is one of my querys - wich is searching over about 20.000 rows of data...:
SELECT
EVN_Nodes.type AS Dienst,
RIGHT(EVN_DTAG.datum, 7 ) AS Zeitraum,
EVN_Nodes.memo AS Node,
EVN_DTAG.zielrufnr AS Zielrufnummer,
SUM( EVN_DTAG.nettogesamt ) AS SUMME
FROM EVN_DTAG
INNER JOIN EVN_Nodes ON (EVN_DTAG.anschluss = EVN_Nodes.anschluss)
WHERE
(
(EVN_Nodes.type = 'DATA')
and
(RIGHT(EVN_DTAG.datum, 7 ) ='02.2004' )
)
GROUP BY RIGHT(EVN_DTAG.datum, 7 ), EVN_Nodes.memo, EVN_DTAG.zielrufnr, EVN_Nodes.type
ORDER BY EVN_Nodes.memo
Now it takes 2 sec. for execution. An older version took up to 50 sec. because i grouped a wrong way...
I don't use mysql_free_result at all and it works perfect.
Maybe, the server you are using is a bit to small for "Apache, PHP, mySQL" ... what are you using? an Intel 8086 😉 ?