Azure SQL Database optimization and platform-specific features. Use this skill when: (1) User asks about Azure SQL Database optimization, (2) User needs DTU/vCore guidance, (3) User wants to use automatic tuning, (4) User asks about Hyperscale or serverless, (5) User needs Azure SQL performance monitoring.
View on GitHubJosiahSiegel/claude-plugin-marketplace
tsql-master
plugins/tsql-master/skills/azure-sql-optimization/SKILL.md
January 20, 2026
Select agents to install to:
npx add-skill https://github.com/JosiahSiegel/claude-plugin-marketplace/blob/main/plugins/tsql-master/skills/azure-sql-optimization/SKILL.md -a claude-code --skill azure-sql-optimizationInstallation paths:
.claude/skills/azure-sql-optimization/# Azure SQL Database Optimization
Platform-specific optimization for Azure SQL Database.
## Quick Reference
### Service Tier Comparison
| Tier | Best For | Max Size | Key Features |
|------|----------|----------|--------------|
| Basic | Dev/test, light workloads | 2 GB | Low cost |
| Standard | General workloads | 1 TB | S0-S12 DTUs |
| Premium | High I/O, low latency | 4 TB | P1-P15 DTUs |
| General Purpose (vCore) | Most workloads | 16 TB | Serverless option |
| Business Critical | High availability | 4 TB | In-memory, read replicas |
| Hyperscale | Large databases | 100 TB | Auto-scaling storage |
### DTU vs vCore
| Aspect | DTU | vCore |
|--------|-----|-------|
| Pricing | Bundled resources | Separate compute/storage |
| Control | Limited | Fine-grained |
| Reserved capacity | No | Yes (up to 72% savings) |
| Serverless | No | Yes (General Purpose) |
| Best for | Simple workloads | Predictable, migrated workloads |
## Performance Monitoring
### Resource Consumption
```sql
-- Last 15 minutes (avg 15-second intervals)
SELECT
end_time,
avg_cpu_percent,
avg_data_io_percent,
avg_log_write_percent,
avg_memory_usage_percent,
max_worker_percent,
max_session_percent
FROM sys.dm_db_resource_stats
ORDER BY end_time DESC;
-- Historical (last 14 days, hourly)
SELECT
start_time,
end_time,
avg_cpu_percent,
avg_data_io_percent,
avg_log_write_percent
FROM sys.resource_stats
WHERE database_name = DB_NAME()
ORDER BY start_time DESC;
```
### Query Performance Insight
```sql
-- Top CPU consumers last hour
SELECT TOP 20
qt.query_sql_text,
rs.avg_cpu_time / 1000 AS avg_cpu_ms,
rs.count_executions,
rs.avg_cpu_time * rs.count_executions / 1000 AS total_cpu_ms
FROM sys.query_store_query q
JOIN sys.query_store_query_text qt ON q.query_text_id = qt.query_text_id
JOIN sys.query_store_plan p ON q.query_id = p.query_id
JOIN sys.query_store_runtime_stats rs ON p.plan_id = rs.plan_id
JOIN sys.query_store_runtime_stats_i