AI-Assisted PostgreSQL Optimization Using EXPLAIN Plans

Description

The nopayloaddb project works as an implementation of the Conditions Database reference for the HSF. It provides a RESTful API for managing metadata objects (global tags). Our current system is composed of Nginx, Django, and database (link to helm chart).

The project aims to implement an AI-assisted optimization framework for PostgreSQL queries without modifying existing tables or schemas. By leveraging EXPLAIN plans, temporary tables, and database-level optimization techniques, the system will identify and suggest improvements for slow or resource-intensive queries.

As a first step, a PostgreSQL cluster will be deployed on Kubernetes/OpenShift using a Helm chart, including persistent volumes and one read replica. The AI tool will analyze query plans and cluster metrics to suggest dynamic parameter adjustments to improve performance, enabling efficient query execution and better resource utilization without altering the underlying schema.

Steps

  1. Prepare a Helm chart for a PostgreSQL cluster on Kubernetes/OpenShift with PVs and one read replica
  2. Set up monitoring and metric collection for query performance and cluster health
  3. Collect EXPLAIN plans from slow and resource-intensive queries
  4. Develop an AI-assisted engine to analyze query plans, identify bottlenecks, and suggest optimizations
  5. Implement dynamic tuning of PostgreSQL cluster parameters based on AI insights
  6. Test AI-driven recommendations in a staging environment and validate performance improvements

Expected Results

Requirements

AI Policy

AI assistance is allowed for this contribution. The applicant takes full responsibility for all code and results, disclosing AI use for non-routine tasks (algorithm design, architecture, complex problem-solving). Routine tasks (grammar, formatting, style) do not require disclosure.

How to apply

Once CERN/HSF is accepted as a GSoC org, please write an email with a short introduction to your interests and background to the mentors with the string “gsoc26” in the subject. There will be a small evaluation task that we will mail to you then.

Mentors

Additional Information

Corresponding Project

Participating Organizations