Re: Re: how dod you get to do multiple mysql queries concurrently?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, January 25, 2008 11:21 am, Jochem Maas wrote:
> Per Jessen schreef:
>> Colin Guthrie wrote:
>>
>>> Per Jessen wrote:
>>>> Colin Guthrie wrote:
>>>>
>>>>> Per Jessen wrote:
>>>>>> I know how to do multiple queries - the key issue in my question
>>>>>> was how to do them concurrently (i.e. in parallel).
>>>>> So you want to make PHP multithreaded???
>>>> No, just the mysql queries.
>>> So really what you want is mysqli_multi_query_async()? I've not
>>> really
>>> seen this unf. (not to say it doesn't exist tho').
>>>
>>> I think that's probably something for the mysql list rather than
>>> PHP
>>> as PHP just exposes the mysql client API.
>>
>> Well, mysql has no problem running multiple queries in parallel, so
>> if
>> only I could make php issue multiple queries.  I guess I'll have to
>> revert to my iframe-rpc setup that I mentioned just two seconds ago.
>>
>> But your suggestion with an async call is just the kind of thing
>> that
>> might be useful.  And I think that is a php issue, but then we might
>> be
>> back to threading :-(
>
> have you thought of batch processing via cron? you can have a parent
> process
> run off children to handle each long running query and package the
> results in
> format that's quick to output - thereby minimizing the time taken to
> batch process
> and then have the summary page merely use the latest packaged results.

And if it's just a summary page, it's often better to run the quries
in advance and cache the output in a static page.

Update it as seldom as possible while keeping the users "happy" with
the freshness of the output.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux