Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/revert_between_in_warmup' into f…
Browse files Browse the repository at this point in the history
…ix/long-warmup
  • Loading branch information
poszu committed Aug 12, 2024
2 parents f3a6ec0 + 37dd5f9 commit b111c1a
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions sql/atxs/atxs.go
Original file line number Diff line number Diff line change
Expand Up @@ -730,20 +730,15 @@ func IterateAtxsData(
) bool,
) error {
_, err := db.Exec(
`SELECT id, pubkey, epoch, coinbase, effective_num_units, base_tick_height, tick_count, nonce FROM atxs`,
// 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,
`SELECT id, pubkey, epoch, coinbase, effective_num_units, base_tick_height, tick_count, nonce FROM atxs
WHERE epoch between ?1 and ?2`,
// 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
Expand Down

0 comments on commit b111c1a

Please sign in to comment.