Courseiva

DP-300 Plan and implement data platform resources Practice Question

You have an Azure SQL Database with Query Store enabled. You notice that a critical stored procedure has regressed in performance. You need to force a previous, better-performing execution plan for that query. What should you do?

⚠ Common exam trap

Candidates often confuse the DMV for recommendations (`sys.dm_db_tuning_recommendations`) with the actual stored procedure to enforce a plan, or they think resetting Query Store is a valid troubleshooting step when it actually destroys historical data.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Execute sys.sp_query_store_force_plan with the query_id and plan_id.

`sys.sp_query_store_force_plan` is the dedicated system stored procedure in Azure SQL Database that forces the Query Store to use a specific execution plan for a given query. When a stored procedure's performance regresses, you identify the query_id and plan_id of the better-performing plan from Query Store views and execute this procedure to pin that plan, overriding the optimizer's choice.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Disable and re-enable Query Store to reset the plans.

    Why it's wrong here

    Disabling and re-enabling Query Store clears captured runtime statistics and plan history, destroying the previous good plan you need to force. It is tempting as a reset when Query Store data looks stale, but forcing a plan is done through sys.sp_query_store_force_plan against the retained plan_id.

  • ✗

    Execute sys.sp_query_store_set_hints to add a query hint.

    Why it's wrong here

    Query Store hints shape future compilations; they do not force an existing captured plan. Forcing a specific historical plan requires sys.sp_query_store_force_plan, which pins the plan_id stored in Query Store. Hints suit steering a query whose plan is unstable, not reverting to a known-good plan already recorded.

  • ✗

    Use sys.dm_db_tuning_recommendations to apply a plan.

    Why it's wrong here

    sys.dm_db_tuning_recommendations only surfaces automatic tuning suggestions; it cannot apply a plan. Forcing a previously captured plan needs sys.sp_query_store_force_plan against the plan_id in Query Store. This DMV suits reviewing what automatic tuning proposes, not manually reverting a regression to a known-good plan.

  • ✓

    Execute sys.sp_query_store_force_plan with the query_id and plan_id.

    Why this is correct

    Query Store persists multiple plans per query, and sys.sp_query_store_force_plan pins the specified plan_id to the query_id, forcing the optimiser to reuse the previously better-performing plan without altering the stored procedure or clearing the plan cache.

Go deeper

Related to this question

About these practice questions

Courseiva writes every DP-300 question from scratch — 574 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DP-300 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DP-300 exam.