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: show data when max size reached for schema insight #97312

Merged
merged 1 commit into from
Feb 21, 2023

Conversation

maryliag
Copy link
Contributor

Previously, when the sql api returned a max size reached error, we were just showing the error, but not the data that was also being returned.

This commit updates the Insights Schema page
with the new behaviour.

The query to retrieve the drop recommendations was returning all indexes and the ui was doing the filtering. This commit also changes the query to only return the indexes with a drop recommendation, resulting in a lot less data being sent with the sql api and causing less size limit reached. Then the ui just needs to decided the type of drop.

Screenshot 2023-02-17 at 6 24 36 PM

Part Of: #96184
Release note (ui change): Still show data on the console (with a warning) for Schema Insights when we reach a "max size exceed" error from the sql api.

@maryliag maryliag requested review from a team February 17, 2023 23:33
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@maryliag maryliag force-pushed the max-size-schema branch 2 times, most recently from 71efe32 to 68a3517 Compare February 19, 2023 01:18
Copy link
Contributor

@j82w j82w left a comment

Choose a reason for hiding this comment

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

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


pkg/ui/workspaces/cluster-ui/src/api/schemaInsightsApi.ts line 159 at r1 (raw file):

                            CROSS JOIN cs
                   WHERE t.database_name != 'system' AND ti.index_type != 'primary')
          WHERE unused_interval > interval_threshold;`,

Can we add a order by based on the number of reads from the index_usage_statistics? That way the most impactful indexes should always be included even if the max size is hit.

Previously, when the sql api returned a max size reached
error, we were just showing the error, but not the data
that was also being returned.

This commit updates the Insights Schema page
with the new behaviour.

The query to retrieve the drop recommendations was returning
all indexes and the ui was doing the filtering. This commit
also changes the query to only return the indexes with a
drop recommendation, resulting in a lot less data being sent
with the sql api and causing less size limit reached.
Then the ui just needs to decided the type of drop.

Part Of: cockroachdb#96184
Release note (ui change): Still show data on the console
(with a warning) for Schema Insights when we reach a
"max size exceed" error from the sql api.
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.

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


pkg/ui/workspaces/cluster-ui/src/api/schemaInsightsApi.ts line 159 at r1 (raw file):

Previously, j82w (Jake) wrote…

Can we add a order by based on the number of reads from the index_usage_statistics? That way the most impactful indexes should always be included even if the max size is hit.

done

Copy link
Contributor

@j82w j82w left a comment

Choose a reason for hiding this comment

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

:lgtm:

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

@maryliag
Copy link
Contributor Author

TFTR!
bors r+

@craig
Copy link
Contributor

craig bot commented Feb 21, 2023

Build succeeded:

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.

3 participants