Re: [ZODB-Dev] Is there any convenient way to reduce the storage file size after delete something in database?
Le mardi 27 septembre 2011 10:23:01, 刘一新 a écrit : But If I want to only remove some object in test.fs, I must do following: 1. zeopack the database 2. rm -f test.fs.old Am I right? You are right. BTW, what does the zeopack exactly do? And when should I use it? I try to find some instructions on it but without success. First, you need to know that FileStorage (what manages data.fs files) is an append-only mechanism, where every new transaction (object creation, modification...) is appended, and usually you see the result of all accumulated transactions. Deletion is merely the modification of a container object so that it stops referencing part of its content. As such, it will be appended too. Packing is the way to free file-system space after deleting objects. It has 2 phases/purposes: - revision pruning: non-current (...at the time given for packing) object revisions are deleted - garbage collection: unreachable objects are deleted As you noticed, with FileStorage this actually happens by copying every kept objects and transactions to a new data.fs, and swapping it with original data.fs - which gets renamed as *.old. Regards, -- Vincent Pelletier ERP5 - open source ERP/CRM for flexible enterprises ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev
Re: [ZODB-Dev] Is there any convenient way to reduce the storage file size after delete something in database?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The ZODB basically does only append to the database file (Data.fs). Only packing (e.g. through zeopack) will write a new (and smaller) Data.fs file containing the referenced life objects. - -aj 刘一新 wrote: I found that the size of the storage file (test.fs for example) does not change when I remove some or all object from it. To empty test.fs, I recreate it. But If I want to only remove some object in test.fs, I must do following: 1. zeopack the database 2. rm -f test.fs.old Am I right? BTW, what does the zeopack exactly do? And when should I use it? I try to find some instructions on it but without success. Thanks! -- /Dr. Yi-Xin Liu/ /Department of Macromolecular Science/ /Fudan University/ /Room 415, Yuejing Building / /Handan Rd. 220, //Shanghai, China/ /Tel +86-021-65642863/ /Mobile +86-13916819745/ http://www.mendeley.com/profiles/yi-xin-liu/ ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev - -- ZOPYX Limited | zopyx group Charlottenstr. 37/1 | The full-service network for Zope Plone D-72070 Tübingen| Produce Publish www.zopyx.com | www.produce-and-publish.com - E-Publishing, Python, Zope Plone development, Consulting -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQGUBAEBAgAGBQJOgY+LAAoJEADcfz7u4AZj4VELviQVWvCV6wkfMPYFAmA3UihK Sj8LDrGPc76/tCRKzCP7Ska0Wtc+Sug4hs+0NPjVbKyeAtZI0e0MvbFw2ihZwkqw KvTJjcLUuscOdBtpPxZzCdmSsmnE25tv/S+JhCmuq3yhs0QKvb562jDP4DwPTMvP r5noWq+R5pd1wo9a2aZ1qD+2pjchgjBIk/AVWGH2cg+BlqtOvjVTr1zWHihJ1FQU N/CpAJJfB31axQHrrF1zBeO6ya8GMkJkUto9+qbxHK2Bnz6k64L5OAZj4xzGgKLW PVJxltK3Eso6Wqh4vb55TFKVuKAel6M0TSGK6R7QOxp1ln8qE0xiLPzpE+D6aYKV bHChCKNfQUGpG7A+4pNHiPxvkmfXszj0LkQcsw7Ca9DJLfGwrdVQFKiBQH9oyeLk pw6IIYmdnhd0Gu6JeIvTqmch/Eov9vHK6C14aEWae4DINkAceT9mW9+XRZrWMF3l 2S9lUMOdoHtGYQgekpEfBi22+ISNIIw= =Qm+y -END PGP SIGNATURE- attachment: lists.vcf___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev
Re: [ZODB-Dev] Is there any convenient way to reduce the storage file size after delete something in database?
On Tue, Sep 27, 2011 at 4:23 AM, 刘一新 liuy...@gmail.com wrote: I found that the size of the storage file (test.fs for example) does not change when I remove some or all object from it. To empty test.fs, I recreate it. But If I want to only remove some object in test.fs, I must do following: 1. zeopack the database 2. rm -f test.fs.old Am I right? BTW, what does the zeopack exactly do? And when should I use it? I try to find some instructions on it but without success. In addition to Vincent's remarks, I'll also note that FileStorage has an option to keep old (unpacked) files. If set to False, the old file will be automatically removed. Jim -- Jim Fulton http://www.linkedin.com/in/jimfulton ___ For more information about ZODB, see the ZODB Wiki: http://www.zope.org/Wikis/ZODB/ ZODB-Dev mailing list - ZODB-Dev@zope.org https://mail.zope.org/mailman/listinfo/zodb-dev