((piece_num + 1) * %(piece_length)s - entity_offset) / %(block_size)s + lower(disk_blocks)
) as use_blocks,
crypt_key
- from relevant_slab join targeted_piece
+ from relevant_slab cross join targeted_piece
)
select piece_num, use_blocks, crypt_key from out
where not isempty(use_blocks)
entity_id,
entity.length,
entity_blocks,
- slab_plus.disk_blocks
- entity_blocks * elh.block_range as check_erange,
+ slab_plus.disk_blocks,
+ entity_blocks * elh.block_range as check_erange
from
entityv2_leaf_hashes elh
join slab_plus using (entity_id)