Skip to content

Commit

Permalink
stores: fix query
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed Nov 29, 2023
1 parent a68a5c5 commit 004978c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stores/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ SELECT c.fcid, c.size, c.size as prunable FROM contracts c WHERE NOT EXISTS (SEL
Raw(`
SELECT fcid, contract_size as size, CASE WHEN contract_size > sector_size THEN contract_size - sector_size ELSE 0 END as prunable FROM (
SELECT c.fcid, MAX(c.size) as contract_size, COUNT(cs.db_sector_id) * ? as sector_size FROM contracts c INNER JOIN contract_sectors cs ON cs.db_contract_id = c.id GROUP BY c.fcid
) i`, rhpv2.SectorSize, rhpv2.SectorSize).
) i`, rhpv2.SectorSize).
Scan(&dataContracts).
Error
}); err != nil {
Expand Down

0 comments on commit 004978c

Please sign in to comment.