Courseiva

DP-300 Practice Question: Monitor, configure, and optimize database resources

You are responsible for performance tuning of an Azure SQL Database that hosts a customer relationship management (CRM) application. The database has several tables with millions of rows. Users report that a report query that joins four tables is slow. You examine the query execution plan and notice that the database engine is using an Index Spool (Lazy Spool) operator. Which TWO actions should you take to improve query performance? (Choose two.)

⚠ Common exam trap

Many candidates assume an Index Spool is always a performance booster (like a regular index seek) or that increasing hardware resources (Option B) is the quick fix, when in fact the spool is a costly workaround for missing permanent indexes and stale statistics.

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

✓

Create appropriate indexes on the columns used in joins and filters.

Option C is correct because an Index Spool (Lazy Spool) operator typically appears when the optimizer lacks a suitable index and must build a temporary spool to satisfy repeated lookups or joins; creating appropriate indexes on the join and filter columns gives the optimizer a permanent access path, eliminating the need for the spool. Option E is correct because stale or missing statistics cause the optimizer to misestimate cardinality, which frequently leads to spool operators; updating statistics on all involved tables provides accurate row-count estimates so the optimizer can choose a more efficient plan. Option A is not appropriate because MAXDOP 1 disables parallelism and does not address the root cause of a spool operator, and it can actually hurt performance on large reporting queries. Option B is not the right fix because adding DTUs or vCores increases resources but does not change the plan shape or remove the spool, so the underlying inefficiency remains. Option D is not recommended because forcing join order with table hints is fragile, overrides the optimizer's cost-based decisions, and does not resolve the missing index or statistics problem that caused the spool.

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 parallelism for the query using the MAXDOP 1 hint.

    Why it's wrong here

    MAXDOP 1 forces serial execution, removing the parallel threads whose repeated probes build the lazy spool; it does not address the missing or non-covering index that causes the spool. It is tempting because reducing parallelism often helps skewed plans, and it would be correct when a parallel plan is itself the bottleneck.

  • ✗

    Increase the DTU or vCore count of the database.

    Why it's wrong here

    Raising DTU or vCore count adds compute throughput, but an Index Spool (Lazy Spool) operator signals a missing or inadequate index causing repeated re-scans, so extra resources cannot remove that plan shape. It is tempting because scaling is the standard remedy for genuinely resource-bound workloads, such as sustained CPU saturation on an otherwise well-indexed database.

  • ✓

    Create appropriate indexes on the columns used in joins and filters.

    Why this is correct

    Index Spool (Lazy Spool) indicates the optimiser repeatedly rewinds intermediate results because no suitable index supports the joins and predicates. Creating indexes on the join and filter columns gives the engine seek access, eliminating the spool and reducing the millions of rows scanned.

  • ✗

    Rewrite the query using table hints to force a specific join order.

    Why it's wrong here

    Forcing a join order with table hints constrains the optimiser without supplying the missing index that makes the lazy spool unnecessary. It is tempting because reordering joins can change a plan shape, and it would be correct when statistics are accurate but the optimiser still picks a poor order.

  • ✓

    Update statistics on all tables involved in the query.

    Why this is correct

    Stale statistics cause the optimiser to misestimate cardinality across the four-table join, prompting the Index Spool (Lazy Spool) operator. Updating statistics on all involved tables restores accurate row estimates, letting the optimiser choose a more efficient plan without spooling.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

One of 574 original DP-300 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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.