Skip to content

[codex] add query log resource usage fields#789

Merged
bill-ph merged 1 commit into
mainfrom
codex/query-log-resource-usage
Jun 17, 2026
Merged

[codex] add query log resource usage fields#789
bill-ph merged 1 commit into
mainfrom
codex/query-log-resource-usage

Conversation

@bill-ph

@bill-ph bill-ph commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add cpu_time_s and peak_buffer_memory_bytes to system.query_log
  • populate both fields from the existing DuckDB profiling summary path alongside postgres_scan_ms
  • add query-log defaults/backfill so unavailable profiling stores 0, not NULL
  • emit duckdb.cpu_time_s on execute spans and document the new query-log fields

Scope

This intentionally follows the existing postgres_scan_ms convention. It does not expand profiling coverage for COPY, simple-batch, or other paths that were not already reliably covered by the existing profiling summary flow.

Validation

  • go test ./server -run 'TestEnsureQueryLogTable(CreatesResourceUsageColumns|AddsOrgIDToExistingTable)|Test(QueryLoggerFlushBatchPersistsOrgID|LogQueryCopiesProfilingSummaryToQueryLogEntry|EnrichSpanWithProfilingSummaryIncludesResourceUsage)'
  • go test ./server
  • go test ./server/observe ./server/flightclient
  • just test-unit
  • just lint
  • git diff --check

@bill-ph bill-ph marked this pull request as ready for review June 17, 2026 00:07
@bill-ph bill-ph merged commit 7c98f48 into main Jun 17, 2026
25 checks passed
@bill-ph bill-ph deleted the codex/query-log-resource-usage branch June 17, 2026 00:17
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