70-465 · Question #169
You have a database named DB1 that has the following: --- a Table named Customers that contains a list of customers ---- a table named Invoice that contains invoice information. There is foreign key r
The correct answer is C. A nonclustered index. The task is to create a stored procedure that retrieves invoices for an unlimited list of customers, necessitating an efficient mechanism for handling a potentially large input set.
Question
Options
- AAn optional parameter
- BA table-valued parameter
- CA nonclustered index
- DA Multiple active -result set(MARS)
How the community answered
(21 responses)- A14% (3)
- B5% (1)
- C71% (15)
- D10% (2)
Why each option
The task is to create a stored procedure that retrieves invoices for an unlimited list of customers, necessitating an efficient mechanism for handling a potentially large input set.
An optional parameter is designed to handle a single, potentially absent, value, not a dynamic collection or 'unlimited list' of multiple values.
While a table-valued parameter effectively passes an unlimited list of customers to a stored procedure, it focuses on the input mechanism rather than the crucial performance optimization required for efficient retrieval, which is addressed by indexing.
To efficiently retrieve invoices for a potentially large, 'unlimited' list of customer IDs, a nonclustered index on the relevant foreign key column (e.g., `CustomerID` in the `Invoice` table) is crucial for optimizing join operations and filter conditions, ensuring acceptable performance for the stored procedure when processing many customers.
Multiple Active Result Sets (MARS) is a feature allowing multiple outstanding data requests on a single connection and is unrelated to defining or passing parameter lists to a stored procedure.
Concept tested: Stored procedure performance with large dynamic lists
Source: https://learn.microsoft.com/en-us/sql/relational-databases/indexes/clustered-and-nonclustered-indexes-described?view=sql-server-ver16
Topics
Community Discussion
No community discussion yet for this question.