DP-300 study notes · 20–25% of the exam
Monitor, configure, and optimize database resources
First draft for review. Check details against Microsoft Learn before relying on them.
What this area covers
Monitoring activity and performance, tuning queries, and configuring databases for optimal performance.
Monitoring
- Build a baseline of normal CPU, I/O, memory and waits.
- Sources: platform metrics, diagnostic settings, DMVs (sys.dm_db_resource_stats, sys.dm_exec_requests, sys.dm_io_virtual_file_stats), database watcher and Extended Events.
- Common waits: SOS_SCHEDULER_YIELD (CPU), PAGEIOLATCH (data reads), WRITELOG and LOG_RATE_GOVERNOR (log), LCK_M_* (locking).
Query performance
- Query Store keeps query text, plans and runtime stats. Force a good plan, or add Query Store hints.
- Blocking: find the head blocker with blocking_session_id. Keep transactions short and use row versioning.
- Indexes: missing index DMVs suggest indexes, usage stats show unused ones. Covering indexes remove key lookups.
- Make predicates sargable (no functions on indexed columns).
- Read execution plans for scans, lookups, spills and bad estimates.
- Intelligent Insights and Query Performance Insight show problem queries in Azure SQL Database.
Configuration
- Index maintenance: rebuild (online and resumable) or reorganize. Statistics: UPDATE STATISTICS or sp_updatestats.
- DBCC CHECKDB checks integrity.
- Automatic tuning: FORCE_LAST_GOOD_PLAN is on by default. CREATE_INDEX and DROP_INDEX are optional.
- Server settings on VMs: max server memory, MAXDOP, cost threshold for parallelism, tempdb files.
- Resource Governor (SQL Server and Managed Instance) limits resources for workload groups.
- Database-scoped configuration sets MAXDOP and parameter sniffing options per database.
- Intelligent query processing (memory grant feedback, adaptive joins, PSP optimisation) needs a recent compatibility level.