Rust-rocksdb: Support for contains key / key exist?

Created on 23 Jun 2020  ·  10Comments  ·  Source: rust-rocksdb/rust-rocksdb

Does this support checking the key if exist in the DB without returning the value / updating the cache?

All 10 comments

I have quickly checked and was unable to find the corresponding api in rocksdb. Have you checked there?

We can add a method in the rust bindings, but I think that it makes little sense without rocksdb support.

Feel free to reopen the issue if I have missed something.

Thanks, for some reason I was unable to find these methods: https://github.com/facebook/rocksdb/blob/master/include/rocksdb/db.h#L653
As far as I can see, these functions aren't exposed through the C API. I have made the pull request: https://github.com/facebook/rocksdb/pull/7021

@DarkEld3r hey, the methods exposed in your PR still read the values, so they are not that different from get IIUC. Do you think it's possible to implement a check w/o loading values into memory?

Also KeyMightExist can return false positives IIUC.

return boolean value indicating if key does not exist or might exist.

Ah, sorry, I misread the comment. So by supplying null value_found it actually doesn't read the value.

@stanislav-tkach your PR facebook/rocksdb#7021 is already merge. Can we add support?

@rohitjoshi The latest (6.11.4) rocksdb release was at Jul 20 and unfortunately it doesn't include my changes. I suppose we need to wait for the next release.

Any update on this?

As far as I can see, the latest RocksDB release includes the required C-API changes, but we are still using the 6.11.4 version.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iSynaptic picture iSynaptic  ·  31Comments

rrichardson picture rrichardson  ·  7Comments

eupn picture eupn  ·  3Comments

mvines picture mvines  ·  10Comments

cetra3 picture cetra3  ·  9Comments