Skip to content

Commit 8a7fb14

Browse files
committed
sql: remove some EXPLAIN [ANALYZE] fields in non-VERBOSE mode
The output of `EXPLAIN [ANALYZE]` in non-`VERBOSE` mode is now more succinct. In the header above the query plan the following changes have been made: 1. "isolation level" is only shown if it is not "serializable". 2. "priority" is only shown if it is not "normal". 3. "quality of service" is only shown if it is not "regular". 4. "sql cpu time" is not shown. 5. "DistSQL network usage" is only show if it is greater than 0. 6. "maximum memory usage" is not shown. 7. "cumulative time spent in KV" is not shown. 8. "vectorized" is only shown if it is "false". 9. "buffered writes enabled" is not shown. In each node of the query plan the following changes have been made: 1. "KV pairs read" is not shown. 2. "KV bytes read" is not shown. 3. "KV gRPC calls" is not shown. 4. "estimated max memory allocated" is not shown. 5. "estimated max sql temp disk usage" is not shown. 6. "actual row count" is directly above "estimated row count". Here's an example of what `EXPLAIN ANALYZE` looked like before: ``` planning time: 243µs execution time: 632µs distribution: local vectorized: true plan type: generic, reused cumulative time spent in KV: 331µs maximum memory usage: 20 KiB DistSQL network usage: 0 B (0 messages) regions: us-east1 sql cpu time: 20µs estimated RUs consumed: 0 isolation level: serializable priority: normal quality of service: regular • scan sql nodes: n1 kv nodes: n1 regions: us-east1 actual row count: 0 KV time: 331µs KV rows decoded: 0 KV bytes read: 0 B KV gRPC calls: 1 estimated max memory allocated: 20 KiB sql cpu time: 20µs missing stats table: t@t_pkey spans: [/0 - /0] ``` And here's the output with the same query after the changes in this commit: ``` planning time: 325µs execution time: 974µs distribution: local plan type: generic, reused regions: us-east1 estimated RUs consumed: 0 • scan sql nodes: n1 kv nodes: n1 regions: us-east1 KV time: 610µs KV rows decoded: 0 sql cpu time: 29µs actual row count: 0 missing stats table: t@t_pkey spans: [/0 - /0] ``` Release note (sql change): The output of `EXPLAIN [ANALYZE]` in non-`VERBOSE` mode is now more succinct.
1 parent 1572ff3 commit 8a7fb14

File tree

102 files changed

+265
-1607
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+265
-1607
lines changed

pkg/ccl/logictestccl/testdata/logic_test/explain_redact

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ query T
6363
EXPLAIN (REDACT) INSERT INTO p VALUES (1, 1)
6464
----
6565
distribution: local
66-
vectorized: true
6766
·
6867
• insert fast path
6968
into: p(p, q)
@@ -74,7 +73,6 @@ query T
7473
EXPLAIN (VERBOSE, REDACT) INSERT INTO p VALUES (1, 1)
7574
----
7675
distribution: local
77-
vectorized: true
7876
·
7977
• insert fast path
8078
columns: ()
@@ -177,7 +175,6 @@ query T
177175
EXPLAIN (REDACT) SELECT * FROM p WHERE p = 11
178176
----
179177
distribution: local
180-
vectorized: true
181178
·
182179
• scan
183180
missing stats
@@ -188,7 +185,6 @@ query T
188185
EXPLAIN (VERBOSE, REDACT) SELECT * FROM p WHERE p = 11
189186
----
190187
distribution: local
191-
vectorized: true
192188
·
193189
• scan
194190
columns: (p, q)
@@ -263,7 +259,6 @@ query T
263259
EXPLAIN (REDACT) SELECT * FROM q WHERE q > 2
264260
----
265261
distribution: local
266-
vectorized: true
267262
·
268263
• scan
269264
missing stats
@@ -274,7 +269,6 @@ query T
274269
EXPLAIN (VERBOSE, REDACT) SELECT * FROM q WHERE q > 2
275270
----
276271
distribution: local
277-
vectorized: true
278272
·
279273
• scan
280274
columns: (q, r)

pkg/ccl/logictestccl/testdata/logic_test/multi_region_foreign_key_lookup_join

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ FROM child
4848
INNER LOOKUP JOIN parent ON c_p_id = p_id
4949
----
5050
distribution: local
51-
vectorized: true
5251
·
5352
• lookup join
5453
│ table: parent@parent_pkey
@@ -67,7 +66,6 @@ FROM child
6766
INNER LOOKUP JOIN parent ON p_data = c_data
6867
----
6968
distribution: local
70-
vectorized: true
7169
·
7270
• render
7371
@@ -126,7 +124,6 @@ FROM child_rbr
126124
INNER LOOKUP JOIN parent_rbr ON c_p_id = p_id
127125
----
128126
distribution: local
129-
vectorized: true
130127
·
131128
• lookup join
132129
│ table: parent_rbr@parent_rbr_pkey
@@ -154,7 +151,6 @@ FROM child_rbr
154151
INNER JOIN parent_rbr ON c_p_id = p_id WHERE c_int = 1
155152
----
156153
distribution: local
157-
vectorized: true
158154
·
159155
• lookup join
160156
│ table: parent_rbr@parent_rbr_pkey
@@ -184,7 +180,6 @@ FROM child_rbr
184180
INNER LOOKUP JOIN parent_rbr ON c_p_id = p_id AND c_int + c_int2 = p_int WHERE c_int2 > -1
185181
----
186182
distribution: local
187-
vectorized: true
188183
·
189184
• lookup join
190185
│ table: parent_rbr@parent_rbr_pkey
@@ -219,7 +214,6 @@ FROM child_rbr
219214
INNER LOOKUP JOIN parent_rbr ON c_p_id = p_id WHERE child_rbr.crdb_region = 'ap-southeast-2'
220215
----
221216
distribution: local
222-
vectorized: true
223217
·
224218
• lookup join
225219
│ table: parent_rbr@parent_rbr_pkey

pkg/ccl/logictestccl/testdata/logic_test/multi_region_locality_optimized_search_query_behavior

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ WHERE home_region IN ('ap':::STRING, 'ca':::STRING, 'us':::STRING)
6262
AND address = '221B Baker Street';
6363
----
6464
distribution: local
65-
vectorized: true
6665
·
6766
• render
6867
@@ -79,7 +78,6 @@ WHERE home_region IN ('ap':::STRING, 'ca':::STRING, 'us':::STRING)
7978
AND address = '221B Baker Street' LIMIT 1;
8079
----
8180
distribution: local
82-
vectorized: true
8381
·
8482
• render
8583
@@ -106,7 +104,6 @@ WHERE home_region IN ('ap':::STRING, 'ca':::STRING, 'us':::STRING)
106104
AND address = '221B Baker Street' LIMIT 2;
107105
----
108106
distribution: local
109-
vectorized: true
110107
·
111108
• render
112109
@@ -128,7 +125,6 @@ WHERE home_region IN ('ap':::STRING, 'ca':::STRING, 'us':::STRING)
128125
AND address = '221B Baker Street';
129126
----
130127
distribution: local
131-
vectorized: true
132128
·
133129
• render
134130

pkg/ccl/logictestccl/testdata/logic_test/multi_region_query_behavior

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ query T retry
3939
EXPLAIN INSERT INTO child (id, p_id) VALUES (1, 10), (2, 150)
4040
----
4141
distribution: local
42-
vectorized: true
4342
·
4443
• root
4544
@@ -266,7 +265,6 @@ VALUES
266265
(2057, 4, 3, 4, 3, 2100.9, '2021-04-15 15:22:14', '9 zmssaF9m')
267266
----
268267
distribution: local
269-
vectorized: true
270268
·
271269
• root
272270
@@ -352,7 +350,6 @@ WHERE
352350
order_id = '94e4b847-8f2f-4ac5-83f1-641d6e3df727'
353351
----
354352
distribution: local
355-
vectorized: true
356353
·
357354
• render
358355
@@ -386,7 +383,6 @@ WHERE
386383
order_id = '94e4b847-8f2f-4ac5-83f1-641d6e3df727'
387384
----
388385
distribution: local
389-
vectorized: true
390386
·
391387
• render
392388
@@ -442,7 +438,6 @@ query T
442438
EXPLAIN UPDATE t85043 SET ts = '2022-08-01 18:07:07' WHERE id = 'ab020c49-ba5e-4800-8000-00000000014e'
443439
----
444440
distribution: local
445-
vectorized: true
446441
·
447442
• update
448443
│ table: t85043

pkg/ccl/logictestccl/testdata/logic_test/partitioning_implicit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ query T
257257
EXPLAIN INSERT INTO fk_using_implicit_columns_against_t VALUES (1, 1, 4)
258258
----
259259
distribution: local
260-
vectorized: true
261260
·
262261
• root
263262
@@ -735,7 +734,6 @@ query T
735734
EXPLAIN INSERT INTO t VALUES (1, 1, 1, 1, 1, 1, 1)
736735
----
737736
distribution: local
738-
vectorized: true
739737
·
740738
• root
741739
@@ -805,7 +803,6 @@ query T
805803
EXPLAIN UPSERT INTO t VALUES (3, 3, 3, 3, 3, 3, 3)
806804
----
807805
distribution: local
808-
vectorized: true
809806
·
810807
• root
811808

pkg/ccl/logictestccl/testdata/logic_test/partitioning_implicit_read_committed

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ CREATE TABLE t (
5050
j JSON,
5151
UNIQUE INDEX (c),
5252
FAMILY (pk, a, b, c, d, j)
53-
) PARTITION ALL BY LIST(a) (
53+
) PARTITION ALL BY LIST(a) (
5454
PARTITION one VALUES IN ('one'),
5555
PARTITION two VALUES IN ('two'),
5656
PARTITION three VALUES IN ('three'),
@@ -194,7 +194,6 @@ query T
194194
EXPLAIN INSERT INTO t VALUES (1, 'two', 3, 4, 5)
195195
----
196196
distribution: local
197-
vectorized: true
198197
·
199198
• insert fast path
200199
into: t(pk, a, b, c, d, j)
@@ -229,7 +228,6 @@ query T
229228
EXPLAIN UPDATE t SET c = 4 WHERE pk = 2
230229
----
231230
distribution: local
232-
vectorized: true
233231
·
234232
• update
235233
│ table: t
@@ -269,7 +267,6 @@ query T
269267
EXPLAIN UPSERT INTO t VALUES (1, 'five', 3, 4, 15)
270268
----
271269
distribution: local
272-
vectorized: true
273270
·
274271
• upsert
275272
│ into: t(pk, a, b, c, d, j)
@@ -313,7 +310,6 @@ query T
313310
EXPLAIN INSERT INTO t VALUES (1, 'three', 3, 4, 15) ON CONFLICT DO NOTHING
314311
----
315312
distribution: local
316-
vectorized: true
317313
·
318314
• insert
319315
│ into: t(pk, a, b, c, d, j)
@@ -347,7 +343,6 @@ query T
347343
EXPLAIN INSERT INTO t VALUES (1, 'one', 3, 4, 5) ON CONFLICT (pk) DO UPDATE SET d = t.d + 10
348344
----
349345
distribution: local
350-
vectorized: true
351346
·
352347
• upsert
353348
│ into: t(pk, a, b, c, d, j)

0 commit comments

Comments
 (0)