nerdexam
Microsoft

70-465 · Question #75

You need to recommend a solution to minimize the amount of time it takes to execute USP_1. With what should you recommend replacing Table1?

The correct answer is D. A temporary table. To minimize execution time of USP_1, replacing Table1 with a temporary table is recommended because temporary tables support statistics, indexes, and parallel execution plans, which optimize query performance for procedural operations.

Submitted by omar99· Mar 5, 2026Design and implement database solutions for SQL Server

Question

You need to recommend a solution to minimize the amount of time it takes to execute USP_1. With what should you recommend replacing Table1?

Exhibits

70-465 question #75 exhibit 1
70-465 question #75 exhibit 2

Options

  • AAn indexed view
  • BA function
  • CA table variable
  • DA temporary table

How the community answered

(58 responses)
  • A
    16% (9)
  • B
    7% (4)
  • C
    3% (2)
  • D
    74% (43)

Why each option

To minimize execution time of USP_1, replacing Table1 with a temporary table is recommended because temporary tables support statistics, indexes, and parallel execution plans, which optimize query performance for procedural operations.

AAn indexed view

An indexed view materializes query results but adds overhead for data modifications and is subject to strict requirements (e.g., schema binding), making it unsuitable as a direct replacement for a table used in procedural logic within a stored procedure.

BA function

A function (table-valued or scalar) introduces additional overhead and limitations such as restricted parallel execution and inability to maintain statistics, which would not minimize execution time.

CA table variable

Table variables do not maintain statistics and always estimate a single row cardinality, leading the optimizer to choose poor execution plans for larger datasets, which can significantly increase execution time rather than minimize it.

DA temporary tableCorrect

Temporary tables (created with # prefix in tempdb) support statistics generation, indexing, and parallel query execution plans, making them well-suited for optimizing stored procedure performance. Unlike table variables, temporary tables allow the query optimizer to generate accurate execution plans based on actual row counts and distribution statistics. This leads to significantly better performance when dealing with larger datasets or complex queries within stored procedures.

Concept tested: Temporary tables vs table variables for stored procedure performance optimization

Source: https://learn.microsoft.com/en-us/sql/relational-databases/tables/temporary-tables?view=sql-server-ver16

Topics

#T-SQL performance#Temporary tables#Stored procedure optimization

Community Discussion

No community discussion yet for this question.

Full 70-465 Practice