[KLUG Members] Re: Pages that take a mighty long time....

Will Fitzgerald members@kalamazoolinux.org
Fri, 20 Jul 2001 12:29:30 -0400


Adam Tauno Williams wrote:

> I've written some pages in PHP that plow through a enourmous pile of data,
and
> may take "a long time" to run.  Browser comes back with a "Zero Sized
Reply" or
> some such nonsense,  I assume it is a time-out etc...  does anyone have
any
> clever ideas on how one would go about handling a situation such as this?
Or
> maybe I need to off down a diffrent track...


Although the suggestions being made are good ones, you should definitely
look at the database structure you are using, and making sure you have the
right indexes created. Use the database explain facilities to see what's
happening.

The other possibility, since you say getting the data is "very quick" on the
SQL side, is to have the SQL engine do the looping for you, so that (in
essence) there is only one PHP loop in your pages, and it doesn't have to do
any storage. (this is what databases are supposed to be good at).

Will Fitzgerald