Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Elixir
  3. ecto_psql_extras

ecto_psql_extras

MITElixir

Elixir library providing PostgreSQL database performance insights like locks, index usage, cache hit ratios, and vacuum stats.

GitHubGitHub
395 stars36 forks0 contributors

What is ecto_psql_extras?

Ecto PSQL Extras is an Elixir library that provides a comprehensive set of queries to analyze and optimize PostgreSQL database performance. It helps developers identify issues like missing indexes, lock contention, inefficient cache usage, and bloat, offering insights similar to Heroku PG Extras but for any PostgreSQL-backed Elixir application.

Target Audience

Elixir developers and DevOps engineers working with PostgreSQL databases who need to monitor, diagnose, and optimize database performance in Phoenix or Ecto-based applications.

Value Proposition

It offers a native Elixir API for deep PostgreSQL introspection without relying on Heroku's tooling, integrates seamlessly with Phoenix.LiveDashboard, and includes a diagnostic report to quickly surface performance bottlenecks.

Overview

Ecto PostgreSQL database performance insights. Locks, index usage, buffer cache hit ratios, vacuum stats and more.

Use Cases

Best For

  • Identifying missing foreign key indexes and constraints in PostgreSQL schemas
  • Analyzing buffer cache hit ratios to determine if a database instance is properly sized
  • Detecting and removing unused or duplicate indexes to improve write performance
  • Monitoring long-running queries and lock contention in production databases
  • Generating a comprehensive diagnose report for PostgreSQL performance health checks
  • Integrating PostgreSQL metrics into a Phoenix.LiveDashboard for real-time monitoring

Not Ideal For

  • Teams using databases other than PostgreSQL (e.g., MySQL, MongoDB)
  • Environments requiring graphical user interfaces without code integration, such as DBAs preferring tools like pgAdmin
  • Projects with minimal database interactions where performance tuning is low-priority
  • Applications with strict security policies that restrict ad-hoc SQL query execution due to data exposure risks

Pros & Cons

Pros

Comprehensive Query Suite

Includes over 20 specialized queries ported from Heroku PG Extras, covering cache hit ratios, index usage, locks, and vacuum statistics, as detailed in the README with examples like cache_hit and outliers.

Seamless Elixir Integration

Offers a clean, idiomatic API that works directly with Ecto repositories, shown in usage examples like EctoPSQLExtras.cache_hit(YourApp.Repo), making it easy to embed in Phoenix apps or monitoring tasks.

Diagnostic Report Feature

The diagnose method runs a set of checks and prints a report highlighting areas needing investigation, providing a quick start for performance analysis without manual query execution.

Phoenix LiveDashboard Compatibility

Is an optional dependency for Phoenix.LiveDashboard, allowing SQL metrics to be displayed in a web UI, as mentioned in the README with an example image.

Cons

Dependency on pg_stat_statements

Key queries like calls and outliers require the pg_stat_statements extension to be enabled, adding setup overhead and potential configuration issues, as admitted in the README installation notes.

Limited Output Formats by Default

Default ASCII table output may not suit automated systems; raw data requires explicit format options (e.g., format: :raw), complicating integration into scripts or dashboards without extra code.

Potentially Dangerous Operations

Includes commands like kill_all that can terminate all database connections, posing risks in production if misused without proper safeguards or oversight.

No Built-in Automation

Lacks features for scheduled queries, alerting, or historical tracking, requiring additional tooling for proactive performance monitoring and trend analysis.

Open Source Alternative To

ecto_psql_extras is an open-source alternative to the following products:

H
Heroku pg_extras

A Heroku Postgres extension that provides additional diagnostic and maintenance commands for database management.

Frequently Asked Questions

Quick Stats

Stars395
Forks36
Contributors0
Open Issues0
Last commit28 days ago
CreatedSince 2020

Tags

#elixir#ecto#database-performance#monitoring#query-optimization#postgresql#index-analysis

Built With

E
Ecto
P
PostgreSQL
E
Elixir

Included in

Elixir13.1k
Auto-fetched 4 hours ago

Related Projects

ectoecto

A toolkit for data mapping and language integrated query.

Stars6,494
Forks1,482
Last commit1 day ago
postgrexpostgrex

PostgreSQL driver for Elixir

Stars1,216
Forks311
Last commit1 day ago
eventstoreeventstore

Event store using PostgreSQL for persistence

Stars1,162
Forks155
Last commit4 months ago
redixredix

Fast, pipelined, resilient Redis driver for Elixir. 🛍

Stars1,140
Forks125
Last commit15 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub