Bulk inserts into InterBase
I was recently asked by a customer for tips on making the fastest bulk insert. Here are my thoughts on the subject
- Turn off inserts and check constraints. This one is by far the most important.
- Perform a commit approximately every 10,000 rows. 10,000 is no absolute magic number, but is a good water mark.
- Don't prepare every insert statement. It needs to be prepared just once.
- Use the Batch API as discussed here: http://docwiki.embarcadero.com/InterBase/XE7/en/Using_Batch_Updates_to_Submit_Multiple_Statements
- Break the work into multiple pieces and have multiple clients do the inserts concurrently. I would suggest having the number of clients equal to the number of logical cores you have would be optimal. This item is definitely theoretical and worth testing to make sure it makes sense for your situation.
Please login first in order for you to submit comments