google / leveldb

LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.
BSD 3-Clause "New" or "Revised" License
36.12k stars 7.78k forks source link

those marked as deleted be deleted #1099

Open huhengyuan opened 1 year ago

huhengyuan commented 1 year ago

As I don't understand c++, I can't analyze the source code when using leveldb, and I have some questions only by referring to the official documentation. When .ldb files are merged, will duplicate keys be removed and those marked as deleted also be deleted?

yezhengmao1 commented 1 year ago

Only level-0 file has overlap key, and other levels do not have overlap key. So the duplicate key will be merged into one key, and the marked as the deleted key will be clear.

huhengyuan commented 1 year ago

LDB file merging is an extremely important part of the database. I want to know whether to control the merging.When I use node to operate leveldb, memtable writes data to the ldb file without reaching the threshold. Is it because I insert a piece of data to reach the memtable threshold?

風逐梦 @.***

 

------------------ 原始邮件 ------------------ 发件人: "google/leveldb" @.>; 发送时间: 2023年3月10日(星期五) 下午3:02 @.>; @.**@.>; 主题: Re: [google/leveldb] those marked as deleted be deleted (Issue #1099)

Only level-0 file has overlap key, and other levels do not have overlap key. So the duplicate key will be merged into one key, and the marked as the deleted key will be clear.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>