I hope Laurion Berhall read this :-)
I need to insert a million tiny records as quickly as possible.
Now I am in a very narrow cycle, where for each record I
a) start a transaction (JetBeginTransaction) b) prepare an update (JetPrepareUpdate) c) add the row (JetSetColumns) d) commit the transaction (JetCommitTransaction)
Now, during this process, I am in a tight loop on one processor. The target machine has several processors, excellent drives, and plenty of free RAM.
I am wondering how to improve performance.
As for transactions, I did some experimentation and had problems when errors returned if I put too much data in one transaction. I would like to better understand what is happening there - do I have an error or the size of the transaction is crowned, if it is limited, can I increase the cap? Am I just studying this because I assume that a transaction gives ESE the ability to do more caching in RAM while minimizing disk flushes? βIs that just a hunch?β
In general, how can I use multiple processors / lots of RAM / and nice drives? Do I open the database twice and from there? I'm not quite sure what is going on with regard to thread and transaction security. If I have two handles to the database, each in a transaction, will the record on one descriptor be available for the second immediately, before committing, or do I need to commit first?
any tips appreciated
here are the constraints a) I've got a million records that need to be written into the DB as fast as possible b) to fully generate the record for insertion there are two searches that need to occur within the same table (seeking keys) c) This is a rebuild/regeneration of the DB - it either worked, or it didnt. If it didnt there is no going back, a fresh rebuild/regeneration is needed. I cannot restart mid process and without all the data none of the data is valuable. READ: having one big transaction is fine if it improves perf. I'd like ESE to cache, in ram, if that helps perf.
thanks!