Hello all,
I'm executing a SQL query that's returning approximately 20,000 rows with 5 columns. When I run the query in phpMyAdmin (from a remote host) its execution time averages around .05 seconds. However, when the query is enabled in the php script the script's execution time is raised at least 5 seconds.
I'm theorizing that this is due to the size of the result set being transfered from MySQL to PHP but it seems that this isn't such a large result set to deal with.
PHP and MySQL are running on the same server and I'm using the PHP ADODB module.
Does anyone have any ideas on how to enhance performace of this query in the script or what may be causing the discrepancy in execution times?
Thanks
Particulars:
- PHP/4.3.2
- MySQL 4.0.14-standard
- Apache/1.3.28
SQL:
SELECT
s.sid,
y.yid,
t.tid,
ty.tyid,
sc.s
FROM
table1 AS s,
table2 AS t,
table3 AS y
INNER JOIN (table4 AS sc
INNER JOIN table5 AS ty
ON sc.tyid = ty.tyid)
ON y.yid = ty.yid
AND t.tid = ty.tid
AND s.sid = sc.sid
WHERE s.sid IN ($sid_list)
AND t.tid IN ($tid_list)
AND y.yid IN ($yid_list)
ORDER BY t.tid, y.yid, s.sid;