在京都机柜数据库使用文件哈希数据库,如何可以避免文件大小增加? [英] In Kyoto Cabinet Database using File Hash Database, how can avoid file size increasing?
问题描述
我使用以下命令打开:
db.open("db.kch#tune_defrag=10000", DB.OWRITER | DB.OCREATE)
我放置和删除元素。在执行结束时,数据库是空,count()函数返回0,因为我删除所有元素。为什么文件大小总是增加,当我重复测试?是否有可能运行类似垃圾回收器来清除删除的寄存器?如果我执行相同的测试100次,我有一个500 MB大小的数据库,即使我只有2记录。
I am putting and removing elements. At the end of execution, the database is "empty", the count() function returns 0, because I remove all elements. Why the file size always increase when I repeat the test? Is it possible to run something like "garbage collector" to clean the removed registers? If I execute the same test 100 times, I have a 500 MB size database, even I have only 2 records.
我试图把tune_defrag = 10000我认为它不能正常工作。
I tried to put the "tune_defrag=10000" but I think it didn't work fine.
Obs .:一个唯一的寄存器小于1K,我不明白为什么寄存器需要这么多的磁盘空间。
Obs.: a only register is less than 1K, I don't understand why the registers take so much space in disk.
感谢您的帮助
推荐答案
>
Try this:
db.kch#dfunit=8
这意味着KC会针对检测到的每8个碎片执行碎片整理,而8实际上是由Mikio推荐的。
That means the KC runs defrag for every 8 fragmentation detected, and 8 is actually recommended by Mikio.
这里列出了可用的选项,可以使用一些波兰语。
Available options are listed here, however it could use some polish.
http:// fallabs .com / kyotocabinet / command.html
这篇关于在京都机柜数据库使用文件哈希数据库,如何可以避免文件大小增加?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!