deltanovember
deltanovember

Reputation: 44051

What's the quickest way to import a large data set into a database?

The two options I'm considering are index and then import vs importing and then indexing. Is there one method that is significantly faster?

Upvotes: 0

Views: 111

Answers (1)

Oded
Oded

Reputation: 499062

In general, for large inserts, it is better to insert then index.

Otherwise the insert process will need to insert while indexing, which will be slow and get slower and slower as more items are added.

Consider an shuffled deck of cards - what would be faster? Taking all of the cards and sorting them in place or taking each card one at a time and putting it in place in a new pile? (not the best analogy, I know).

Upvotes: 1

Related Questions