Hi Konstantin,
> May be it is possible to somehow optimize it, by checking ranges of primary
> key values
It's possible. An optimization you are looking for is called Merkle
tree [1]. Particularly it's used in Riak [2].
[1] https://en.wikipedia.org/wiki/Merkle_tree
[2] http://docs.basho.com/riak/kv/2.2.3/learn/concepts/active-anti-entropy/
--
Best regards,
Aleksander Alekseev