Discussion:
Does a LMDB database file ever shrink, after row deletion, if so when?
Tinker
2015-05-23 10:08:04 UTC
Permalink
Content preview: Hi! 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 now? 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. [...]

Content analysis details: (-2.0 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
-0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay
domain
-0.0 SPF_PASS SPF: sender matches SPF record
-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
[score: 0.0000]
-0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's
domain
0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid
-0.1 DKIM_VALID Message has at least one valid DKIM or DK signature

Hi!

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 now?

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.

Thanks!!
Tinker
Howard Chu
2015-05-23 19:46:54 UTC
Permalink
Content preview: Tinker wrote: > Hi! > > 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 > now? No. LMDB keeps all space
and reuses it for future write operations. [...]

Content analysis details: (-4.2 points, 5.0 required)

pts rule name description
---- ---------------------- --------------------------------------------------
-2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium
trust
[69.43.206.106 listed in list.dnswl.org]
-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
[score: 0.0000]
Hi!
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
now?
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/
Loading...