Skip to content

Conversation

@andersju
Copy link
Member

We had some complaints about the /_findhold endpoint on STG being extremely slow after reimporting data from prod. Turns out Postgresql hadn't updated table statistics (yet), so the query plan was whack, and some query took >10000 ms to execute instead of 1-2 ms. Autovacuum or periodic ANALYZE should take care of this, but apparently not always quickly enough, so let's run ANALYZE manually on all tables directly after restoring data. It only takes a few seconds.

Copy link
Contributor

@olovy olovy left a comment

Choose a reason for hiding this comment

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

Nice! LGTM

@andersju andersju merged commit b988ebe into develop Jan 30, 2026
1 check passed
@andersju andersju deleted the feature/analyze-after-pg-restore branch January 30, 2026 16:22
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