###BeginCaseStudy###
Case Study 2
Contoso Ltd
Overview
Application Overview
Contoso, Ltd., is the developer of an enterprise resource planning (ERP) application.
Contoso is designing a new version of the ERP application. The previous version of the ERP
application used SQL Server 2008 R2. The new version will use SQL Server 2014.
The ERP application relies on an import process to load supplier data. The import process
updates thousands of rows simultaneously, requires exclusive access to the database, and runs daily.
You receive several support calls reporting unexpected behavior in the ERP application.
After analyzing the calls, you conclude that users made changes directly to the tables in the
database.
Tables
The current database schema contains a table named OrderDetails. The OrderDetails
table contains information about the items sold for each purchase order. OrderDetails
stores the product ID, quantities, and discounts applied to each product in a purchase
order. The product price is stored in a table named Products.
The Products table was defined by using the SQL_Latin1_General_CPl_CI_AS collation. A
column named ProductName was created by using the varchar data type.
The database contains a table named Orders. Orders contains all of the purchase orders from
the last 12 months. Purchase orders that are older than 12 months are stored in a table named OrdersOld.
Stored Procedures
The current version of the database contains stored procedures that change two tables. The
following shows the relevant portions of the two stored procedures:
Customer Problems
Installation Issues
The current version of the ERP application requires that several SQL Server logins be set up
to function correctly. Most customers set up the ERP application in multiple locations and
must create logins multiple times.
Index Fragmentation Issues
Customers discover that clustered indexes often are fragmented. To resolve this issue, the
customers defragment the indexes more frequently.
All of the tables affected by fragmentation have the following columns that are used as the
clustered index key:
Backup Issues
Customers who have large amounts of historical purchase order data report that backup time
is unacceptable.
Search Issues
Users report that when they search product names, the search results exclude product names
that contain accents, unless the search string includes the accent.
Missing Data Issues
Customers report that when they make a price change in the Products table, they cannot
retrieve the price that the item was sold for in previous orders.
Query Performance Issues
Customers report that query performance degrades very quickly. Additionally, the customers
report that users cannot run queries when SQL Server runs maintenance tasks.
Import Issues
During the monthly import process, database administrators receive many supports call from
users who report that they cannot access the supplier data. The database administrators want
to reduce the amount of time required to import the data.
Design Requirements
File Storage Requirements
The ERP database stores scanned documents that are larger than 2 MB. These files must only
be accessed through the ERP application. File access must have the best possible read and
write performance.
Data Recovery Requirements
If the import process fails, the database must be returned to its prior state immediately.
Security Requirements
You must provide users with the ability to execute functions within the ERP application,
without having direct access to the underlying tables.
Concurrency Requirements
You must reduce the likelihood of deadlocks occurring when Sales.Proc1 and Sales.Proc2 execute.
###EndCaseStudy###
You need to recommend a solution that reduces the time it takes to import the supplier data.
What should you include in the recommendation?
A.
Enable instant file initialization.
B.
Reorganize the indexes.
C.
Disable Resource Governor.
D.
Enable Auto Update Statistics.
Explanation:
* The ERP application relies on an import process to load supplier data. The import process
updates thousands of rows simultaneously, requires exclusive access to the database, and
runs daily.
Who said the resource governor was enabled?
After analyzing the calls, you conclude that users made changes directly to the tables in the
database.
Assuming this means person have enabled RG
Assumptions that can not be concluded from the details given!!
details says Import process updates thousands of rows, so I think reorganize the index (B) looks good to me
Why not D
Enable Auto Update Statistics. Daily updation happening, so Enable Auto Update Statistics will helpful.
I think the answer disable resouce gevernor is the most logic answer because the main problem is the processing speed as the customers enteri g the data inthe table and it is not rettriving data from thetable so the answer reorganize the index isnot aplicable hear
You update the rows also, so appropriate and updated indexes are usefull.
C
Your reason?!
Correct answer is B.
If it takes a long time to import the supplier data, and users complain of not being able to access their data, it could be that the indexes on the tables become highly fragmented (thereby becoming unused).
My solution would be:
1. Disable index prior to data import
2. Import the data
3. Enable the index
4. Reorganize the enabled index.
“Manually” Update Statistics could be the answer as after “The import process updates thousands rows”, Statistics might require updating to help “Cost based” query optimizer find the efficient execution plan.
But with “Auto” Update Statistics on, Statistics might not get updated.
“Reorganize the indexes” should be the best option.
———————–
When Statistics Updated:
———————–
If the table has no rows, statistics is updated when there is a single change in table.
If the number of rows in a table is less than 500, statistics is updated for every 500 changes in table.
If the number of rows in table is more than 500, statistics is updated for every 500+20% of rows changes in table.
“B” is best answer.
“The import process updates thousands of rows simultaneously” –> This could lead index fragmentation
“Requires exclusive access to the database” -> Reorg Index could reduce fragmentation without occupying much system resource as Rebuild Index does
In my previous job, there was a cases that million jobs (stored in a job table) ran for many days; the performance gradually degrade due to the job table gradually fragmented (as the job table constantly updated) ; the solution is to run Reorg index periodically.
979591 551878Attractive section of content material. I just stumbled upon your weblog and in accession capital to assert that I acquire truly enjoyed account your weblog posts. Anyway I will likely be subscribing to your augment and even I achievement you access consistently swiftly. 335403
The correct answer is A.
Other options just have no direct influence on the performance of import:
– B. Reorganize the indexes. –> Note MS does not directly state “disable indexes”; irrelevant.
– C. Disable Resource Governor. –> Deem guesses “it may be enabled because…”; irrelevant.
– D. Enable Auto Update Statistics. –> It does not improve data import performance anyhow.
Why A
——
From the scenario: “…The import process updates thousands of rows simultaneously, requires exclusive access to the database, and runs daily…”
From the question: “…recommend a solution that reduces the time it takes to import the
supplier data….”
https://www.brentozar.com/blitz/instant-file-initialization/
…The larger the growth operation, the more noticeable the performance improvement is with IFI enabled. For instance, a data file growing by 20 GB can take minutes to initialize without IFI. Read more about waits for file growths here. This can make a huge difference whenever you are proactively growing out data files…
Thus the only relevant option above that improves data import performance is IFI, answer A.
The import UPDATEs data, so it has to find the correct rows via index. It does not INSERT, so the growing of data files should be minimal.
But good link anyway 😉
“great threat, i like it, thanks very_ much.”
https://structuringtechniques.wordpress.com/2017/02/14/for-our-dutch-readers-interview-with-a-colleague-from-europe-regarding-easy-structuring-techniques-article-in-dutch-language/