GitHub

What is the project about?

PgAssistant is an open-source tool designed to assist developers in understanding and optimizing the performance of their PostgreSQL databases.

What problem does it solve?

It helps developers identify performance bottlenecks, schema-related issues, and inefficiencies in their PostgreSQL databases, and provides assistance in resolving them.

What are the features of the project?

  • Database Behavior Analysis: Provides insights into database performance.
  • Schema Optimization: Identifies and helps correct schema issues.
  • Query Library Management: Manages SQL queries via a JSON file.
  • User-Friendly Interface: Offers a simple and intuitive interface.
  • SQL Linter: Uses Sqlfluff to lint SQL code.
  • AI Helper: Integrates with OpenAI, local LLMs (like ollama), or other LLMs to understand query plans and optimize queries.
  • Get DDL: Retrieves Data Definition Language (DDL) for top queries using pg_dump.
  • PGTune Integration: Incorporates PGTune to suggest database parameter adjustments.
  • Docker Support: Assists in writing Docker Compose files based on PGTune recommendations.
  • Requires pg_stat_statements module.

What are the technologies used in the project?

  • Python
  • Flask (web framework)
  • Sqlfluff (SQL linter)
  • OpenAI API (optional)
  • Ollama (optional, for local LLM)
  • PostgreSQL (database)
  • pg_dump (PostgreSQL utility)
  • PGTune
  • Docker
  • Volt BootStrap 5 (front-end)
  • JSON

What are the benefits of the project?

  • Improved database performance.
  • Easier identification and resolution of database issues.
  • Simplified SQL query management.
  • Enhanced developer productivity.
  • Integration with AI for query optimization.
  • Streamlined database configuration.

What are the use cases of the project?

  • Database performance monitoring and optimization.
  • Database schema analysis and improvement.
  • SQL query development and debugging.
  • Database administration and tuning.
  • Learning and understanding PostgreSQL internals.
pgassistant screenshot