Generally agree, however there are a couple of places where the local database can have some fixes:
Speaking of blocklist hashes, they might be involved in
and after that I got lost in SQL, but it made me wonder if some other internal records were misaligned.
A formatted view of the GetBlocklists query being run was more readable, but still stretching my skills:
SELECT "A"."Hash"
,"C"."Hash"
FROM (
SELECT "BlocklistHash"."BlocksetID"
,"Block"."Hash"
,*
FROM "BlocklistHash"
,"Block"
WHERE "BlocklistHash"."Hash" = "Block"."Hash"
AND "Block"."VolumeID" = 2
) A
,"BlocksetEntry" B
,"Block" C
WHERE "B"."BlocksetID" = "A"."BlocksetID"
AND "B"."Index" >= ("A"."Index" * 3200)
AND "B"."Index" < (("A"."Index" + 1) * 3200)
AND "C"."ID" = "B"."BlockID"
ORDER BY "A"."BlocksetID"
,"B"."Index"
If you get into this, please check my doing. I just grabbed a likely-looking query from my profiling log…