Back to browse
GitHub Repository

OptimizeQL — AI-powered SQL query optimizer

30 starsTypeScript

OptimizeQL- SQL Query Optimizer

by hura17·Mar 5, 2026·1 point·0 comments

AI Analysis

●●SolidSolve My ProblemShip It

Gathers schema + EXPLAIN + stats for LLM context; HypoPG simulates indexes risk-free.

Strengths
  • Multi-LLM support (Anthropic, OpenAI, Gemini, etc.) avoids vendor lock-in
  • HypoPG integration tests index hypotheticals without committing; reduces risky tuning decisions
  • Encrypted credential storage and no-connection mode balance security with usability
Weaknesses
  • LLM-powered query optimization is inherently unreliable—no guarantees suggestions improve performance
  • PostgreSQL + MySQL only; missing Oracle, SQL Server, or MSSQL limits enterprise appeal
Target Audience

Database administrators, backend engineers, SQL performance tuners

Similar To

pgAdmin query performance advisor · AWS RDS Performance Insights · Datadog Database Monitoring

Post Description

Hello all,

I wrote a tool to optimize SQL queries using LLM models. I sometimes struggle to find the root cause for the slow running queries and sending to LLM most of the time doesn't have good result. I think the reason is LLM doesnt have the context of our database, schemas, explain results .etc.

That is why I decided to write a tool that gathers all inform about our data and suggest meaningful improvements including adding indexes, materialized views, or simply rewriting the query itself. The tool supports only PostgreSQL and MySQL for now , but you can easily fork and add your own desired database.

You just need to add your LLM api key and database credentials. It is an open source tool so I highly appreciate the review and contribution if you would like.

Feel free to check it out : https://github.com/SubhanHakverdiyev/OptimizeQL

Similar Projects

SQL Query Optimizer

LLM-augmented SQL optimizer with schema context, but lacks benchmarks proving it beats manual EXPLAIN review.

Solve My ProblemShip It
hura17
103mo ago