diff --git a/sql3/planner/opinsert.go b/sql3/planner/opinsert.go index 626c1dbce..cb10283e8 100644 --- a/sql3/planner/opinsert.go +++ b/sql3/planner/opinsert.go @@ -364,12 +364,14 @@ func (i *insertRowIter) Next(ctx context.Context) (types.Row, error) { } } + count := batch.Len() + if err := batch.Import(); err != nil { return nil, errors.Wrap(err, "importing batch") } // update the counter for inserts - pilosa.PerfCounterSQLInsertsSec.Add(int64(batch.Len())) + pilosa.PerfCounterSQLInsertsSec.Add(int64(count)) return nil, types.ErrNoMoreRows }