SHOW TRACE FOR <stmt> removed in favor of SHOW TRACE FOR SESSION

8 views
Skip to first unread message

k...@cockroachlabs.com

unread,
Jul 9, 2018, 10:20:24 AM7/9/18
to CockroachDB
Hi everyone,

I am merging this PR which removes support for the special syntax "SHOW TRACE FOR <stmt>".

The commit message details the motivations and alternatives but here's the gist:

1) it was very hard to implement properly and maintain successfully
2) it was inadequate: because this SHOW TRACE variant would only start tracing when the execution of the query would start, the trace does not include any information about:
  • the work done during planning.
  • query distribution.
  • subquery execution.
  • lease acquisition.
  • transaction retries.
  • schema changes.
  • transaction cleanup.

The cost of maintaining the complexity added to the cost of running into the pitfalls of incomplete traces is deemed to be too high and this patch thus removes the feature.


You can still use the functionality via the following SQL code:


SET tracing = on;

<your stmt>;

SET tracing = off;

SHOW TRACE FOR SESSION;


You'll need the option `kv` (`SET tracing = on, kv`) to use SHOW KV TRACE FOR SESSION.


A new option `results` captures the result rows in the trace too.


Thanks

Reply all
Reply to author
Forward
0 new messages