A database is experiencing performance degradation. Need to identify top resource-consuming queries, track plan changes, and find performance regressions.
→Enable and utilize Query Store.
Why: Query Store is the built-in "flight data recorder" for query performance. It automatically captures query history, plans, and wait stats, making it the primary tool for diagnosing performance issues over time.
Reference↗
A query performs well sometimes but poorly at other times due to parameter sniffing issues, where an execution plan is optimized for a non-representative parameter value.
→Use Query Store to identify the different plans and force the consistently good execution plan.
Why: Plan forcing in Query Store provides a quick and effective way to stabilize performance for problematic queries without code changes. It overrides the optimizer's choice with a known-good plan.
To improve query performance without code changes by leveraging features like batch mode on rowstore, memory grant feedback, and table variable deferred compilation.
→Set the database compatibility level to 150 (for SQL 2019 features) or higher.
Why: The Intelligent Query Processing (IQP) feature set is enabled by the database compatibility level. Level 150+ activates a broad range of "no-code-change" performance enhancements in the query processor.
The operations team needs to be notified when key performance metrics, such as CPU percentage or deadlocks, exceed a defined threshold.
→Use Azure Monitor to create metric alerts (for CPU) and log alerts (for deadlocks) that trigger an Action Group.
Why: Azure Monitor is the centralized platform for monitoring and alerting on Azure resources. Action Groups provide flexible notification channels (email, SMS, webhook, etc.).
Improve write performance by identifying and removing indexes that are not being used by any read queries.
→Query the `sys.dm_db_index_usage_stats` DMV.
Why: This DMV tracks index usage (seeks, scans, lookups) versus updates. Indexes with high updates but zero or very low usage are prime candidates for removal, reducing maintenance overhead.
Need to capture detailed information about intermittent blocking issues, including the statements and sessions involved in the blocking chain.
→Configure an Extended Events session that captures the `blocked_process_report` event.
Why: This event provides a detailed XML report of blocking chains when the `blocked process threshold` is exceeded, offering deep diagnostic information not available in DMVs.
A database needs its index strategy to adapt automatically to changing workload patterns without manual intervention.
→Enable the CREATE_INDEX option in Azure SQL Database Automatic tuning.
Why: This feature allows Azure to analyze the workload, identify missing indexes with high impact, create them, and validate their performance benefit, automating a key DBA task.
Offload read-heavy reporting workloads from the primary OLTP database in a Business Critical or Premium tier.
→Modify the application's read-only connection strings to include `ApplicationIntent=ReadOnly`.
Why: These tiers include a free, built-in readable secondary replica. The `ApplicationIntent` property in the connection string automatically routes read-only connections to this replica, isolating read workloads.
A large fact table in a data warehouse is frequently used for aggregation queries (SUM, COUNT, AVG) that are performing slowly.
→Create a clustered columnstore index on the fact table.
Why: Columnstore indexes store data in a columnar format, providing very high data compression and enabling batch mode execution, which dramatically accelerates aggregation and scan-heavy analytical queries.
A database experiences significant blocking contention between read queries (reports) and write queries (transactions).
→Enable Read Committed Snapshot Isolation (RCSI) on the database.
Why: RCSI uses row versioning, allowing readers to see the last committed version of data without taking shared locks, thereby eliminating blocks from writers. Writers do not block readers.
An application using a Serverless database experiences initial slow connection times after a period of inactivity.
→Decrease the auto-pause delay or configure a minimum vCore value greater than zero.
Why: The delay is caused by the database resuming from a paused state (cold start). Setting a min vCore value prevents the database from pausing completely, eliminating resume latency at the cost of some continuous compute billing.