build a index of keys/block