PostgreSQL assistant for database performance understanding and optimization
Top 29.3% on sourcepulse
PgAssistant is an open-source tool for PostgreSQL developers to analyze and optimize database performance, identify schema issues, and manage SQL queries. It integrates deterministic analysis with LLM capabilities for deeper insights, RFC compliance checks, and query optimization, aiming to empower developers and reduce reliance on DBAs.
How It Works
PgAssistant combines static SQL linting (via Sqlfluff) and performance analysis tools like PGTune with LLM integrations (OpenAI, Ollama, or custom LLMs). It analyzes database behavior, identifies schema problems, and suggests optimizations. The LLM component can check table definitions against RFCs, help find primary keys, analyze query plans, and suggest index coverage improvements, offering a hybrid approach to database tuning.
Quick Start & Requirements
docker-compose up
(access at http://localhost:8080/database.html
)virtualenv
, pip3 install -r requirements.txt
, and flask run
.pg_stat_statements
module must be enabled.Highlighted Details
pg_dump
for retrieving DDL of top queries.pg_stats
.Maintenance & Community
The project appears to be primarily maintained by Nexsol Technologies. Community links or active development forums are not explicitly mentioned in the README.
Licensing & Compatibility
The README does not explicitly state a license. It mentions using Volt Bootstrap 5, which is MIT licensed. Compatibility for commercial use or closed-source linking is not specified.
Limitations & Caveats
The tool is intended for non-production environments due to the inherent inaccuracies of LLMs. Users must ensure the pg_stat_statements
module is enabled. LLM accuracy is not guaranteed, and careful testing is advised.
3 days ago
1 day