[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Does a LMDB database file ever shrink, after row deletion, if so when?

Tinker wrote:

Is there any mechanism in LMDB to give back disk space after some particular
amount of row deletion, how does this work, if not are there any plans for it

No. LMDB keeps all space and reuses it for future write operations.

If there's not, as a user I need 2x disk space and some mechanism to be able
to migrate, so automatic shrinking would be a great thing.

There's nothing automatic but you can use mdb_env_copy() to implement your own strategy.

  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/