Skip to content

Optimize latest guardian health view - #118

Open
fparisotto wants to merge 5 commits into
fedimint:masterfrom
fparisotto:chore/optimize-latest-guardian-health
Open

Optimize latest guardian health view#118
fparisotto wants to merge 5 commits into
fedimint:masterfrom
fparisotto:chore/optimize-latest-guardian-health

Conversation

@fparisotto

Copy link
Copy Markdown
Contributor

Summary

  • redefine latest_guardian_health with a lateral latest-time lookup per federation
  • avoid aggregating the full guardian_health history on every view read
  • add the view change as migration v9

Notes

The new query shape lets PostgreSQL use the existing (federation_id, time) index with a backward index scan for each federation.

Validation

  • git diff --check
  • verified the same query shape with EXPLAIN against a large production-like database in downstream deployment
  • local cargo check was skipped; CI should validate the branch

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.

1 participant