[EMAIL PROTECTED] wrote: > -- Tim Bunce <[EMAIL PROTECTED]> on 11/09/01 22:48:07 +0000 > > > On Fri, Nov 09, 2001 at 11:35:09AM -0500, [EMAIL PROTECTED] wrote: > >> So, if I've got a massively parallel database, and I want to run > >> a batch of queries against it in parallel--let's say five hundred, > >> six at a time, what would be the best way to do that? My first thought > >> was a fork/connect for every query, but that's way too much overhead. > > > > You could start six subprocesses and feed the queries to them, perhaps via a > > pipe. > > Put an array of SQL into shared memory using a shared-safe > tied hash and shift, fork however many procs you like and > have them shift (or pop) the queries off of the list. The > IPC::Sharable or threadsafe array module (or both maybe?) > implement proc-safe updte operations. > > -- > Steven Lembark 2930 W. Palmer > Workhorse Computing Chicago, IL 60647 > +1 800 762 1582
Put those SQLs into a temp file, fork processes you like and read SQL from temp file. For safety, use lock to make sure exclusive reading and current offset marking. After SQL querying write the results back to file as log. Then you can check log records of this file if every querys succeed?
