[py-lmdb] Re: py-lmdb write performance

  • From: David Wilson <dw@xxxxxxxx>
  • To: py-lmdb@xxxxxxxxxxxxx
  • Date: Tue, 27 May 2014 15:38:25 +0000

On Tue, May 27, 2014 at 08:33:24AM -0700, Dinesh Vadhia wrote:

> for key, value in d.items():
>    with env.begin(db, write=True) as txn:
>        txn.put(key=key, value=value, append=True)

> What am I missing?

From the docs:

    Appending a key that is not greater than the highest existing key
    will cause corruption.

You can only use append=True with sorted input.


David

Other related posts: