Subject Re: [firebird-support] parrallel update
Author Vander Clock Stephane
dear ann,

> Sorry for the dumb question, but why do you want to do those
> operations in parallel? The SuperServer runs only one thread at a
> time, ties a connection to an thread, and uses only one processor. Do
> you think it will be faster interweaving n commands than running the
> operations sequentially? And of course, the classic architecture has
> the same general limitations, except there is a process per
> connection.
>

no dumb question at all ...

to answer you, i do this simple test
(on FB super classic, single processor):

Create 3 tables
Create table TABLE_A(ID VARCHAR(15));
Create table TABLE_B(ID VARCHAR(15));
Create table TABLE_C(ID VARCHAR(15));

**********************
now i do in loop with one single thread, one connection :

Start transaction
insert Into Table_A(ID) VALUES('<#randomchar>'); //
insert Into Table_A(ID) VALUES('<#randomchar>'); // (100 000 loop)
insert Into Table_A(ID) VALUES('<#randomchar>'); //
commit transaction

average Insert time taken for each thread : 0.24 ms
total time to insert 300 000 rec: 34.8 seconds

**********************
now with 3 different Thread and 3 different connection

thread1
Start transaction
insert Into Table_A(ID) VALUES('<#randomchar>'); (100 000 loop)
commit transaction

Thread2
Start transaction
insert Into Table_B(ID) VALUES('<#randomchar>'); (100 000 loop)
commit transaction

thread3
Start transaction
insert Into Table_C(ID) VALUES('<#randomchar>'); (100 000 loop)
commit transaction

average Insert time taken for each thread : 0.12 ms
total time to insert 300 000 rec: 18.7 seconds

so the parallel are 2 times more faster ! (i was hopping 3 times, but i do
the test on a slow sata hard drive and a single processor computer that
can explain)

so at end the parrallel insert a much more faster (2x) than the
sequential insert !
so i thing it's can be usefull that firebird permit us to send to him a
"batch
of sql" to do, and he will himself execute all the SQLs in parallel in
different
thread ?

thanks for all
st├ęphane







> >
> > is their any way to execute theses n update in parallele inside one
> > connection and one transaction ?
>
> No.
>
> Good luck,
>
> Ann
>
>


[Non-text portions of this message have been removed]