cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.03k stars 3.79k forks source link

Document SHOW STATISTICS using JSON and INJECT STATISTICS #66061

Open glennfawcett opened 3 years ago

glennfawcett commented 3 years ago

Is your feature request related to a problem? Please describe. Need to Document

Describe the solution you'd like Docs to be created as mentioned above

Additional context

This is an example of what I am doing to copy statistics from one table to another...

cockroach sql -e 'show statistics using json for table kv.kv' --insecure --format raw | grep -v '^#' | while read s do echo "ALTER TABLE kv.kv2 INJECT STATISTICS '$s';" | cockroach sql --insecure done

Jira issue: CRDB-7865

github-actions[bot] commented 1 year ago

We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!

sheaffej commented 1 year ago

This is still relevant, as the SHOW STATISTICS docs do not currently show the syntax for USING JSON, nor is there a page that I can find that describes how to inject these statistics into another cluster.