From 37dd5f9011731cf3ceffb2a5661c6ab8b6c8c5b2 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowak Date: Mon, 12 Aug 2024 12:31:03 +0200 Subject: [PATCH] switched back to warmup with between --- sql/atxs/atxs.go | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/sql/atxs/atxs.go b/sql/atxs/atxs.go index 361a2da573..4e880e38d6 100644 --- a/sql/atxs/atxs.go +++ b/sql/atxs/atxs.go @@ -735,20 +735,15 @@ func IterateAtxsData( a.id, a.pubkey, a.epoch, a.coinbase, a.effective_num_units, a.base_tick_height, a.tick_count, a.nonce, iif(idn.proof is null, 0, 1) as is_malicious - from atxs a left join identities idn on a.pubkey = idn.pubkey`, - // SQLite happens to process the query much faster if we don't - // filter it by epoch - // where a.epoch between ? and ?`, - // func(stmt *sql.Statement) { - // stmt.BindInt64(1, int64(from.Uint32())) - // stmt.BindInt64(2, int64(to.Uint32())) - // }, - nil, + from atxs a left join identities idn on a.pubkey = idn.pubkey + where a.epoch between ? and ?`, + // filtering in CODE is no longer effective on some machines in epoch 29 + func(stmt *sql.Statement) { + stmt.BindInt64(1, int64(from.Uint32())) + stmt.BindInt64(2, int64(to.Uint32())) + }, func(stmt *sql.Statement) bool { epoch := types.EpochID(uint32(stmt.ColumnInt64(2))) - if epoch < from || epoch > to { - return true - } var id types.ATXID stmt.ColumnBytes(0, id[:]) var node types.NodeID