Question about range clear

If there are like millions of keys under one prefix, could I simply call clear(Range) for all keys under the prefix? The range simply includes all possible keys under the same prefix. Will it exceed the size limit of FDB? Or I have to make sure all deleted keys in the clear range are within the size limit?

example api: void clear(Range range) under Java.

Yes, you can. The amount of data contained by the cleared range does not count against the write transaction size limit.

1 Like

Thanks! This is great!

Assume FDB commits a single range clear request to the logs. Then Storage Node(s) will pull this range clear request, put a delete marker locally, then start scanning and deleting the keys with control (to avoid spikes, which may impact the read). Is this correct?

Pretty much, yeah. The storage nodes quickly detach the affected keys from the b-tree on a range clear, and then the detached pages are gradually cleaned up by a background cleanup process.