Skip to content

Commit 4b405c6

Browse files
committed
Document EXPLAIN (OPT, ENV) URL output
Fixes #5191.
1 parent ba3738f commit 4b405c6

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

v19.2/explain.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,15 +279,28 @@ To include cost and type details, use `OPT, TYPES`:
279279

280280
<a name="opt-env-option"></a>
281281

282-
To include all details used by the optimizer, including statistics, use `OPT, ENV`:
282+
To include all details used by the optimizer, including statistics, use `OPT, ENV`.
283283

284284
{% include copy-clipboard.html %}
285285
~~~ sql
286286
> EXPLAIN (OPT, ENV) SELECT * FROM episodes WHERE season > 3 ORDER BY season ASC;
287287
~~~
288288

289289
~~~
290-
Version: CockroachDB CCL v19.2.0
290+
text
291+
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
292+
https://cockroachdb.github.io/text/decode.html#eJzEVcFum0wQPmefYsQl9v8DYQl1bCJVImTT0mIcwTatFUWIwLZZBbMWLE2jqlIewsc-nZ-kwjGUXNIeGpkDEt_HNzP7DTNcsLLiorDBFeltKZL05vQEXNeHr3iim7qhlamOYfBtPIpHlpYslznTsqS84wW2VLiueS7BNPDkABsH2AI8ts2xbVoqfBFYx6b-aoiQGxKHEqDOiU-ALXklMlbBAO3xDLyAjiGYUQg--L6K9iqWVKLYwo9QUS-ePEsucwYRDb3gTSeTSZklksEpcb2p47e4OwsiGjpeQEFZlnyRlPcKnIfe1Ann8J7MYcAzcCJ3qKK9M2fq-fPeewOeqfBYkApFvVBhk1qFNtsQDY8RcnxKwu3pGkaW7FZf1tc5T_XutF7wjrgUIupQL6KeG8H-JQIA-L65N5eSirxeFJViw2UHbgieKR1wpfYEJUsky-JEKjYoTRs0jDXDAoxt07TNkW5aE-PI_N8wbMNQesqMV5IXqYxTUReN-mjSY294JUWcijyW90vWxG787-uLZLHB4zippYjjJ1yd511co0eU4q6Xb4P_UP_ahMdGvLgRh8_6sGMPinrx4gaYz38JO3ZgM4G7noZdT8J2_by8DaN_b4P1BxvQ1f4xQuTTue94AQxm51QFElwMISJ-s0H_g7NwNv39G_n4loRku6XhNRzCLDwlIZzMW8yJ3GOkaZqGKlFKBOvVar16WK8eoGI5S-W2nPXqZwunSdHF79hW9JnnkpVVvyP9iG0Z6FcAAAD__yq9370=
293+
(1 row)
294+
~~~
295+
296+
<span class="version-tag">New in v19.1:</span> The output of `EXPLAIN (OPT,ENV)` is now a URL with the data encoded in the fragment portion. Opening the URL shows a page with the decoded data. This change makes it easier to share debugging information across different systems without encountering formatting issues.
297+
298+
Note that the data is processed in the local browser session and is never sent out over the network.
299+
300+
When you visit the URL above you should see the following output in your browser.
301+
302+
~~~
303+
Version: CockroachDB CCL v19.2.0-rc.1 (x86_64-apple-darwin14, built 2019/10/14 18:28:24, go1.12.5)
291304
292305
CREATE TABLE episodes (
293306
id INT8 NOT NULL,
@@ -304,7 +317,7 @@ ALTER TABLE startrek.public.episodes INJECT STATISTICS '[
304317
"columns": [
305318
"id"
306319
],
307-
"created_at": "2019-10-08 18:29:26.222957+00:00",
320+
"created_at": "2019-11-04 11:22:26.249072+00:00",
308321
"distinct_count": 79,
309322
"histo_col_type": "INT8",
310323
"name": "__auto__",
@@ -315,7 +328,7 @@ ALTER TABLE startrek.public.episodes INJECT STATISTICS '[
315328
"columns": [
316329
"season"
317330
],
318-
"created_at": "2019-10-08 18:29:26.222957+00:00",
331+
"created_at": "2019-11-04 11:22:26.249072+00:00",
319332
"distinct_count": 3,
320333
"histo_col_type": "",
321334
"name": "__auto__",
@@ -326,7 +339,7 @@ ALTER TABLE startrek.public.episodes INJECT STATISTICS '[
326339
"columns": [
327340
"num"
328341
],
329-
"created_at": "2019-10-08 18:29:26.222957+00:00",
342+
"created_at": "2019-11-04 11:22:26.249072+00:00",
330343
"distinct_count": 29,
331344
"histo_col_type": "",
332345
"name": "__auto__",
@@ -337,7 +350,7 @@ ALTER TABLE startrek.public.episodes INJECT STATISTICS '[
337350
"columns": [
338351
"title"
339352
],
340-
"created_at": "2019-10-08 18:29:26.222957+00:00",
353+
"created_at": "2019-11-04 11:22:26.249072+00:00",
341354
"distinct_count": 79,
342355
"histo_col_type": "",
343356
"name": "__auto__",
@@ -348,7 +361,7 @@ ALTER TABLE startrek.public.episodes INJECT STATISTICS '[
348361
"columns": [
349362
"stardate"
350363
],
351-
"created_at": "2019-10-08 18:29:26.222957+00:00",
364+
"created_at": "2019-11-04 11:22:26.249072+00:00",
352365
"distinct_count": 76,
353366
"histo_col_type": "",
354367
"name": "__auto__",

0 commit comments

Comments
 (0)