Skip to content

Commit 6c56f40

Browse files
peterbitflyguybrush
authored andcommitted
fix(db): improve performance of the GetValidatorDutiesInfo sql query
1 parent 34fbe5a commit 6c56f40

File tree

1 file changed

+3
-3
lines changed
  • backend/pkg/commons/db

1 file changed

+3
-3
lines changed

backend/pkg/commons/db/db.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2233,9 +2233,9 @@ func GetValidatorDutiesInfo(startSlot uint64) ([]types.ValidatorDutyInfo, error)
22332233
blocks_attestations.slot AS attested_slot,
22342234
blocks.proposerslashingscount,
22352235
blocks.attesterslashingscount
2236-
FROM blocks
2237-
LEFT JOIN blocks_attestations ON blocks.slot = blocks_attestations.block_slot
2238-
WHERE blocks.slot >= $1
2236+
FROM blocks_attestations
2237+
LEFT JOIN blocks ON blocks_attestations.block_slot = blocks.slot
2238+
WHERE blocks_attestations.block_slot >= $1
22392239
`, startSlot)
22402240

22412241
return validatorDutyInfo, err

0 commit comments

Comments
 (0)