SQL Querywise
Start free
Advisor — Performance Intelligence

Find performance issues
before your users do.

Advisor analyses your SQL against 53 enterprise T-SQL rules, ranks issues by severity, and provides ready-to-run fixes — index recommendations included.

Try Advisor free
3 free uses after sign-up No credit card required $6/month after free tier

What Advisor produces

Input: an N+1 query pattern. Output: severity-ranked findings with Rule IDs, before/after code, and index recommendations.

advisor_output.mdAdvisor
## Performance Assessment: 4/10

## Issues Found

### 🔴 Critical — SUBQUERY_WHERE (Severity 5)
**Finding:** Correlated subqueries in SELECT clause execute once per row.
**Impact:** With 50,000 users, this runs 100,000 subqueries instead of 2 JOINs.
**Fix:**
```sql
-- Before (N+1 pattern)
SELECT u.id, u.email,
  (SELECT COUNT(*) FROM orders o WHERE o.user_id = u.id) AS order_count,
  (SELECT MAX(created_at) FROM orders o WHERE o.user_id = u.id) AS last_order
FROM users u

-- After (single JOIN)
SELECT u.id, u.email,
  COUNT(o.id) AS order_count,
  MAX(o.created_at) AS last_order
FROM users u
LEFT JOIN orders o ON o.user_id = u.id
GROUP BY u.id, u.email
```
**Estimated gain:** 95–99% reduction in logical reads.

### 🟠 High — ORDER_BY_NO_TOP (Severity 1)
**Finding:** ORDER BY without TOP/OFFSET forces a full sort of the result set.
**Recommendation:** Add TOP N or OFFSET/FETCH if only a subset is needed.

## Index Recommendations
```sql
CREATE INDEX IX_orders_user_id_created
ON orders (user_id)
INCLUDE (created_at, id);
```

## Validation Checklist
- [x] Logical reads reduced?
- [x] Functional equivalence confirmed?
- [ ] Test with production data volume

Performance analysis that goes deep

Not just "add an index" — Advisor understands query patterns, cardinality, and SQL Server internals.

53-rule analysis engine

Checks every query against 53 enterprise T-SQL rules across performance, security, best practices, and maintainability categories.

Severity-ranked findings

Issues are ranked from Severity 1 (low) to Severity 5 (critical). Focus on what matters most — not a wall of equal-weight warnings.

Index recommendations

Generates ready-to-run CREATE INDEX statements with INCLUDE columns based on your specific query's access patterns.

Before/after rewrites

Every finding includes a concrete code fix — not just a description of the problem. Copy the rewritten query and test it immediately.

Estimated performance gains

Advisor estimates the impact of each fix — from 'minor improvement' to '99% reduction in logical reads' — so you prioritise correctly.

Anti-pattern detection

Catches N+1 patterns, correlated subqueries, SELECT INTO #temp, cursors, implicit type conversions, and 40+ other common SQL anti-patterns.

When to use Advisor

1

Before deploying a new query to production

Run Advisor on every new query before it hits production. Catch performance issues when they're cheap to fix, not after they cause incidents.

2

Investigating a slow report

Paste the slow query into Advisor. Get a ranked list of issues with specific fixes — no need to read execution plans manually.

3

Code review for Data Engineers

Use Advisor output as the basis for SQL code reviews. Every finding has a Rule ID, severity, and fix — structured feedback in seconds.

4

Refactoring legacy stored procedures

Run Advisor on stored procedures written 5+ years ago. Identify which ones have critical performance issues worth refactoring.

Advisor FAQ

Does Advisor work with execution plan XML?

Execution plan analysis (QueryPlan rules) is on the roadmap. Currently Advisor analyses the query text directly against 53 T-SQL rules.

How accurate are the performance estimates?

Estimates are indicative, not exact. They're based on known patterns (e.g., correlated subqueries always cause N+1 reads). Always validate fixes in a test environment with representative data.

Does Advisor suggest indexes for all queries?

Index recommendations are generated when Advisor detects missing index opportunities based on the query's filter and join columns. Not every query needs a new index.

Try Advisor — 3 free uses after sign-up

Sign in to run Advisor on your own SQL queries. 3 free uses — no credit card required.

Start free

Advisor

$6/month

3 free uses after registration. No credit card required.

Start free
53-rule analysis engine
Severity-ranked findings (1–5)
Before/after code rewrites
Index recommendations
Performance gain estimates