PrepAway - Latest Free Exam Questions & Answers

You need to improve the performance of the query

You use a Microsoft SQL Server 2012 database that contains two tables named SalesOrderHeader and
SalesOrderDetail. The indexes on the tables are as shown in the exhibit.
(Click the Exhibit button.)

You write the following Transact-SQL query:

You discover that the performance of the query is slow. Analysis of the query plan shows table scans where the
estimated rows do not match the actual rows for SalesOrderHeader by using an unexpected index on
SalesOrderDetail.
You need to improve the performance of the query.
What should you do?

PrepAway - Latest Free Exam Questions & Answers

A.
Use a FORCESCAN hint in the query.

B.
Add a clustered index on SalesOrderId in SalesOrderHeader.

C.
Use a FORCESEEK hint in the query.

D.
Update statistics on SalesOrderId on both tables.

Explanation:
New statistics would be useful.
The UPDATE STATISTICS command updates query optimization statistics on a table or indexed view. By
default, the query optimizer already updates statistics as necessary to improve the query plan; in some cases
you can improve query performance by using UPDATE STATISTICS or the stored procedure sp_updatestats to
update statistics more frequently than the default updates.
http://msdn.microsoft.com/en-us/library/ms187348.aspx

One Comment on “You need to improve the performance of the query

  1. Runing Man says:

    70-765 New Dumps (Updated 7th/12/2017)

    QUESTION
    You use a contained database named ContosoDb within a domain.
    You need to create a user who can log on to the ContosoDb database.
    You also need to ensure that you can port the database to different database servers within the domain without additional user account configurations.
    Which type of user should you create?

    A. SQL user without login
    B. User mapped to an asymmetric key
    C. Domain user
    D. login mapped to a virtual account

    Answer: C

    QUESTION
    You administer a SQL Server 2012 server that contains a database named SalesDB. SalesDb contains a schema named Customers that has a table named Regions.
    A user named UserA is a member of a role named Sales.
    UserA is granted the Select permission on the Regions table.
    The Sales role is granted the Select permission on the Customers schema.
    You need to ensure that the Sales role, including UserA, is disallowed to select from any of the tables in the Customers schema.
    Which Transact-SQL statement should you use?

    A. REVOKE SELECT ON Schema::Customers FROM UserA
    B. DENY SELECT ON Object::Regions FROM UserA
    C. EXEC sp_addrolemember ‘Sales’, ‘UserA’
    D. DENY SELECT ON Object::Regions FROM Sales
    E. REVOKE SELECT ON Object::Regions FROM UserA
    F. DENY SELECT ON Schema::Customers FROM Sales
    G. DENY SELECT ON Schema::Customers FROM UserA
    H. EXEC sp_droprolemember ‘Sales’, ‘UserA’
    I. REVOKE SELECT ON Object::Regions FROM Sales
    J. REVOKE SELECT ON Schema::Customers FROM Sales

    Answer: F

    QUESTION
    You administer a SQL Server 2012 server that contains a database named SalesDB. SalesDb contains a schema named Customers that has a table named Regions. A user named UserA is a member of a role named Sales.
    UserA is granted the Select permission on the Regions table. The Sales role is granted the Select permission on the Customers schema.
    You need to ensure that UserA is disallowed to select from any of the tables in the Customers schema.
    Which Transact-SQL statement should you use?

    A. REVOKE SELECT ON Schema::Customers FROM UserA
    B. DENY SELECT ON Object::Regions FROM UserA
    C. EXEC sp_addrolemember ‘Sales’, ‘UserA’
    D. DENY SELECT ON Object::Regions FROM Sales
    E. REVOKE SELECT ON Object::Regions FROM UserA
    F. DENY SELECT ON Schema::Customers FROM Sales
    G. DENY SELECT ON Schema::Customers FROM UserA
    H. EXEC sp_droprolemember ‘Sales’, ‘UserA’
    I. REVOKE SELECT ON Object::Regions FROM Sales
    J. REVOKE SELECT ON Schema::Customers FROM Sales

    Answer: G

    More: https://drive.google.com/drive/folders/0B75b5xYLjSSNTnR6dFR2U3A5cFk?usp=sharing




    0



    0

Leave a Reply