You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Performance]: every statement calls statfs on the spill directory (ensureAllocationAccountLifecycle → refreshAutomaticSpillDiskCap) #32818
- Version or commit-id: main 8e8708a8d3 (compared with 625865c470)
- Hardware parameters: Apple M2 Max, 12 cores, 32 GB
- OS type: macOS 26.5
- Others: 2 CN processes sharing local MinIO, TZ=UTC; TPC-C 10 warehouses, 25 terminals per CN, 5 minutes
Details of Performance
On a TPC-C run, every statement now pays a statfs(2) syscall on the spill directory. Its CPU cost doubled between 625865c and main.
Call path:
Compile.ensureAllocationAccountLifecycle (pkg/sql/compile/allocation_account_lifecycle.go:302) calls proc.GetExecutionResourceBudget() whenever the physical plan has an operator that activates an allocation account (hasAllocationAccountActivator).
For a new generation, that goes through initializeGenerationSpillBudget → ExecutionResourceBudget.refreshAutomaticSpillDiskCap(proc.automaticSpillDiskAvailable) (pkg/vm/process/execution_resource_budget.go:2224, :521).
That calls spillDiskAvailableBytes → unix.Statfs (pkg/vm/process/spill_disk_capacity_unix.go:25), with no caching between statements.
perf(exec): consume selected scan batches through expressions and operators #32492 (49d552e, "perf(exec): consume selected scan batches through expressions and operators") made TableScan (pkg/sql/colexec/table_scan/types.go:92) and Filter (pkg/sql/colexec/filter/dictionary.go:26) allocation-account activators whenever they have a filter expression. Nearly every OLTP statement, a filtered point read or update, now takes this path.
Measured:
Setup: 60 s CPU profiles of the CN process taken 2 minutes into the run. Each build was cold-restarted, with tpcc restored from the same snapshot.
Results:
build
unix.Statfs CPU (all of it under ensureAllocationAccountLifecycle)
Activity
fix(compile): preserve prepared TP expression reuse (#32862)