Skip to content

Commit

Permalink
Optimize gas outputs query
Browse files Browse the repository at this point in the history
  • Loading branch information
iand committed Nov 19, 2020
1 parent 74abe07 commit 7f6dd40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion storage/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ func (d *Database) FindGasOutputsMessages(ctx context.Context, batchSize int, mi
WHERE pm.gas_outputs_completed_at IS null AND
pm.height >= ? AND pm.height <= ?
AND r.height >= ? AND r.height <= ?
AND r.height > m.height AND r.height <= m.height + 20
AND r.height = m.height + 1
ORDER BY pm.height DESC
LIMIT ?
`, minHeight, maxHeight, minHeight+1, maxHeight+1, batchSize); err != nil {
Expand Down

0 comments on commit 7f6dd40

Please sign in to comment.