Skip to content

release-25.1: explain: show "execution time" on EXPLAIN ANALYZE output #143895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/ccl/logictestccl/testdata/logic_test/explain_call_plpgsql
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ quality of service: regular
sql nodes: <hidden>
regions: <hidden>
actual row count: 0
execution time: 0µs
estimated row count: 0
procedure: foo(3)

Expand All @@ -177,6 +178,7 @@ quality of service: regular
sql nodes: <hidden>
regions: <hidden>
actual row count: 0
execution time: 0µs
estimated row count: 0
procedure: foo(3)
·
Expand Down
31 changes: 31 additions & 0 deletions pkg/ccl/logictestccl/testdata/logic_test/triggers_explain
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ quality of service: regular
│ regions: <hidden>
│ actual row count: 1
│ vectorized batch count: 0
│ execution time: 0µs
│ estimated row count: 0 (missing stats)
│ table: xy
│ set: x, y
Expand All @@ -146,6 +147,7 @@ quality of service: regular
│ regions: <hidden>
│ actual row count: 0
│ vectorized batch count: 0
│ execution time: 0µs
│ estimated row count: 10 (missing stats)
│ filter: f IS DISTINCT FROM NULL
Expand Down Expand Up @@ -182,6 +184,7 @@ quality of service: regular
│ regions: <hidden>
│ actual row count: 0
│ vectorized batch count: 0
│ execution time: 0µs
│ estimated row count: 10 (missing stats)
│ filter: y = 2
Expand Down Expand Up @@ -338,6 +341,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 1
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ estimated row count: 0 (missing stats)
│ │ from: xy
│ │
Expand All @@ -347,6 +351,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 0
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ label: buffer 1
│ │
│ └── • filter
Expand All @@ -355,6 +360,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 0
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ estimated row count: 10 (missing stats)
│ │ filter: y = 2
│ │
Expand Down Expand Up @@ -412,6 +418,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 1
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ estimated row count: 0 (missing stats)
│ │ from: xy
│ │
Expand All @@ -421,6 +428,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 1
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ label: buffer 1
│ │
│ └── • filter
Expand All @@ -429,6 +437,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 1
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ estimated row count: 10 (missing stats)
│ │ filter: y = 2
│ │
Expand Down Expand Up @@ -479,6 +488,7 @@ quality of service: regular
regions: <hidden>
actual row count: 1
vectorized batch count: 0
execution time: 0µs
estimated row count: 1
label: buffer 1000000

Expand Down Expand Up @@ -684,6 +694,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 1
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ estimated row count: 0 (missing stats)
│ │ table: parent
│ │ set: k
Expand All @@ -694,6 +705,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 0
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ label: buffer 1
│ │
│ └── • render
Expand Down Expand Up @@ -757,6 +769,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 1
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ estimated row count: 0 (missing stats)
│ │ table: parent
│ │ set: k
Expand All @@ -767,6 +780,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 1
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ label: buffer 1
│ │
│ └── • render
Expand Down Expand Up @@ -807,6 +821,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 0
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ estimated row count: 0 (missing stats)
│ │ table: child
│ │ set: fk
Expand All @@ -820,6 +835,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 1
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ label: buffer 1
│ │
│ └── • filter
Expand All @@ -828,6 +844,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 1
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ estimated row count: 3 (missing stats)
│ │ filter: f IS DISTINCT FROM NULL
│ │
Expand Down Expand Up @@ -867,6 +884,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 1
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ estimated max memory allocated: 0 B
│ │ estimated row count: 3 (missing stats)
│ │ equality: (fk) = (k)
Expand Down Expand Up @@ -897,6 +915,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 1
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ estimated row count: 0
│ │ filter: k IS DISTINCT FROM k_new
│ │
Expand All @@ -906,6 +925,7 @@ quality of service: regular
│ regions: <hidden>
│ actual row count: 1
│ vectorized batch count: 0
│ execution time: 0µs
│ estimated row count: 1
│ label: buffer 1000000
Expand All @@ -917,6 +937,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 0
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │
│ └── • lookup join (anti)
│ │ columns: (fk_new)
Expand All @@ -931,6 +952,7 @@ quality of service: regular
│ │ KV pairs read: 2
│ │ KV bytes read: 8 B
│ │ KV gRPC calls: 1
│ │ execution time: 0µs
│ │ estimated max memory allocated: 0 B
│ │ MVCC step count (ext/int): 0/0
│ │ MVCC seek count (ext/int): 0/0
Expand All @@ -945,6 +967,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 1
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ estimated row count: 3 (missing stats)
│ │ filter: fk_new IS NOT NULL
│ │
Expand All @@ -957,6 +980,7 @@ quality of service: regular
│ regions: <hidden>
│ actual row count: 1
│ vectorized batch count: 0
│ execution time: 0µs
│ estimated row count: 3 (missing stats)
│ label: buffer 1
Expand Down Expand Up @@ -991,6 +1015,7 @@ quality of service: regular
regions: <hidden>
actual row count: 1
vectorized batch count: 0
execution time: 0µs
estimated row count: 1
label: buffer 1000000

Expand Down Expand Up @@ -1025,6 +1050,7 @@ quality of service: regular
│ regions: <hidden>
│ actual row count: 1
│ vectorized batch count: 0
│ execution time: 0µs
│ estimated row count: 0 (missing stats)
│ from: parent
│ spans: /2/0
Expand All @@ -1041,6 +1067,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 0
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ estimated row count: 0 (missing stats)
│ │ from: child
│ │
Expand All @@ -1053,6 +1080,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 1
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ label: buffer 1
│ │
│ └── • filter
Expand All @@ -1061,6 +1089,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 1
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ estimated row count: 10 (missing stats)
│ │ filter: f IS DISTINCT FROM NULL
│ │
Expand Down Expand Up @@ -1091,6 +1120,7 @@ quality of service: regular
│ │ regions: <hidden>
│ │ actual row count: 1
│ │ vectorized batch count: 0
│ │ execution time: 0µs
│ │ estimated row count: 10 (missing stats)
│ │ filter: fk = 2
│ │
Expand Down Expand Up @@ -1141,6 +1171,7 @@ quality of service: regular
regions: <hidden>
actual row count: 1
vectorized batch count: 0
execution time: 0µs
estimated row count: 1
label: buffer 1000000

Expand Down
1 change: 1 addition & 0 deletions pkg/sql/instrumentation.go
Original file line number Diff line number Diff line change
Expand Up @@ -1067,6 +1067,7 @@ func (m execNodeTraceMetadata) annotateExplain(
nodeStats.SeekCount.MaybeAdd(stats.KV.NumInterfaceSeeks)
nodeStats.InternalSeekCount.MaybeAdd(stats.KV.NumInternalSeeks)
nodeStats.VectorizedBatchCount.MaybeAdd(stats.Output.NumBatches)
nodeStats.ExecTime.MaybeAdd(stats.Exec.ExecTime)
nodeStats.MaxAllocatedMem.MaybeAdd(stats.Exec.MaxAllocatedMem)
nodeStats.MaxAllocatedDisk.MaybeAdd(stats.Exec.MaxAllocatedDisk)
if noMutations && !makeDeterministic {
Expand Down
Loading