File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -2229,12 +2229,15 @@ func GetValidatorDutiesInfo(startSlot uint64) ([]types.ValidatorDutyInfo, error)
22292229 blocks.status,
22302230 COALESCE(blocks.exec_block_number, 0) AS exec_block_number,
22312231 blocks.syncaggregate_bits,
2232- blocks_attestations .validators,
2233- blocks_attestations .slot AS attested_slot,
2232+ a .validators,
2233+ a .slot AS attested_slot,
22342234 blocks.proposerslashingscount,
22352235 blocks.attesterslashingscount
22362236 FROM blocks
2237- LEFT JOIN blocks_attestations ON blocks.slot = blocks_attestations.block_slot
2237+ -- joining against a subquery instead of blocks_attestations for performance-reasons
2238+ LEFT JOIN (
2239+ SELECT block_slot, slot, validators from blocks_attestations where block_slot >= $1
2240+ ) a ON blocks.slot = a.block_slot
22382241 WHERE blocks.slot >= $1
22392242 ` , startSlot )
22402243
You can’t perform that action at this time.
0 commit comments