Which statement should you execute?

###BeginCaseStudy###
Case Study: 6
Coho Winery
Overview
You are a database developer for a company named Coho Winery. Coho Winery has an
office in London.
Coho Winery has an application that is used to process purchase orders from customers and
retailers in 10 different countries.
The application uses a web front end to process orders from the Internet. The web front end
adds orders to a database named Sales. The Sales database is managed by a server named
Server1.
An empty copy of the Sales database is created on a server named Server2 in the London
office. The database will store sales data for customers in Europe.
A new version of the application is being developed. In the new version, orders will be placed
either by using the existing web front end or by loading an XML file.
Once a week, you receive two files that contain the purchase orders and the order details of
orders fromoffshore facilities.
You run the usp_ImportOders stored procedure and the usp_ImportOrderDetails stored
procedure to copy the offshore facility orders to the Sales database.
The Sales database contains a table named Orders that has more than 20 million rows.
Database Definitions
Database and Tables
The following scripts are used to create the database and its tables:

Stored Procedures
The following are the definitions of the stored procedures used in the database:

Indexes
The following indexes are part of the Sales database:

Data Import

The XML files will contain the list of items in each order. Each retailer will have its own
XML schema and will be able to use different types of encoding. Each XML schema will use
a default namespace. The default namespaces are not guaranteed to be unique.
For testing purposes, you receive an XSD file from a customer.
For testing purposes, you also create an XML schema collection named ValidateOrder.
ValidateOrder contains schemas for all of the retailers.
The new version of the application must validate the XML file, parse the data, and store the
parsed data along with the original XML file in the database. The original XML file must be
stored without losing any data.
Reported Issues
Performance Issues
You notice the following for the usp_GetOrdersAndItems stored procedure:
• The stored procedure takes a long time to complete.
• Less than two percent of the rows in the Orders table are retrieved by
usp_GetOrdersAndItems.
• A full table scan runs when the stored procedure executes.
• The amount of disk space used and the amount of time required to insert data are very
high.
You notice that the usp_GetOrdersByProduct stored procedure uses a table scan when the
stored procedure is executed.
Page Split Issues
Updates to the Orders table cause excessive page splits on the IX_Orders_ShipDate index.
Requirements
Site Requirements
Users located in North America must be able to view sales data for customers in North
America and Europe in a single report. The solution must minimize the amount of traffic over
the WAN link between the offices.
Bulk Insert Requirements
The usp_ImportOrderDetails stored procedure takes more than 10 minutes to complete. The
stored procedure runs daily. If the stored procedure fails, you must ensure that the stored
procedure restarts from the last successful set of rows.
Index Monitoring Requirements
The usage of indexes in the Sales database must be monitored continuously. Monitored data
must be maintained if a server restarts. The monitoring solution must minimize the usage of
memory resources and processing resources.
###EndCaseStudy###

You need to implement a solution that addresses the page split issues.
Which statement should you execute?

###BeginCaseStudy###
Case Study: 6
Coho Winery
Overview
You are a database developer for a company named Coho Winery. Coho Winery has an
office in London.
Coho Winery has an application that is used to process purchase orders from customers and
retailers in 10 different countries.
The application uses a web front end to process orders from the Internet. The web front end
adds orders to a database named Sales. The Sales database is managed by a server named
Server1.
An empty copy of the Sales database is created on a server named Server2 in the London
office. The database will store sales data for customers in Europe.
A new version of the application is being developed. In the new version, orders will be placed
either by using the existing web front end or by loading an XML file.
Once a week, you receive two files that contain the purchase orders and the order details of
orders fromoffshore facilities.
You run the usp_ImportOders stored procedure and the usp_ImportOrderDetails stored
procedure to copy the offshore facility orders to the Sales database.
The Sales database contains a table named Orders that has more than 20 million rows.
Database Definitions
Database and Tables
The following scripts are used to create the database and its tables:

Stored Procedures
The following are the definitions of the stored procedures used in the database:

Indexes
The following indexes are part of the Sales database:

Data Import

The XML files will contain the list of items in each order. Each retailer will have its own
XML schema and will be able to use different types of encoding. Each XML schema will use
a default namespace. The default namespaces are not guaranteed to be unique.
For testing purposes, you receive an XSD file from a customer.
For testing purposes, you also create an XML schema collection named ValidateOrder.
ValidateOrder contains schemas for all of the retailers.
The new version of the application must validate the XML file, parse the data, and store the
parsed data along with the original XML file in the database. The original XML file must be
stored without losing any data.
Reported Issues
Performance Issues
You notice the following for the usp_GetOrdersAndItems stored procedure:
• The stored procedure takes a long time to complete.
• Less than two percent of the rows in the Orders table are retrieved by
usp_GetOrdersAndItems.
• A full table scan runs when the stored procedure executes.
• The amount of disk space used and the amount of time required to insert data are very
high.
You notice that the usp_GetOrdersByProduct stored procedure uses a table scan when the
stored procedure is executed.
Page Split Issues
Updates to the Orders table cause excessive page splits on the IX_Orders_ShipDate index.
Requirements
Site Requirements
Users located in North America must be able to view sales data for customers in North
America and Europe in a single report. The solution must minimize the amount of traffic over
the WAN link between the offices.
Bulk Insert Requirements
The usp_ImportOrderDetails stored procedure takes more than 10 minutes to complete. The
stored procedure runs daily. If the stored procedure fails, you must ensure that the stored
procedure restarts from the last successful set of rows.
Index Monitoring Requirements
The usage of indexes in the Sales database must be monitored continuously. Monitored data
must be maintained if a server restarts. The monitoring solution must minimize the usage of
memory resources and processing resources.
###EndCaseStudy###

You need to implement a solution that addresses the page split issues.
Which statement should you execute?

A.
ALTER INDEX IX_Orders_ShipDate ON Orders
REBUILD WITH (PAD_INDEX=OFF, DROP_EXISTING = ON);

B.
ALTER INDEX IX_Orders_ShipDate ON Orders
REBUILD WITH (FILLFACTOR=50, DROP_EXISTING = ON);

C.
ALTER INDEX IX_Orders_ShipDate ON Orders
REBUILD WITH (FILLFACTOR = 0, DROP_EXISTING = ON);

D.
ALTER INDEX IX_Orders_ShipDate ON Orders
REBUILD WITH (PAD_INDEX=ON, DROP_EXISTING = ON);



Leave a Reply 3

Your email address will not be published. Required fields are marked *


@Gerry

@Gerry

C

mickeyW

mickeyW

why ‘C’?
A Fillfactor of 0 is the same as 100, so there will be no space for new data and the page has to be Split very often.

So I think ‘B’ is OK.