Reputation: 800
I am trying to decide on a schema for a LevelDB database, is the insertion order of the key, value pairs going to affect performance? For example, my keys are timestamps, if I insert the values in reverse sorted order, will that be slower than inserting them in sorted order?
Upvotes: 2
Views: 483
Reputation: 4037
Inserts in increasing key order makes the underlying merging process more efficient. If you're just inserting a few key/values at a time, the in-memory structures (skip list) will already take care of that. For bulk loading, it's more efficient to use increasing keys.
Upvotes: 2
Reputation: 2153
I don't think order matters. It's a skiplist in the memory the key-value pair goes to first.
Upvotes: 1