Skip to content

Add RESULT_COLLECTOR profiling metric#38

Open
krleonid wants to merge 6 commits into
mainfrom
feature/result-collector-profiling
Open

Add RESULT_COLLECTOR profiling metric#38
krleonid wants to merge 6 commits into
mainfrom
feature/result-collector-profiling

Conversation

@krleonid
Copy link
Copy Markdown
Owner

@krleonid krleonid commented May 7, 2026

Summary

  • Adds a new RESULT_COLLECTOR phase timing metric that measures time spent in executor.GetResult() during result materialization
  • Helps diagnose latency gaps between DuckDB's reported query execution time and actual wall-clock time (e.g., SELECT * with many columns showing ~3s wall time but only ~3ms CPU time)
  • Includes dedicated test covering metric presence, root-only scoping, and disable behavior

Test plan

  • test_custom_profiling_result_collector.test passes (30 assertions)
  • Generated enum files via scripts/generate_metric_enums.py (72 metrics, 10 phase_timing)
  • Full build passes without errors

🤖 Generated with Claude Code

krleonid and others added 6 commits May 8, 2026 00:14
Instruments the executor.GetResult() call in FetchResultInternal with a new
phase timing metric to measure time spent collecting and materializing query
results. This helps diagnose latency gaps between DuckDB's reported execution
time and actual wall-clock time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instruments two additional unprofiled gaps in the query execution path:
- EXECUTOR_INITIALIZE: time spent building pipelines and scheduling tasks
- CLEANUP: time spent in post-execution cleanup including transaction commit

Together with RESULT_COLLECTOR, these cover all major gaps between
profiler.StartQuery() and profiler.EndQuery().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ANUP

The result collector's work is already captured in CPU_TIME as part of
pipeline execution. The EXECUTOR_INITIALIZE and CLEANUP phase metrics
cover the actual unprofiled gaps in the query lifecycle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant