Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Surface index usage statistics in the CC/DB console: Table overview #67647

Closed
kevin-v-ngo opened this issue Jul 15, 2021 · 2 comments · Fixed by #72948
Closed

Surface index usage statistics in the CC/DB console: Table overview #67647

kevin-v-ngo opened this issue Jul 15, 2021 · 2 comments · Fixed by #72948
Assignees
Labels
A-sql-console-general SQL Observability issues on the DB console spanning multiple areas. Includes Cockroach Cloud Console C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Comments

@kevin-v-ngo
Copy link

kevin-v-ngo commented Jul 15, 2021

We are capturing index usage statistics: #64740. This issue tracks building an experience around this view on the table overview page.

Figma mockups: https://www.figma.com/file/xdmwvnFQd6KkO9RJ0XLDH0/22.1_SQL-obsrv_query-performance?node-id=3498%3A33376

CC @Annebirzin

Epic: CRDB-9075

@kevin-v-ngo kevin-v-ngo added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-observability A-sql-console-general SQL Observability issues on the DB console spanning multiple areas. Includes Cockroach Cloud Console labels Jul 15, 2021
@kevin-v-ngo kevin-v-ngo self-assigned this Jul 19, 2021
@maryliag
Copy link
Contributor

maryliag commented Oct 4, 2021

@Annebirzin do we have a design for this?

@Annebirzin
Copy link

Annebirzin commented Oct 5, 2021

@maryliag Designs for index usage stats are here: https://www.figma.com/file/xdmwvnFQd6KkO9RJ0XLDH0/22.1_SQL-obsrv_query-performance?node-id=3498%3A33376

There are screens at the bottom for future iterations, but the top two rows represent

  • V1: Adding checks for 'unused indexes'
  • V2: Adding checks for 'wide indexes'

cc @kevin-v-ngo

@kevin-v-ngo kevin-v-ngo changed the title Surface index usage statistics in the DB console Surface index usage statistics in the DB console: Table overview Oct 29, 2021
@kevin-v-ngo kevin-v-ngo removed their assignment Oct 29, 2021
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 11, 2021
Resolves cockroachdb#67647

Previously, we had an RPC endpoint for retrieving all index usage
statistics. However, this endpoint should only be used for internal
purposes. We needed an endpoint that can be exposed to the frontend, for
use in the Index Stats table (which will be created in a following
commit).

Hence, this commit creates a new RPC endpoint and functions that read
the required index usage statistics directly from the database using
SQL. Instead of returning all index usage statistics, we only retrieve
the indexes for a specified database and table.

Release note (api change): Add new api endpoint for getting a table's
index statistics.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 11, 2021
Partially addresses cockroachdb#67647

Previously, we had an RPC endpoint for retrieving all index usage
statistics. However, this endpoint should only be used for internal
purposes. We needed an endpoint that can be exposed to the frontend, for
use in the Index Stats table (which will be created in a following
commit).

Hence, this commit creates a new RPC endpoint and functions that read
the required index usage statistics directly from the database using
SQL. Instead of returning all index usage statistics, we only retrieve
the indexes for a specified database and table.

Release note (api change): Add new api endpoint for getting a table's
index statistics.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 11, 2021
Partially addresses cockroachdb#67647

Previously, we had an RPC endpoint for retrieving all index usage
statistics. However, this endpoint should only be used for internal
purposes. We needed an endpoint that can be exposed to the frontend, for
use in the Index Stats table (which will be created in a following
commit).

Hence, this commit creates a new RPC endpoint and functions that read
the required index usage statistics directly from the database using
SQL. Instead of returning all index usage statistics, we only retrieve
the indexes for a specified database and table.

Release note (api change): Add new api endpoint for getting a table's
index statistics.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 11, 2021
Partially addresses cockroachdb#67647

Previously, we had an RPC endpoint for retrieving all index usage
statistics. However, this endpoint should only be used for internal
purposes. We needed an endpoint that can be exposed to the frontend, for
use in the Index Stats table (which will be created in a following
commit).

Hence, this commit creates a new RPC endpoint and functions that read
the required index usage statistics directly from the database using
SQL. Instead of returning all index usage statistics, we only retrieve
the indexes for a specified database and table.

Release note (api change): Add new api endpoint for getting a table's
index statistics.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 11, 2021
Partially addresses cockroachdb#67647

Previously, we had an RPC endpoint for retrieving all index usage
statistics. However, this endpoint should only be used for internal
purposes. We needed an endpoint that can be exposed to the frontend, for
use in the Index Stats table (which will be created in a following
commit).

Hence, this commit creates a new RPC endpoint and functions that read
the required index usage statistics directly from the database using
SQL. Instead of returning all index usage statistics, we only retrieve
the indexes for a specified database and table.

Release note (api change): Add new api endpoint for getting a table's
index statistics.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 12, 2021
Partially addresses cockroachdb#67647

Previously, we had an RPC endpoint for retrieving all index usage
statistics. However, this endpoint should only be used for internal
purposes. We needed an endpoint that can be exposed to the frontend, for
use in the Index Stats table (which will be created in a following
commit).

Hence, this commit creates a new RPC endpoint and functions that read
the required index usage statistics directly from the database using
SQL. Instead of returning all index usage statistics, we only retrieve
the indexes for a specified database and table.

Release note (api change): Add new api endpoint for getting a table's
index statistics.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 12, 2021
Partially addresses cockroachdb#67647

Previously, we had an RPC endpoint for retrieving all index usage
statistics. However, this endpoint should only be used for internal
purposes. We needed an endpoint that can be exposed to the frontend, for
use in the Index Stats table (which will be created in a following
commit).

Hence, this commit creates a new RPC endpoint and functions that read
the required index usage statistics directly from the database using
SQL. Instead of returning all index usage statistics, we only retrieve
the indexes for a specified database and table.

Release note (api change): Add new api endpoint for getting a table's
index statistics.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 12, 2021
Partially addresses cockroachdb#67647

Previously, we had an RPC endpoint for retrieving all index usage
statistics. However, this endpoint should only be used for internal
purposes. We needed an endpoint that can be exposed to the frontend, for
use in the Index Stats table (which will be created in a following
commit).

Hence, this commit creates a new RPC endpoint and functions that read
the required index usage statistics directly from the database using
SQL. Instead of returning all index usage statistics, we only retrieve
the indexes for a specified database and table.

Release note (api change): Add new api endpoint for getting a table's
index statistics.
@kevin-v-ngo kevin-v-ngo changed the title Surface index usage statistics in the DB console: Table overview Surface index usage statistics in the CC/DB console: Table overview Nov 16, 2021
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 16, 2021
Partially addresses cockroachdb#67647

Previously, we had an RPC endpoint for retrieving all index usage
statistics. However, this endpoint should only be used for internal
purposes. We needed an endpoint that can be exposed to the frontend, for
use in the Index Stats table (which will be created in a following
commit).

Hence, this commit creates a new RPC endpoint and functions that read
the required index usage statistics directly from the database using
SQL. Instead of returning all index usage statistics, we only retrieve
the indexes for a specified database and table.

Release note (api change): Add new api endpoint for getting a table's
index statistics.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 17, 2021
Partially addresses cockroachdb#67647

Previously, we had an RPC endpoint for retrieving all index usage
statistics. However, this endpoint should only be used for internal
purposes. We needed an endpoint that can be exposed to the frontend, for
use in the Index Stats table (which will be created in a following
commit).

Hence, this commit creates a new RPC endpoint and functions that read
the required index usage statistics directly from the database using
SQL. Instead of returning all index usage statistics, we only retrieve
the indexes for a specified database and table.

Release note (api change): Add new api endpoint for getting a table's
index statistics.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 18, 2021
Partially addresses cockroachdb#67647

Previously, we had an RPC endpoint for retrieving all index usage
statistics. However, this endpoint should only be used for internal
purposes. We needed an endpoint that can be exposed to the frontend, for
use in the Index Stats table (which will be created in a following
commit).

Hence, this commit creates a new RPC endpoint and functions that read
the required index usage statistics directly from the database using
SQL. Instead of returning all index usage statistics, we only retrieve
the indexes for a specified database and table.

Release note (api change): Add new api endpoint for getting a table's
index statistics.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 19, 2021
Resolves cockroachdb#67647, cockroachdb#72842

Previously, there was no way to view and clear index usage stats from
the frontend db console. This commit adds Index Stats tables for each
table on the Table Detail pages, allowing users to view index names,
total reads, and last used statistics. This commit also adds the
functionality of clearing all index stats as a button on the Index Stats
tables.

Release note (ui change): Add index stats table and button to clear
index usage stats on the Table Details page for each table.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 24, 2021
Resolves cockroachdb#67647, cockroachdb#72842

Previously, there was no way to view and clear index usage stats from
the frontend db console. This commit adds Index Stats tables for each
table on the Table Detail pages, allowing users to view index names,
total reads, and last used statistics. This commit also adds the
functionality of clearing all index stats as a button on the Index Stats
tables.

Release note (ui change): Add index stats table and button to clear
index usage stats on the Table Details page for each table.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 24, 2021
Partially addresses cockroachdb#67647

Previously, we had an RPC endpoint for retrieving all index usage
statistics. However, this endpoint should only be used for internal
purposes. We needed an endpoint that can be exposed to the frontend, for
use in the Index Stats table (which will be created in a following
commit).

Hence, this commit creates a new RPC endpoint and functions that read
the required index usage statistics directly from the database using
SQL. Instead of returning all index usage statistics, we only retrieve
the indexes for a specified database and table.

Release note (api change): Add new api endpoint for getting a table's
index statistics.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 24, 2021
Partially addresses cockroachdb#67647

Previously, we had an RPC endpoint for retrieving all index usage
statistics. However, this endpoint should only be used for internal
purposes. We needed an endpoint that can be exposed to the frontend, for
use in the Index Stats table (which will be created in a following
commit).

Hence, this commit creates a new RPC endpoint and functions that read
the required index usage statistics directly from the database using
SQL. Instead of returning all index usage statistics, we only retrieve
the indexes for a specified database and table.

Release note (api change): Add new api endpoint for getting a table's
index statistics.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 24, 2021
Resolves cockroachdb#67647, cockroachdb#72842

Previously, there was no way to view and clear index usage stats from
the frontend db console. This commit adds Index Stats tables for each
table on the Table Detail pages, allowing users to view index names,
total reads, and last used statistics. This commit also adds the
functionality of clearing all index stats as a button on the Index Stats
tables.

Release note (ui change): Add index stats table and button to clear
index usage stats on the Table Details page for each table.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 24, 2021
Partially addresses cockroachdb#67647

Previously, we had an RPC endpoint for retrieving all index usage
statistics. However, this endpoint should only be used for internal
purposes. We needed an endpoint that can be exposed to the frontend, for
use in the Index Stats table (which will be created in a following
commit).

Hence, this commit creates a new RPC endpoint and functions that read
the required index usage statistics directly from the database using
SQL. Instead of returning all index usage statistics, we only retrieve
the indexes for a specified database and table.

Release note (api change): Add new api endpoint for getting a table's
index statistics.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 24, 2021
Partially addresses cockroachdb#67647

Previously, we had an RPC endpoint for retrieving all index usage
statistics. However, this endpoint should only be used for internal
purposes. We needed an endpoint that can be exposed to the frontend, for
use in the Index Stats table (which will be created in a following
commit).

Hence, this commit creates a new RPC endpoint and functions that read
the required index usage statistics directly from the database using
SQL. Instead of returning all index usage statistics, we only retrieve
the indexes for a specified database and table.

Release note (api change): Add new api endpoint for getting a table's
index statistics.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 25, 2021
Resolves cockroachdb#67647, cockroachdb#72842

Previously, there was no way to view and clear index usage stats from
the frontend db console. This commit adds Index Stats tables for each
table on the Table Detail pages, allowing users to view index names,
total reads, and last used statistics. This commit also adds the
functionality of clearing all index stats as a button on the Index Stats
tables.

Release note (ui change): Add index stats table and button to clear
index usage stats on the Table Details page for each table.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 25, 2021
Resolves cockroachdb#67647, cockroachdb#72842

Previously, there was no way to view and clear index usage stats from
the frontend db console. This commit adds Index Stats tables for each
table on the Table Detail pages, allowing users to view index names,
total reads, and last used statistics. This commit also adds the
functionality of clearing all index stats as a button on the Index Stats
tables.

Release note (ui change): Add index stats table and button to clear
index usage stats on the Table Details page for each table.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 25, 2021
Resolves cockroachdb#67647, cockroachdb#72842

Previously, there was no way to view and clear index usage stats from
the frontend db console. This commit adds Index Stats tables for each
table on the Table Detail pages, allowing users to view index names,
total reads, and last used statistics. This commit also adds the
functionality of clearing all index stats as a button on the Index Stats
tables.

Release note (ui change): Add index stats table and button to clear
index usage stats on the Table Details page for each table.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 25, 2021
Resolves cockroachdb#67647, cockroachdb#72842

Previously, there was no way to view and clear index usage stats from
the frontend db console. This commit adds Index Stats tables for each
table on the Table Detail pages, allowing users to view index names,
total reads, and last used statistics. This commit also adds the
functionality of clearing all index stats as a button on the Index Stats
tables.

Release note (ui change): Add index stats table and button to clear
index usage stats on the Table Details page for each table.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 25, 2021
Partially addresses cockroachdb#67647

Previously, we had an RPC endpoint for retrieving all index usage
statistics. However, this endpoint should only be used for internal
purposes. We needed an endpoint that can be exposed to the frontend, for
use in the Index Stats table (which will be created in a following
commit).

Hence, this commit creates a new RPC endpoint and functions that read
the required index usage statistics directly from the database using
SQL. Instead of returning all index usage statistics, we only retrieve
the indexes for a specified database and table.

Release note (api change): Add new api endpoint for getting a table's
index statistics.
craig bot pushed a commit that referenced this issue Nov 25, 2021
72660: roachpb/server: add new endpoint for getting a table's index stats r=lindseyjin a=lindseyjin

Partially addresses #67647

Previously, we had an RPC endpoint for retrieving all index usage
statistics. However, this endpoint should only be used for internal
purposes. We needed an endpoint that can be exposed to the frontend, for
use in the Index Stats table (which will be created in a following
commit).

Hence, this commit creates a new RPC endpoint and functions that read
the required index usage statistics directly from the database using
SQL. Instead of returning all index usage statistics, we only retrieve
the indexes for a specified database and table.

Release note (api change): Add new api endpoint for getting a table's
index statistics.

73135: ui: save search query on cache for Transactions page r=maryliag a=maryliag

Previously, a search  was not maintained when
the page change (e.g. coming back from Transaction details).
This commits saves the selected value to be used.

Partially adresses #71851

Release note: None

73139: backupccl: fix bug in database and schema restore cleanup r=stevendanna,RichardJCai a=adityamaru

This change fixes a bug where during restore cleanup we
would delete the database descriptor, and namespace entry
only to add the descriptor entry back when clearing the schema
references in the database desc slice.

We fix this by first clearing the schema reference in the db
descroptor slice, and then going through the motions of dropping
the database descriptor.

Fixes: #72248

Release note (bug fix): Fix bug in database and schema restore
cleanup that results in a dangling descriptor entry on job failure.

Co-authored-by: Lindsey Jin <[email protected]>
Co-authored-by: Marylia Gutierrez <[email protected]>
Co-authored-by: Aditya Maru <[email protected]>
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 25, 2021
Resolves cockroachdb#67647, cockroachdb#72842

Previously, there was no way to view and clear index usage stats from
the frontend db console. This commit adds Index Stats tables for each
table on the Table Detail pages, allowing users to view index names,
total reads, and last used statistics. This commit also adds the
functionality of clearing all index stats as a button on the Index Stats
tables.

Release note (ui change): Add index stats table and button to clear
index usage stats on the Table Details page for each table.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 25, 2021
Resolves cockroachdb#67647, cockroachdb#72842

Previously, there was no way to view and clear index usage stats from
the frontend db console. This commit adds Index Stats tables for each
table on the Table Detail pages, allowing users to view index names,
total reads, and last used statistics. This commit also adds the
functionality of clearing all index stats as a button on the Index Stats
tables.

Release note (ui change): Add index stats table and button to clear
index usage stats on the Table Details page for each table.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 26, 2021
Resolves cockroachdb#67647, cockroachdb#72842

Previously, there was no way to view and clear index usage stats from
the frontend db console. This commit adds Index Stats tables for each
table on the Table Detail pages, allowing users to view index names,
total reads, and last used statistics. This commit also adds the
functionality of clearing all index stats as a button on the Index Stats
tables.

Release note (ui change): Add index stats table and button to clear
index usage stats on the Table Details page for each table.
lindseyjin added a commit to lindseyjin/cockroach that referenced this issue Nov 29, 2021
Resolves cockroachdb#67647, cockroachdb#72842

Previously, there was no way to view and clear index usage stats from
the frontend db console. This commit adds Index Stats tables for each
table on the Table Detail pages, allowing users to view index names,
total reads, and last used statistics. This commit also adds the
functionality of clearing all index stats as a button on the Index Stats
tables.

Release note (ui change): Add index stats table and button to clear
index usage stats on the Table Details page for each table.
craig bot pushed a commit that referenced this issue Nov 29, 2021
72948: ui: add index stats to table details page r=lindseyjin a=lindseyjin

Resolves #67647, #72842

Previously, there was no way to view and clear index usage stats from
the frontend db console. This commit adds Index Stats tables for each
table on the Table Detail pages, allowing users to view index names,
total reads, and last used statistics. This commit also adds the
functionality of clearing all index stats as a button on the Index Stats
tables.

![image](https://user-images.githubusercontent.com/29153209/142700094-cad60f81-8c83-48cc-b1f4-970e80d951ee.png)

Release note (ui change): Add index stats table and button to clear
index usage stats on the Table Details page for each table.

73145: roachtest: fix flags used in multitenant-upgrade for versions >= v21.2 r=AlexTalks a=AlexTalks

Previously, the `multitenant-upgrade` test had several workarounds and
branches for dealing with predecessor versions less than v21.2,
particularly the fact that these versions did not support the `--store`
flag passed on the `mt start-sql` CLI command.  This was introduced
in #71040, and subsequently incorporated into the roachtest (including
workarounds) in #71604.  Now that the current version is v22.1, and thus
the predecessor version supports the `--store` flag, it is necessary to
remove the workaround in order to ensure proper functionality of the
test.  Additionally, this change cleans up an even earlier workaround
for validating the cluster version for predecessor versions less than
v21.1.2.

Fixes #72971.

Release note: None

Co-authored-by: Lindsey Jin <[email protected]>
Co-authored-by: Alex Sarkesian <[email protected]>
@craig craig bot closed this as completed in dc52e26 Nov 29, 2021
@craig craig bot closed this as completed in #72948 Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-console-general SQL Observability issues on the DB console spanning multiple areas. Includes Cockroach Cloud Console C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@maryliag @lindseyjin @Annebirzin @kevin-v-ngo and others