Hello Quanlong Huang, Kurt Deschler, Aleksandr Efimov, Wenzhe Zhou, Impala 
Public Jenkins,

I'd like you to reexamine a change. Please visit

    https://gerrit.cloudera.org/24992

to look at the new patch set (#12).

Change subject: IMPALA-15418: Add Bottleneck Summary to query profiles
......................................................................

IMPALA-15418: Add Bottleneck Summary to query profiles

Adds a short "Bottleneck Summary" to the Summary section of the query
profile that ranks plan nodes by the fraction of the query's execution
wall time they consumed.

The existing per-node "% non-child" value does not help with this,
because it is relative to the node's own total time rather than to the
query. This patch adds a query-relative measure of operator time and
uses it to list the most expensive operators:

  Bottleneck Summary:
  Bottleneck 1: 18.37% 01:SCAN HDFS
  Bottleneck 2: 9.48% 02:HASH JOIN
  Bottleneck 3: 9.01% 00:SCAN HDFS

Key changes:
- The exec summary gets the query's execution wall time
  (exec_wall_time_ns): the longest execution time of any fragment
  instance, measured on the coordinator from when its backend accepted
  the exec RPC. Instances that are still running use the time elapsed
  so far, so running queries also get a value.
- Each plan node gets a query time fraction (query_time_frac): its
  local time on its slowest instance divided by the execution wall
  time, clamped to [0, 1]. Local time excludes time spent in child
  operators, so the value shows how long the operator itself was
  running. Fractions do not add up to 1, because fragments run
  concurrently.
- Both are computed on a copy of the exec summary each time the
  coordinator returns it, outside the exec summary lock. This makes
  the Bottleneck Summary available for running queries, where node
  times are as of the last status report, and keeps it up to date on
  every profile request.
- Also finalize per-instance profile counters (CompletionTime,
  ExecutionRate) in ComputeQuerySummary() when the query is cancelled or
  fails before the client calls Wait(). Previously ComputeQuerySummary()
  returned early in that case and UpdateExecStats(finalize=true) was
  never called, so these counters were missing from the profile.
- Adds two advanced query options for the summary:
  BOTTLENECK_SUMMARY_MAX_ENTRIES (default 3, 0 disables the summary)
  and BOTTLENECK_SUMMARY_MIN_QUERY_TIME_FRAC (default 0.05).

Subsequent patches will build on query_time_frac to attach a resource
and cause to each bottleneck and to highlight hotspots in the query
timeline.

Testing:
- Added BE unit tests for the max elapsed time of running and finished
  instances, computing the fractions, selecting bottlenecks (ranking,
  thresholds, ties and max entries), RemoveInfoString() and the valid
  ranges of the new query options.
- Added e2e tests that check the fractions against per-instance times,
  that an operator with an injected delay ranks first in the summary
  with MT_DOP=0 and MT_DOP=2, that the query options control the
  number of entries, and that a running query has fractions and a
  Bottleneck Summary.
- Added a web UI test that checks query_time_frac in the query plan
  JSON.

Change-Id: I6d63cdb9dca24981054bf7c524c1bc3cd3167452
Assisted-by: Claude Opus 5.5 (Cursor)
---
M be/src/runtime/CMakeLists.txt
M be/src/runtime/coordinator-backend-state-test.cc
M be/src/runtime/coordinator-backend-state.cc
M be/src/runtime/coordinator-backend-state.h
M be/src/runtime/coordinator.cc
M be/src/runtime/coordinator.h
M be/src/service/impala-http-handler.cc
M be/src/service/impala-server.cc
M be/src/service/query-options-test.cc
M be/src/service/query-options.cc
M be/src/service/query-options.h
M be/src/util/runtime-profile-test.cc
M be/src/util/runtime-profile.cc
M be/src/util/runtime-profile.h
M common/thrift/ExecStats.thrift
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M tests/query_test/test_observability.py
M tests/webserver/test_web_pages.py
19 files changed, 991 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/92/24992/12
--
To view, visit https://gerrit.cloudera.org/24992
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I6d63cdb9dca24981054bf7c524c1bc3cd3167452
Gerrit-Change-Number: 24992
Gerrit-PatchSet: 12
Gerrit-Owner: Arnab Karmakar <[email protected]>
Gerrit-Reviewer: Aleksandr Efimov <[email protected]>
Gerrit-Reviewer: Arnab Karmakar <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Kurt Deschler <[email protected]>
Gerrit-Reviewer: Quanlong Huang <[email protected]>
Gerrit-Reviewer: Wenzhe Zhou <[email protected]>

Reply via email to