PrepAway - Latest Free Exam Questions & Answers

How would you accomplish this task?

You work as a database administrator at ABC.com. ABC.com has a SQL Server 2012 database
named SalesDB. The SalesDB database is shown in the following database diagram:

You create a view on the SalesDB database using the following Transact-SQL code:
CREATE VIEW SalesV
WITH SCHEMABINDINGS
AS

SELECT Products.ProductID, Invoices.InvoiceDate, SUM (Products.RetailPrice *
OrderDetail.Quantity * OrderDetail.SalesDiscount) AS Price
FROM OrderDetail INNER JOIN Products ON
OrderDetail.ProductID = Products.ProducID
INNER JOIN Invoices ON
OrderDetail.InvoiceID = Invoices.InvoiceID
GROUP BY Products.ProductID, Invoices.InvoiceDate
GO
You want the SalesV view to persist data to disk in order to improve performance.
How would you accomplish this task?

PrepAway - Latest Free Exam Questions & Answers

A.
You should add a clustered index to the SalesV view.

B.
You should create a columnstore index on all columns used in the SalesV view.

C.
You should drop and recreate the SalesV view as a system view.

D.
You should drop and recreate the SalesV view as a partitioned view.

Explanation:

Ref: http://msdn.microsoft.com/en-us/library/ms190174

7 Comments on “How would you accomplish this task?

  1. Matador says:

    Even the ref doc says Indexed View

    Indexed Views
    An indexed view is a view that has been materialized. This means the view definition has been computed and the resulting data stored just like a table. You index a view by creating a unique clustered index on it. Indexed views can dramatically improve the performance of some types of queries. Indexed views work best for queries that aggregate many rows. They are not well-suited for underlying data sets that are frequently updated.




    0



    0
  2. ASNAOUI Ayoub says:

    We’re having 2 joins in the view….So one clustered index is not enough to improve the view…

    I think (B) is the correct response…Because a columnstore index would cover all view joins




    0



    0

Leave a Reply