Back to browse
GitHub Repository

OptimizeQL — AI-powered SQL query optimizer

30 starsTypeScript

SQL Query Optimizer

by hura17·Feb 20, 2026·1 point·0 comments

AI Analysis

MidSolve My ProblemShip It

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

Strengths
  • Real problem: raw LLM output on SQL is often useless without database context.
  • Smart context gathering: schema introspection, EXPLAIN ANALYZE parsing, index analysis before prompting.
  • Practical features: Docker deployment, multi-provider LLM support (OpenAI, Anthropic, DeepSeek), encrypted credential storage.
Weaknesses
  • No benchmarks or user testimonials showing output quality or accuracy of suggestions.
  • "No-connection mode" (paste SQL without DB context) defeats the whole purpose of the tool.
  • Expensive at scale: running EXPLAIN ANALYZE + LLM call per query could outpace subscription cost of DataGrip/pgAdmin Pro.
Target Audience

Database engineers, backend developers optimizing slow Postgres/MySQL queries, DBA teams.

Similar To

pgAdmin · DataGrip · SolarWinds DPA

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 infor 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

Developer Tools●●●Banger

Dbcli – Database CLI Built for AI Agents

One-shot database profiling beats five MCP tool calls; zero token overhead for agents.

Solve My ProblemShip ItCozy
justvugg
103mo ago
Infrastructure●●Solid

Fast Database for Agents

LSM + LLM summarization for agent logs; clever architecture, but zero adopters yet.

WizardryBig BrainNiche Gem
wanderinglight
103mo ago