Download - SQL Database Optimization Justin Kovacich
![Page 1: SQL Database Optimization Justin Kovacich](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815df5550346895dcc2d87/html5/thumbnails/1.jpg)
![Page 2: SQL Database Optimization Justin Kovacich](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815df5550346895dcc2d87/html5/thumbnails/2.jpg)
Sizing the SQL Server Hardware Table Design Index Design Query Design
![Page 3: SQL Database Optimization Justin Kovacich](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815df5550346895dcc2d87/html5/thumbnails/3.jpg)
Available memory on the server Number of CPUs Desired processor utilization % Clustering Average growth % per year
![Page 4: SQL Database Optimization Justin Kovacich](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815df5550346895dcc2d87/html5/thumbnails/4.jpg)
Data Storage Capacity (Now and Future) Speed of Hard Drives Number of Physical Hard Drives RAID array
![Page 5: SQL Database Optimization Justin Kovacich](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815df5550346895dcc2d87/html5/thumbnails/5.jpg)
Normalization is the concept of abstracting data out of a table and having a pointer to that shared value
Assume everyone has collateral of a car and a house for their loan. Instead of each record carrying car and house, there is a pointer to those names. If “car” changes to “automobile”, it is a simple matter of changing one column in one row, rather than one column in thousands of rows
![Page 6: SQL Database Optimization Justin Kovacich](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815df5550346895dcc2d87/html5/thumbnails/6.jpg)
Bad Solutions◦ Large rows with many columns
Good Solutions◦ Greater number of tables with fewer columns
![Page 7: SQL Database Optimization Justin Kovacich](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815df5550346895dcc2d87/html5/thumbnails/7.jpg)
•Wide tables•Predetermined maximums
![Page 8: SQL Database Optimization Justin Kovacich](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815df5550346895dcc2d87/html5/thumbnails/8.jpg)
![Page 9: SQL Database Optimization Justin Kovacich](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815df5550346895dcc2d87/html5/thumbnails/9.jpg)
•Physically Separated Tables•Logically Combined Data
![Page 10: SQL Database Optimization Justin Kovacich](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815df5550346895dcc2d87/html5/thumbnails/10.jpg)
SELECT b.CustomerID, n.LoanNumber, n.TotalCommitment, c.collat_id
FROM customer b, loan n, collateral cWHERE b.date = '02-28-2007' and b.date = n.dateand b.date = c.dateand b.customerid = n.customeridand b.customerid = c.customeridand n.loannumber = c.loannumberorder by b.customerid, n.loannumber,
n.totalcommitment
![Page 11: SQL Database Optimization Justin Kovacich](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815df5550346895dcc2d87/html5/thumbnails/11.jpg)
Speeds access when joining tables Speeds sort operations Slows INSERTs and DELETEs Indexes are easily added and removed
without impacting the data itself
![Page 12: SQL Database Optimization Justin Kovacich](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815df5550346895dcc2d87/html5/thumbnails/12.jpg)
How frequently will the fields be referenced:◦ WHERE clause◦ ORDER BY clause
Are these tables used more frequently for READs than INSERTs?
![Page 13: SQL Database Optimization Justin Kovacich](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815df5550346895dcc2d87/html5/thumbnails/13.jpg)
Try to join tables on indexed fields Try to join as few tables as possible Try to join on numeric values (Instead of
text) The more specific a WHERE clause, the
quicker your search will be. Never SELECT * from a table, always specify
the desired columns
![Page 14: SQL Database Optimization Justin Kovacich](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815df5550346895dcc2d87/html5/thumbnails/14.jpg)
![Page 15: SQL Database Optimization Justin Kovacich](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815df5550346895dcc2d87/html5/thumbnails/15.jpg)
http://www.sql-server-performance.com http://www.webopedia.com/term/r/raid.html
- Information on RAID hard drives http://technet.microsoft.com/en-us/
magazine/cc165445.aspx - Information on query optimization http://www.edbarlow.com/document/
optimize.html - Information on normalization
![Page 16: SQL Database Optimization Justin Kovacich](https://reader035.vdocuments.mx/reader035/viewer/2022062315/56815df5550346895dcc2d87/html5/thumbnails/16.jpg)
What are two benefits of indexes? T/F: Adding indexes changes the data.