You work with a database named DB1, which is located on a SQL Server 2005 computer.
You discover that a table scan on Table1 in DB1 causes a slow query. Table1 is a very large table that is used frequently. You ascertain that the query contains the following statement. SELECT col1, col2 FROM table1 WHERE col3 = <value> You need to provide maximum query performance. Table1 must remain available to users.
What should you do?
A.
Update all statistics on Table1 in DB1.
B.
Use the CREATE STATISTICS statement in DB1 to create missing statistics on col3 of Table1.
C.
Set the priority boost server option to 1.
D.
Execute the following statement.USE DB1GOCREATE INDEX index1 ON table1(col3) INCLUDE(col1, col2) WITH (ONLINE = ON)GO
E.
Execute the following statement.USE DB1GOCREATE INDEX index1 ON table1(col3, col2, col1)
Explanation:
You want to create an index on the columns 1 to 3 in order to have quicker response when querying data in columns 1 and 2 based on a value in column 3.
Syntax– Relational IndexCREATE [UNIQUE] [CLUSTERED | NONCLUSTERED] INDEX index ON object (column [ASC | DESC] [,…n ] )[INCLUDE (column [ ,…n] ) ] [WITH (option [ ,…n] ) ] [ON { partition_scheme ( column )| filegroup| default} ] [;]