Skip to content

Commit

Permalink
meta/tikv: optimise txn scan (#5314)
Browse files Browse the repository at this point in the history
Signed-off-by: jiefenghuang <[email protected]>
  • Loading branch information
jiefenghuang authored Nov 22, 2024
1 parent deb0fd1 commit c802d12
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/meta/tkv_tikv.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ func (tx *tikvTxn) gets(keys ...[]byte) [][]byte {
}

func (tx *tikvTxn) scan(begin, end []byte, keysOnly bool, handler func(k, v []byte) bool) {
tx.GetSnapshot().SetKeyOnly(keysOnly)
snap := tx.GetSnapshot()
snap.SetScanBatchSize(10240)
snap.SetNotFillCache(true)
snap.SetKeyOnly(keysOnly)
it, err := tx.Iter(begin, end)
if err != nil {
panic(err)
Expand Down

0 comments on commit c802d12

Please sign in to comment.