code: func (b *batchChecker) batchGetInsertKeys(ctx sessionctx.Context, t table.Table, newRows [][]types.Datum) (err error) {
  	// Get keys need to be checked.
  	b.toBeCheckedRows, err = b.getKeysNeedCheck(ctx, t, newRows)
  	if err != nil {
  		return err
  	}
  
  	// Batch get values.
  	nKeys := 0
  	for _, r := range b.toBeCheckedRows {
  		if r.handleKey != nil {
  			nKeys++
  		}
  		nKeys += len(r.uniqueKeys)
  	}
  	batchKeys := make([]kv.Key, 0, nKeys)
  	for _, r := range b.toBeCheckedRows {
  		if r.handleKey != nil {
  			batchKeys = append(batchKeys, r.handleKey.newKV.key)
  		}
  		for _, k := range r.uniqueKeys {
  			batchKeys = append(batchKeys, k.newKV.key)
  		}
  	}
  	txn, err := ctx.Txn(true)
  	if err != nil {
  		return err
  	}
  	b.dupKVs, err = txn.BatchGet(batchKeys)
  	return err
  }
docs: // batchGetInsertKeys uses batch-get to fetch all key-value pairs to be checked for ignore or duplicate key update.