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

ui: add apply recommendations to table details #90070

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

maryliag
Copy link
Contributor

On Table details page, we have a table with index
recommendations, which right now is focused on drop unused indexes. This commit adds the button the apply the recommendations, when there is one.

Fixes #86949
Screen Shot 2022-10-17 at 12 49 05 PM

Screen Shot 2022-10-17 at 12 49 11 PM

Release note (ui change): Add apply button on Table Details page (db console only), when there is a recommendation to drop an unused index.

@maryliag maryliag requested a review from a team October 17, 2022 16:53
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link

@THardy98 THardy98 left a comment

Choose a reason for hiding this comment

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

:lgtm:

Just a quick question: What were your thoughts on using the index as the key considering the potential issues (https://robinpokorny.com/blog/index-as-a-key-is-an-anti-pattern/) When the order of the index recommendations are changed does it render as expected?

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

Copy link
Contributor Author

@maryliag maryliag left a comment

Choose a reason for hiding this comment

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

The order works as expected: https://www.loom.com/share/e90d5cd36557496491c119f7828a4367
This case you're mentioning is when we make changes on the UI, by adding/removing elements, but that won't happen on this case. The values are based on the endpoint, and if there is a new recommendation, it will render the page again, not just that small part. We do use the idx as the key on several locations on our codebase.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @maryliag)

Copy link

@THardy98 THardy98 left a comment

Choose a reason for hiding this comment

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

Ah, thank you!

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @maryliag)

On Table details page, we have a table with index
recommendations, which right now is focused on drop
unused indexes. This commit adds the button the apply
the recommendations, when there is one.

Fixes cockroachdb#86949

Release note (ui change): Add apply button on Table Details
page (db console only), when there is a recommendation to
drop an unused index.
@maryliag
Copy link
Contributor Author

TFTR!
bors r+

@craig
Copy link
Contributor

craig bot commented Oct 17, 2022

Build succeeded:

@maryliag
Copy link
Contributor Author

maryliag commented Dec 2, 2022

blathers backport 22.2

@blathers-crl
Copy link

blathers-crl bot commented Dec 2, 2022

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from eb64879 to blathers/backport-release-22.2-90070: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 22.2 failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

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.

add button to drop index on index stats when there is a drop recommendation
3 participants