
April 11th, 2005, 01:02 PM
|
 |
Contributing User
|
|
Join Date: Aug 2004
Location: Tucson, Sonora
|
|
|
query exhausting memory allowance in php
Hi, and thanks for reading.
I've been working on a bus route app backed by Oracle 9i where people can search by stop, route or time and get a list of stops and routes.
I already have a query which figures out which "runs" to show based on the time, stop and route, but actually displaying the schedule has become an issue.
When I run this query:
SELECT TO_CHAR(sch.STOPTIME1,'HH12:MI AM') AS S1,TO_CHAR(sch.STOPTIME2,'HH12:MI AM') AS S2,sch.STOPID AS STOPID,sch.RUN AS RUN,st.NAME AS STOPNAME,r.ROUTE AS ROUTE,st.LOCATION AS LOCATION,si.TURNAROUND AS TURNAROUND,si.STOPINDEX AS SINDEX FROM PARKING.SHUTTLE_ROUTES r,PARKING.SHUTTLE_SCHEDULE sch,PARKING.SHUTTLE_STOPS st,PARKING.SHUTTLE_STOPINDEX si WHERE sch.ROUTEID=r.ID AND si.ROUTEID=sch.ROUTEID AND sch.STOPID=st.ID AND si.STOPID=sch.STOPID AND r.ACTIVE=1 AND ((sch.ROUTEID=1 AND sch.RUN=3) OR (sch.ROUTEID=1 AND sch.RUN=4) OR (sch.ROUTEID=1 AND sch.RUN=5) OR (sch.ROUTEID=1 AND sch.RUN=6) OR (sch.ROUTEID=2 AND sch.RUN=4) OR (sch.ROUTEID=2 AND sch.RUN=5) OR (sch.ROUTEID=3 AND sch.RUN=6) OR (sch.ROUTEID=3 AND sch.RUN=7) OR (sch.ROUTEID=4 AND sch.RUN=4) OR (sch.ROUTEID=4 AND sch.RUN=5) OR (sch.ROUTEID=4 AND sch.RUN=6) OR (sch.ROUTEID=5 AND sch.RUN=5) OR (sch.ROUTEID=5 AND sch.RUN=6) OR (sch.ROUTEID=6 AND sch.RUN=4) OR (sch.ROUTEID=6 AND sch.RUN=5) OR (sch.ROUTEID=6 AND sch.RUN=6) OR (sch.ROUTEID=6 AND sch.RUN=7) OR (sch.ROUTEID=7 AND sch.RUN=4) OR (sch.ROUTEID=7 AND sch.RUN=5) OR (sch.ROUTEID=7 AND sch.RUN=6) OR (sch.ROUTEID=7 AND sch.RUN=7)) ORDER BY sch.ROUTEID,sch.RUN,si.STOPINDEX,sch.STOPTIME1
PHP gives an "exhausted memory" error. If I comment out the query execution and just print it out, there's no problem.
Is it this query that's causing the memory problem or would it be something else? If it is the query, is there a way that I can refine it so that it doesn't take up so much memory?
I ran the query in Enterprise Manager, and there was a short delay, but it came up with 78 rows within a half second or so.
Any suggestions?
Thanks in advance.
Colin
Last edited by bocmaxima : April 11th, 2005 at 01:03 PM.
Reason: and...
|