When generating iterators for multi databases, the (key, values) iterator generated by a snapshot is first flattened into (key, value) iterator; then, this iterator is transformed with skip_while and filter adaptors.
This approach can be less performant in a situation where a key can contain multiple values. In these situations, these adaptors do extra work because the flattening happens beforehand. Ideally, flattening should happen afterwards, which this PR implements.
When generating iterators for multi databases, the (key, values) iterator generated by a snapshot is first flattened into (key, value) iterator; then, this iterator is transformed with
skip_while
andfilter
adaptors.This approach can be less performant in a situation where a key can contain multiple values. In these situations, these adaptors do extra work because the flattening happens beforehand. Ideally, flattening should happen afterwards, which this PR implements.
Signed-off-by: Victor Porof victor.porof@gmail.com