in reply to fetchrow and fetchall question
Regardless of which of those two methods you call some databases (MySQL among them) still gather all the results on their end into an array first, and then feed them back to you. The consequence, as you saw, is a very lengthy query.
When I ran into this problem, my solution was to find a field in the table I was fetching that had something resembling a flat distribution over it's range of values, and selected the table in chunks based on that key.
Considering that you're selecting based on the time, I suggest that you make multiple selects with smaller differences between $start_time and $stop_time, (selecting by hours instead of by days, for instance) and then merge the results in your program.
|
|---|