From 7f6dd400975266849ea0df67539ce4f4d15d4193 Mon Sep 17 00:00:00 2001 From: Ian Davis Date: Tue, 17 Nov 2020 11:17:39 +0000 Subject: [PATCH] Optimize gas outputs query --- storage/sql.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/sql.go b/storage/sql.go index 9209b064f..247ea753d 100644 --- a/storage/sql.go +++ b/storage/sql.go @@ -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 {