Subject Re: [firebird-support] Simultaneous inserts / selects
Author Kjell Rilbe
Doychin Bondzhev doychin@... [firebird-support] skrev:
> On 3.10.2014 ã. 12:00 ÷., brucedickinson@... [firebird-support] wrote:
>> do you have any experience in selecting from / inserting to table from
>> multiple threads? Is it faster in comparision to one thread which
>> selects / inserts data in queue?
> I did some experiments with this before and the results show that there
> is some speedup when doing this on more then one thread but not with to
> many threads. At some point threads start to be blocked by firebird locks.
>
> So you better test for your specific configuration in order to find how
> many parallel threads is good for you.
>
> It all depends by hardware you are going to run this on. Also important
> is the amount of indexes that your table will have that FB needs to
> update during insert.
>
> The best approach is to put as much as possible inserts into single
> transaction and with single prepare statement.
>

Also, although rather unorthodox, if you are going to do large batch
inserts, do consider using an external table rather than an insert loop.
It is much much faster, even if you code all non-string columns as
strings and do conversions in SQL. With this approach, it's pretty easy
to create the data to put in the external table file.

Regards,
Kjell

--
------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell.rilbe@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64