Skip to content

Conversation

ericharmeling
Copy link
Contributor

@ericharmeling ericharmeling commented Oct 6, 2021

Fixes #11346.
Fixes #11300.
Fixes #11432.
Fixes #11446.
Fixes #11302.
Fixes #11486.
Fixes #11364.
Fixes #11271.
Fixes #11349.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@github-actions
Copy link

github-actions bot commented Oct 6, 2021

Files changed:

v21.2/crdb-internal.md

@netlify
Copy link

netlify bot commented Oct 6, 2021

✔️ Netlify Preview

🔨 Explore the source changes: e5cc47e

🔍 Inspect the deploy log: https://app.netlify.com/sites/cockroachdb-docs/deploys/61686d9c881f3f000751ab0d

😎 Browse the preview: https://deploy-preview-11902--cockroachdb-docs.netlify.app/docs/v21.2/crdb-internal

@ericharmeling
Copy link
Contributor Author

@rmloveland Adding you to review, as some of these tables touch on KV stuff.

@ericharmeling ericharmeling requested a review from rafiss October 12, 2021 19:04
Copy link
Contributor

@rmloveland rmloveland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Mostly squawking about more cowbell links

`active_range_feeds` | Contains information about [range feeds](architecture/distribution-layer.html) on nodes in your cluster.
`backward_dependencies` | Contains information about backward dependencies.
`builtin_functions` | Contains information about supported [functions](functions-and-operators.html).
`cluster_contended_indexes` | Contains information about contended indexes in your cluster.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these contended things are due to transaction contention (are they being contended on during transactions?), it would be good to link to our transaction contention stuff

`cluster_contended_tables` | Contains information about contended tables in your cluster.
`cluster_contention_events` | Contains information about contention in your cluster.
`cluster_database_privileges` | Contains information about the [database privileges](authorization.html#privileges) on your cluster.
`cluster_distsql_flows` | Contains information about the flows of the [DistSQL execution](architecture/sql-layer.html#distsql) scheduled in your cluster.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noice

`cluster_transactions` | Contains information about transactions running on your cluster.
`create_statements` | Contains information about tables and indexes in your database.
`create_type_statements` | Contains information about [user-defined types](enum.html) in your database.
`cross_db_references` | Contains information about objects that reference other objects across databases in your cluster.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be good to say something like "other objects such as foreign keys or views" since the FK and view docs make reference to cross-DB things, e.g. from FK doc:

By default, referenced columns must be in the same database as the referencing foreign key column. To enable cross-database foreign key references, set the sql.cross_db_fks.enabled cluster setting to true.

`gossip_network` | Contains information about your cluster's gossip network.
`gossip_nodes` | Contains information about nodes in your cluster's gossip network.
`index_columns` | Contains information about indexed columns in your cluster.
`index_usage_statistics` | Contains index usage statistics.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`interleaved` | Contains information about [interleaved objects](interleave-in-parent.html) in your cluster.
`invalid_objects` | Contains information about invalid objects in your cluster.
`jobs` | Contains information about [jobs](show-jobs.html) running on your cluster.
`kv_node_liveness` | Contains information about [node liveness](cluster-setup-troubleshooting.html#node-liveness-issues).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noice++

`kv_node_status` | Contains information about node status at the [key-value layer](architecture/storage-layer.html).
`kv_store_status` | Contains information about the key-value store for your cluster.
`leases` | Contains information about [leases](architecture/replication-layer.html#leases) in your cluster.
`lost_descriptors_with_data` | Contains information about table descriptors that have been deleted but still have data left over in storage.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we mention 'table descriptors' in a couple places but we don't have real docs, kinda wish we did
(aha! just found #9218 - cool)
anyway nothing for us to do here in this PR, carry on :-)

`predefined_comments` | Contains predefined comments about your cluster.
`ranges` | Contains information about ranges in your cluster.
`ranges_no_leases` | Contains information about ranges in your cluster, without leases.
`regions` | Contains information about cluster [regions](multiregion-overview.html).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be even more nerdtastic if this link were to the 'cluster regions' heading

(please don't kill me lol)

`schema_changes` | Contains information about schema changes in your cluster.
`session_trace` | Contains session trace information for your cluster.
`session_variables` | Contains information about [session variables](set-vars.html) in your cluster.
`statement_statistics` | Contains information about statement statistics.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK if either this or the transaction_statistics below have anything to do with the statistics created and used by the optimizer ?

Copy link
Contributor Author

@ericharmeling ericharmeling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TFTR @rmloveland !

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @Azhng, @rafiss, and @rmloveland)


v21.2/crdb-internal.md, line 27 at r1 (raw file):
Great point. Done for all 4 settings.

If these contended things are due to transaction contention

I believe they are.


v21.2/crdb-internal.md, line 40 at r1 (raw file):

Previously, rmloveland (Rich Loveland) wrote…

might be good to say something like "other objects such as foreign keys or views" since the FK and view docs make reference to cross-DB things, e.g. from FK doc:

By default, referenced columns must be in the same database as the referencing foreign key column. To enable cross-database foreign key references, set the sql.cross_db_fks.enabled cluster setting to true.

Done!


v21.2/crdb-internal.md, line 50 at r1 (raw file):

Previously, rmloveland (Rich Loveland) wrote…

index could link to https://www.cockroachlabs.com/docs/dev/indexes.html

Done.


v21.2/crdb-internal.md, line 75 at r1 (raw file):

Previously, rmloveland (Rich Loveland) wrote…

this could be even more nerdtastic if this link were to the 'cluster regions' heading

(please don't kill me lol)

Lol done.


v21.2/crdb-internal.md, line 79 at r1 (raw file):

Previously, rmloveland (Rich Loveland) wrote…

IDK if either this or the transaction_statistics below have anything to do with the statistics created and used by the optimizer ?

I think these are separate from the optimizer's table statistics. Like these are more about query stats and such, rather than table-specific stats surfaced by SHOW STATISTICS FOR TABLE <onetable>.

I think the statement_statistics and transaction_statistics relates more to what is displayed in the console Statements Page and Transactions Page, but I'm not sure if those pages pull from these.

@Azhng Do you know how/where/if these stats are being exposed to users other than in these crdb_internal tables?

Copy link

@Azhng Azhng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @rafiss and @rmloveland)


v21.2/crdb-internal.md, line 79 at r1 (raw file):

these are more about query stats and such, rather than table-specific stats surfaced by SHOW STATISTICS FOR TABLE .

This is correct

I think the statement_statistics and transaction_statistics relates more to what is displayed in the console Statements Page and Transactions Page, but I'm not sure if those pages pull from these.

This is also correct. Statement Page and Transaction Page does pull data from crdb_internal.statement_statistics and crdb_internal.transaction_statistics

how

We exposed a backend HTTP API endpoint at /_status/statements (though we discourage user from building things on top of those endpoints) which send back data it scanned from crdb_internal.statement_statistics and crdb_internal.transaction_statistics virtual tables

Statement Page and Transaction Page uses the data they fetch from the said API endpoint.

@ericharmeling ericharmeling force-pushed the 21.2-crdb-internal-tables branch from 3e576c3 to e5cc47e Compare October 14, 2021 17:49
Copy link
Contributor Author

@ericharmeling ericharmeling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @rafiss and @rmloveland)


v21.2/crdb-internal.md, line 79 at r1 (raw file):

Previously, Azhng (Archer Zhang) wrote…

these are more about query stats and such, rather than table-specific stats surfaced by SHOW STATISTICS FOR TABLE .

This is correct

I think the statement_statistics and transaction_statistics relates more to what is displayed in the console Statements Page and Transactions Page, but I'm not sure if those pages pull from these.

This is also correct. Statement Page and Transaction Page does pull data from crdb_internal.statement_statistics and crdb_internal.transaction_statistics

how

We exposed a backend HTTP API endpoint at /_status/statements (though we discourage user from building things on top of those endpoints) which send back data it scanned from crdb_internal.statement_statistics and crdb_internal.transaction_statistics virtual tables

Statement Page and Transaction Page uses the data they fetch from the said API endpoint.

Awesome. Makes sense. Thank you @Azhng !

@ericharmeling ericharmeling merged commit 86e3d32 into master Oct 15, 2021
@ericharmeling ericharmeling deleted the 21.2-crdb-internal-tables branch October 15, 2021 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants