Yrjänä Rankka wrote:
Sören Auer wrote:
Ivan Mikhailov wrote:
Unfortunately, we can offer plain INSERTs only, but they're not bad,
esp. when parametrized.
You mean wen run as prepared statements?
Yes. You prepare statement, then exec it repeatedly with parameters - this is the fastest way of inserting bulk.

Whatever language/connectivity method you're using, arrange for this to happen:

a) drop index ....;

b) begin work;
   prepare insert into table values ? ? ?...;
   repeat N { bind parameters ; execute }
   commit

c) create index...;

Choose an N that reflects a trade-off of block-size of rows between speed and confidence that all the inserts therein are going to work; life's faster if it doesn't have to autocommit every row inserted individually (hence beginning and committing a transaction around block-loads at a time), but if a given transaction fails for any reason, all the rows in that block will be omitted.

HTH,

~Tim
--
Tim Haynes
Product Development Consultant
OpenLink Software
<http://www.openlinksw.com/>

Reply via email to