What does "bulk load" mean?

Spredzy picture Spredzy · Dec 16, 2010 · Viewed 42.3k times · Source

Jumping from article to article, I can see everywhere the expression "bulk loading".

What does it really (technically) mean?

What does it imply?

Explanation based on use-cases is welcome.

Answer

SingleNegationElimination picture SingleNegationElimination · Dec 16, 2010

Indexes are usually optimized for inserting rows one at a time. When you are adding a great deal of data at once, inserting rows one at a time may be inefficient. For instance, with a B-Tree, the optimal way to insert a single key is very poor way of adding a bunch of data to an empty index.

Instead you pursue a different strategy with B-Trees. You presort all of the data, and group it in blocks. You can then build a new B-Tree by transforming the blocks into tree nodes. Although both techniques have the same asymptotic performance, O(n log(n)), the bulk-load operation has much smaller factor.