Skip to content

sqlstats: add idle_lat to node_statement_statistics#92281

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
matthewtodd:idle_lat-node_statement_statistics
Nov 23, 2022
Merged

sqlstats: add idle_lat to node_statement_statistics#92281
craig[bot] merged 1 commit intocockroachdb:masterfrom
matthewtodd:idle_lat-node_statement_statistics

Conversation

@matthewtodd
Copy link
Copy Markdown

@matthewtodd matthewtodd commented Nov 21, 2022

Part of #86667.

For parity with our existing statement-level work in #91098.

(No release note here since node_statement_statistics is not one of the "Use in production" crdb_internal tables.)

Release note: None

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Part of #86667.

For parity with our existing statement-level work in #91098.

Release note: None
@matthewtodd matthewtodd marked this pull request as ready for review November 22, 2022 00:55
@matthewtodd matthewtodd requested review from a team November 22, 2022 00:55
Copy link
Copy Markdown
Contributor

@xinhaoz xinhaoz left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 4 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @matthewtodd)


pkg/sql/crdb_internal.go line 1186 at r1 (raw file):

  rows_var            FLOAT NOT NULL,
  idle_lat_avg        FLOAT NOT NULL,
  idle_lat_var        FLOAT NOT NULL,

Just wondering, do we have any sort of precedence of adding new columns to the end, to preserve the order of columns in things like SELECT * ?

Copy link
Copy Markdown
Author

@matthewtodd matthewtodd 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 @xinhaoz)


pkg/sql/crdb_internal.go line 1186 at r1 (raw file):

Previously, xinhaoz (Xin Hao Zhang) wrote…

Just wondering, do we have any sort of precedence of adding new columns to the end, to preserve the order of columns in things like SELECT * ?

Good question! I have no idea -- I'll ask. (And maybe it's okay here, since we're non-committal about the stability of this table?)

Copy link
Copy Markdown
Collaborator

@rafiss rafiss 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 @xinhaoz)


pkg/sql/crdb_internal.go line 1186 at r1 (raw file):

Previously, matthewtodd (Matthew Todd) wrote…

Good question! I have no idea -- I'll ask. (And maybe it's okay here, since we're non-committal about the stability of this table?)

separately, just wondering: are these new columns also going to end up being flushed to system.statement_statistics and appear in the crdb_internal.statement_statistics view?

i think in the case of tables that are actually "internal only" adding columns in the middle is fine. but for the externally-used tables, they should be added at the end. so if these will be at the end of crdb_internal.statement_statistics, then maybe they should be at the end here too. up to you, i don't feel strongly

Copy link
Copy Markdown
Author

@matthewtodd matthewtodd 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 @xinhaoz)


pkg/sql/crdb_internal.go line 1186 at r1 (raw file):

Previously, rafiss (Rafi Shamim) wrote…

separately, just wondering: are these new columns also going to end up being flushed to system.statement_statistics and appear in the crdb_internal.statement_statistics view?

i think in the case of tables that are actually "internal only" adding columns in the middle is fine. but for the externally-used tables, they should be added at the end. so if these will be at the end of crdb_internal.statement_statistics, then maybe they should be at the end here too. up to you, i don't feel strongly

Thank you both. It turns out this is the only table with explicit columns for these values: crdb_internal.statement_statistics and system.statement_statistics put them into a json blob in their statistics columns instead, so we're all good!

@matthewtodd
Copy link
Copy Markdown
Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Nov 22, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Nov 23, 2022

Build succeeded:

@craig craig bot merged commit b60baa6 into cockroachdb:master Nov 23, 2022
@matthewtodd matthewtodd deleted the idle_lat-node_statement_statistics branch November 23, 2022 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants