Note that there are some explanatory texts on larger screens.

plurals
  1. POInserting a million small records into Extensible Storage Engine (JetBlue) - quickly
    primarykey
    data
    text
    <p>I'm hoping Laurion Burchall reads this :-)</p> <p>I need to insert a million tiny records as quickly as possible.</p> <p>Right now I'm in a very tight loop where, for every record, I </p> <pre><code>a) start a transaction (JetBeginTransaction) b) prepare an update (JetPrepareUpdate) c) add the row (JetSetColumns) d) commit the transaction (JetCommitTransaction) </code></pre> <p>Right now, during this process, I'm in a tight loop on one processor. The target machine has multiple CPUs, great disks, and lots of free RAM.</p> <p>I'm wondering how to get better performance.</p> <p>As far as transactions go, I did some experiments and had troubles where errors came back if I put too much data in one transaction. I'd like to better understand what's going on there - do I have a bug, or is the size of a transaction capped, if capped can I enlarge the cap? I'm only investigating this because I'm guessing that a transaction give ESE the ability to do more caching in RAM, minimzing disk flushes? - this is just a guess?</p> <p>In general how do I make use of multiple processors/lots of RAM/and nice disks? do I open the database twice and go from there? I'm not quite sure what happens with respect to thread safety and transactions. If I have two handles to the DB, each in a transaction, will a write on one handle be available for the second immediately, before the commit, or will I need to commit first?</p> <p>any tips are appreciated</p> <pre><code> 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. </code></pre> <p>thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload