sql: initial batch sizes too large with no row estimate hint #62524
Labels
A-sql-execution
Relating to SQL execution.
C-performance
Perf of queries or internals. Solution not expected to change functional behavior.
While reviewing #62282,
kv95
benchmarks were shown to regress somewhat. This still holds after landing onmaster
, with e.g.kv95/enc=false/nodes=1/cpu=32
giving 66304 ops/s before the patch and 58862 ops/s after the patch. When reverting to using 1 as the minimum capacity instead ofestimatedRowCount
in theResetMaybeReallocate
call the performance goes back to the baseline:cockroach/pkg/sql/colfetcher/cfetcher.go
Line 329 in 5041b22
While debugging, it was found that
estimatedRowCount
would often be 0, which would causeResetMaybeReallocate
to allocate a batch ofcoldata.BatchSize()
(i.e. 1024) every time, instead of 1 which was the old behavior. This probably explains the performance drop.cockroach/pkg/sql/colmem/allocator.go
Lines 168 to 170 in 5041b22
The text was updated successfully, but these errors were encountered: