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

Fix the DB table rows metric #3276

Closed
wants to merge 3 commits into from
Closed

Conversation

squadgazzz
Copy link
Contributor

@squadgazzz squadgazzz commented Feb 11, 2025

Resurrects #3266 with the following changes:

  • Exludes aws-related tables from the query that leads to the insufficient rights error. Filters out tables with rsadmin and cow_protocol_admin owners. This should be a more robust approach since these roles can still add more tables, but adding more roles is controlled.
  • Moves auction_participants and proposed_trade_executions to the LARGE_TABLES constant since their size is 4M+ and 8M+ already. That should slightly reduce the DB load since the count queries for these tables might take more than 5s.
  • Slightly optimizes the estimate_rows_in_table query.

@squadgazzz squadgazzz requested a review from a team as a code owner February 11, 2025 11:35
struct TableName(String);

const QUERY: &str = "SELECT tablename FROM pg_tables WHERE schemaname = 'public' AND \
tablename NOT LIKE '%flyway%' AND tableowner NOT IN ('rdsadmin', \
Copy link
Contributor

Choose a reason for hiding this comment

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

This is revealing unnecessary data 🤔 I wonder how critical this is
cc @ahhda

@squadgazzz
Copy link
Contributor Author

After thinking more about this, we should probably revert to the hardcoded tables list as was initially suggested in the original PR. And update the DB changes reminder accordingly.

@squadgazzz squadgazzz closed this Feb 11, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Feb 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants