liuis / leveldb

Automatically exported from code.google.com/p/leveldb
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Compaction not working #99

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I'm inserting 64B key(32B)-value pair. After inserting ~10G of data, I see 
lots of ~2M file generated.

What is the expected output? What do you see instead?
I was expecting compaction of this files at some stage and the number of files 
in the db directory to be bounded to improve search performance. Rather I see 
all the files are ~2M and none of them seem to be compacted.

What version of the product are you using? On what operating system?
Commit : dd0d562b4d4fbd07db6a44f9e221f8d368fee8e4. Revision number 1.5.
Linux ubuntu 2.6.32-28

Please provide any additional information below.

Original issue reported on code.google.com by malpani....@gmail.com on 5 Jul 2012 at 11:45

GoogleCodeExporter commented 9 years ago
leveldb compaction is different than what you are expecting.  Instead of 
merging 2MB files to create fewer/larger files, it instead merges together 
overlapping files to reduce overlap.  The output of compaction is still a set 
of ~2MB files; the difference is that these files won't overlap each other and 
therefore a particular key can be located after looking in fewer files.  See 
doc/impl.html for more details.

Original comment by san...@google.com on 12 Oct 2012 at 8:06