This interactive Streamlit-based tool is designed to analyze SQL Server queries both structurally and in terms of execution performance. It supports dynamic metadata fetching from the database or an Excel file, integrates execution plan visualization, and logs query durations for comparison.
- 💻 UI with light/dark theme switch
- 🧩 Metadata import (from DB or Excel)
- 🧠 Structural query analysis (SELECT *, WHERE checks, etc.)
- ⚡ Real-time performance evaluation using a custom SQL Server Stored Procedure
- 📊 Execution plan visualization (Graphviz)
- 📝 Recommendations based on size, indexing, and performance
- 🧾 Query history log with delta comparisons
- 📥 Exportable metadata and execution plans
Located in /stored_procedures/RunAndMeasure.sql, this SP securely executes the query, measures run time and row count, logs it to a local table, and returns clear JSON-compatible results.
- Streamlit (UI)
- PyODBC (Database Connection)
- Pandas (Data processing)
- Graphviz (Execution plan visualization)
- Python 3.8+
- Microsoft SQL Server
- ODBC Driver 18 for SQL Server
Bu interaktif Streamlit aracı, SQL Server sorgularını yapısal ve performans açısından analiz etmek için geliştirilmiştir. Metadata'yı doğrudan veritabanından veya Excel'den çekebilir, execution plan'ı görselleştirebilir ve geçmiş sorguları karşılaştırmak için log tutar.
- 💻 Açık/Koyu tema destekli kullanıcı arayüzü
- 🧩 Veritabanı ya da Excel'den metadata yükleme
- 🧠 Sorgular için yapısal analiz (SELECT * uyarıları, WHERE önerileri)
- ⚡ SP ile gerçek zamanlı performans ölçümü (SSMS ile entegre)
- 📊 Execution plan görselleştirme (Graphviz ile)
- 📝 Tablo büyüklüğü, indeks eksikliği ve performans sorunlarına dayalı öneriler
- 🧾 Sorgu geçmişi ve karşılaştırmalı analizler
- 📥 Metadata ve plan çıktıları indirilebilir
/stored_procedures/RunAndMeasure.sql içerisinde bulunan bu SP, girilen sorguyu çalıştırır, çalıştırma süresi ve etkilenen satır sayısını ölçer, bir log tablosuna yazar ve okunabilir çıktılar döner.
- Streamlit (Arayüz)
- PyODBC (Veritabanı Bağlantısı)
- Pandas (Veri işleme)
- Graphviz (Execution plan görselleştirme)
- Python 3.8+
- Microsoft SQL Server
- ODBC Driver 18 for SQL Server
Açık kaynak katkılarını memnuniyetle karşılıyorum. Fork'layabilir, issue açabilir veya pull request gönderebilirsiniz.
git clone https://github.com/mikailtipi/sql-optimization-tool.git
cd sql-optimization-tool
pip install -r requirements.txt
streamlit run app/app.pygit clone https://github.com/mikailtipi/sql-performance-analyzer.git
cd sql-performance-analyzer
pip install -r requirements.txt
streamlit run app.pyMikail Tipi
📧 mkltipi@gmail.com
🔗 LinkedIn - mikailtipi









