Initial commit: local SQL expert AI (Ollama + CLI + prompts + systemd timer)
This commit is contained in:
29
prompts/tsql_review.md
Normal file
29
prompts/tsql_review.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# T-SQL Review Template (Copy & Paste)
|
||||
|
||||
> Zweck: schnelle, präzise Analyse einer Abfrage.
|
||||
> Eingabe: T-SQL + (optional) Parameterwerte + (optional) Tabelleninfos.
|
||||
|
||||
## Kontext (optional)
|
||||
- SQL Server Version: 2022
|
||||
- DB Kompatibilitätslevel: ?
|
||||
- Tabellenvolumen grob (Rows): ?
|
||||
- Häufigkeit/Latency Ziel: ?
|
||||
- Parameterwerte (typisch & worst-case): ?
|
||||
|
||||
## Aufgabe
|
||||
Analysiere das T-SQL und liefere:
|
||||
1) **Kurzfazit** (3–6 Bulletpoints)
|
||||
2) **Detailanalyse**:
|
||||
- SARGability (LIKE, Funktionen auf Spalten, CAST/CONVERT, Datentyp-Mismatches)
|
||||
- Joins/Predicates (Reihenfolge, Join Typen)
|
||||
- Kardinalität/Stats (wo schätzt der Optimizer falsch)
|
||||
- Parameter Sniffing Risiko + konkrete Mitigation (z.B. OPTION(RECOMPILE) gezielt, OPTIMIZE FOR, plan guides nur wenn nötig)
|
||||
3) **Konkrete Verbesserungen**:
|
||||
- rewrite (mit kommentiertem SQL)
|
||||
- Index-Vorschläge (nur wenn plausibel; include columns; Filtered Index falls geeignet)
|
||||
4) **Checks**:
|
||||
- welche Messwerte/Plan-Indikatoren prüfen
|
||||
|
||||
---BEGIN T-SQL---
|
||||
<PASTE HERE>
|
||||
---END T-SQL---
|
||||
Reference in New Issue
Block a user