Size of db not decreasing after removing pairs

36 views
Skip to first unread message

Xav ier

unread,
Dec 3, 2011, 5:22:45 PM12/3/11
to nes...@googlegroups.com
Hello,

I don't see the db files size decreasing after removing objects.
Key/Values are removed but files size on disk remains the same.

Is there an other command after db_remove to use ?

Xavier

BohuTANG

unread,
Dec 3, 2011, 9:52:56 PM12/3/11
to nessDB
Hi,
If remove records,the processes are as follow:
1) add the records to memory,with OPT=DEL(write to .log for backend)
2) if memory is over a COUNT,these records flush to on-disk index
3) if one record's OPT=DEL,the on-disk index just set the high bitset
to 1 to mark this record is deleted status,others do nothing.

Because Btree structure to remove or delete on-disk,is very
complexity. So this do more spaces,less times.
To solve this problem,need to add one function:db defragmentation.
Put it to one version in future.

Thanks,
--BohuTANG

Xav ier

unread,
Dec 16, 2011, 5:43:02 PM12/16/11
to nes...@googlegroups.com
Hi!

I forked your code and pulled a request to add the two missing part I needed to get a DB running every day.
Now the DB size won't grow up.

A solution with an Iterator to loop in DB pairs would have been better than what I did.

Xavier

BohuTANG

unread,
Dec 16, 2011, 11:02:32 PM12/16/11
to nessDB
HI,
Yes,it's nice to dump index/data which are on-disk, but more easier
now with LSM-Tree.
nessDB v1.8.1 now is LSM-Tree, I think you should refork again
(repost on github).

Thanks.
--BohuTANG

Xav ier

unread,
Dec 17, 2011, 3:18:54 AM12/17/11
to nes...@googlegroups.com
Hello,

I would have directly if I had understood why you break compatibility between two minor versions and why you changed the db_add and db_remove with struct slice instead of char*.

I will re-pull soon.

Xavier

Bohu TANG

unread,
Dec 17, 2011, 3:32:34 AM12/17/11
to nes...@googlegroups.com

hehe,I will fixup it soon.But you can pull me if you did. Thanks

BohuTANG

Xav ier

unread,
Dec 17, 2011, 6:34:23 AM12/17/11
to nes...@googlegroups.com
I re-pulled.

Be carefull with compatibilty, there's some watchers/contributors on your project. They may be tired of following the project if you don't respect this basic rule.
The next rule to keep in mind is to always keep the content of others people pull requests in each versions.
If you want to save the things your trying to improve from scratch for a next version, make sure you do that in a separate branch (with a n° of version out of the main path).

Xavier

BohuTANG

unread,
Dec 17, 2011, 8:50:42 AM12/17/11
to nessDB
Hi, Xavier
Thank you for reminding me.
May be due to nessDB there is no standard, so everyone's code(or
others) style is different, it's hard to accept the 'pull request'.
I don't think nessDB is everyone's code hybrid.
Each 'pull request', I will 'git pull' in local, run and to do code
review, and thinking is this 'merge' suitable for nessDB's now or the
future?

Yes, I will do something new in a separate branch,good advice.
Thanks a million.

--BohuTANG


On Dec 17, 7:34 pm, Xav ier <xavier.etche...@gmail.com> wrote:
> I re-pulled.
>
> Be carefull with compatibilty, there's some watchers/contributors on your
> project. They may be tired of following the project if you don't respect
> this basic rule.
> The next rule to keep in mind is to always keep the content of others

> people pull requests in *each* versions.

Reply all
Reply to author
Forward
0 new messages