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

Add pg_stat_statements extemsion for Postgres Query Optimization #282

Open
2 tasks
olivierobert opened this issue Mar 10, 2021 · 0 comments
Open
2 tasks
Assignees

Comments

@olivierobert
Copy link
Contributor

Why

While Postgres is used in all client projects we do, not much attention is put on performance beyond n+1 queries (via the gem bullet). Besides, if a project does not use New Relic or another similar third-party service, we usually have no insights into how the database queries are performing.

Postgres comes with its own extension to log and analyze all queries: https://www.postgresql.org/docs/current/pgstatstatements.html. This is a good overview article: http://blog.crunchydata.com/blog/tentative-smarter-query-optimization-in-postgres-starts-with-pg_stat_statements.

It does not have any performance hits on the actual database. It's an easy win for observability.

Who Benefits?

  • Developers who struggle with database performance issues.
  • Clients who can have faster apps.

Next Steps

  • Add pg_stat_statements by default in the Rails template

  • Document the usage on Compass code conventions for Rails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants