Skip to content

Commit

Permalink
row: set TargetBytes for kvfetcher
Browse files Browse the repository at this point in the history
Fixes cockroachdb#33660.

Release note (bug fix): Significantly reduce the amount of memory
allocated while scanning tables with a large average row size.
  • Loading branch information
tbg committed Feb 24, 2020
1 parent 575dedd commit 29a26b6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/sql/row/kv_batch_fetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ func makeKVBatchFetcherWithSendFunc(
func (f *txnKVFetcher) fetch(ctx context.Context) error {
var ba roachpb.BatchRequest
ba.Header.MaxSpanRequestKeys = f.getBatchSize()
ba.Header.TargetBytes = 1 << 20 // 1mb
ba.Header.ReturnRangeInfo = f.returnRangeInfo
ba.Requests = make([]roachpb.RequestUnion, len(f.spans))
if f.reverse {
Expand Down

0 comments on commit 29a26b6

Please sign in to comment.