speedb-io / speedb

A RocksDB compliant high performance scalable embedded key-value store
https://www.speedb.io/
Apache License 2.0
882 stars 65 forks source link

Find the first version of a key when using timestamp #780

Open peroket opened 9 months ago

peroket commented 9 months ago

Owner:

Is your feature request related to a problem? Please describe. When using timestamp, it would be nice for us to be able to retrieve the first version of a key conveniently.

Describe the solution you'd like Having an option to seek to the smallest timestamp of a specific key in an iterator, or a get() that look for key with timestamp equal or above a certain value (rather than equal or below).

Describe alternatives you've considered For now, we have to use iterator seek with timestamp enabled and then iterate until the very last entry (to get the smallest timestamp). Can do the same thing with successive gets. This forces to iterate over the whole range of versions, even though they are discarded immediately. Could also seek for the next key and then call prev(), but that forces to disable prefix seek.

Additional context