Preface |
|
xiii | |
PART I: FIRST CUT PHYSICAL DESIGN |
|
1 | (54) |
|
1 LOGICAL TO PHYSICAL MODEL MAPPING |
|
|
3 | (16) |
|
What do I create a design for implementation from? What do I start from? |
|
|
3 | (1) |
|
Why start from a relational model logical design? |
|
|
4 | (6) |
|
What is the first thing I should do to the logical design? |
|
|
10 | (1) |
|
How do I know if it is working adequately? |
|
|
10 | (1) |
|
What constitutes useful performance criteria? |
|
|
11 | (1) |
|
How do I implement integrity? |
|
|
12 | (2) |
|
Which approach should I use for integrity: declarative or programmatic? |
|
|
14 | (3) |
|
|
17 | (2) |
|
|
19 | (12) |
|
What are the best datatypes to use? |
|
|
19 | (2) |
|
What is the difference between char and varchar? |
|
|
21 | (1) |
|
|
21 | (1) |
|
What is the difference between the numeric datatypes? |
|
|
22 | (3) |
|
|
25 | (2) |
|
What should I do if processing involves dates only? |
|
|
27 | (2) |
|
What should I do if processing involves both date and time? |
|
|
29 | (1) |
|
|
30 | (1) |
|
3 RECORD SIZE CONSIDERATIONS |
|
|
31 | (10) |
|
Is there an optimum column placement? |
|
|
31 | (1) |
|
Is there an optimum record size? |
|
|
32 | (2) |
|
|
34 | (1) |
|
How do I ensure less records per page? |
|
|
35 | (1) |
|
|
36 | (1) |
|
How do I make the record smaller? |
|
|
36 | (3) |
|
|
39 | (2) |
|
4 TABLE SIZE CONSIDERATIONS |
|
|
41 | (14) |
|
|
41 | (1) |
|
|
42 | (1) |
|
How do I make my table smaller? |
|
|
43 | (1) |
|
Is there an optimum number of tables to access in one command? |
|
|
44 | (1) |
|
How do I reduce the number of tables in one command? |
|
|
45 | (3) |
|
How big should a key column be? |
|
|
48 | (2) |
|
Is there a limit to the number of columns in a key field? |
|
|
50 | (1) |
|
How do I reduce the number of columns in a key? |
|
|
50 | (3) |
|
|
53 | (2) |
PART II: SQL SERVER INDEXING |
|
55 | (56) |
|
|
57 | (14) |
|
|
57 | (2) |
|
What index choices do I have? |
|
|
59 | (7) |
|
When should I use the clustered index? |
|
|
66 | (1) |
|
When should I use the nonclustered index? |
|
|
67 | (1) |
|
What if I need more than one clustered index? |
|
|
67 | (2) |
|
|
69 | (2) |
|
|
71 | (14) |
|
What are the overheads of maintaining the nunclustered indexes? |
|
|
71 | (2) |
|
|
73 | (3) |
|
Nonclustered index updates |
|
|
76 | (1) |
|
What are the overheads of maintaining the clustered indexes? |
|
|
77 | (6) |
|
|
83 | (2) |
|
|
85 | (26) |
|
How does the index get selected? |
|
|
85 | (6) |
|
How do I choose columns for an index? |
|
|
91 | (1) |
|
How do I index for and clauses? |
|
|
92 | (1) |
|
How do I sequence the columns in a compound index? |
|
|
93 | (1) |
|
How do I index for or clauses? |
|
|
94 | (2) |
|
How do I index for join clauses? |
|
|
96 | (3) |
|
Do I need any special index considerations for outer joins? |
|
|
99 | (2) |
|
How do I index for nested commands? |
|
|
101 | (3) |
|
Is an index used the same way in a procedure? |
|
|
104 | (2) |
|
So why should I use procedures? |
|
|
106 | (3) |
|
|
109 | (2) |
PART III: ADMINISTRATION INTERNALS |
|
111 | (76) |
|
|
113 | (20) |
|
What is the unit of disk space? |
|
|
113 | (1) |
|
How is disk space defined and managed? |
|
|
114 | (2) |
|
What is the system table relationship for storage allocations? |
|
|
116 | (2) |
|
How is table and index space controlled? |
|
|
118 | (3) |
|
So how does the server allocate more space to an object? |
|
|
121 | (1) |
|
How is the data page itself laid out? |
|
|
121 | (3) |
|
How is the index page laid out? |
|
|
124 | (1) |
|
How is the data record laid out? |
|
|
125 | (2) |
|
How is the index record laid out? |
|
|
127 | (1) |
|
How are the text image pages held? |
|
|
128 | (1) |
|
How is the distribution page laid out? |
|
|
129 | (2) |
|
|
131 | (2) |
|
9 TRANSACTION LOG AND RECOVERY? |
|
|
133 | (16) |
|
What is the transaction log? |
|
|
133 | (1) |
|
When does information get written to the log? |
|
|
134 | (2) |
|
What is the layout of the log page and the log record? |
|
|
136 | (2) |
|
What gets logged for the maintenance commands? |
|
|
138 | (1) |
|
Do multiple single maintenance commands in one transaction? |
|
|
139 | (1) |
|
How do I see the log records? |
|
|
140 | (2) |
|
How does recovery decide which records to roll forward and which to rollback? |
|
|
142 | (1) |
|
|
143 | (4) |
|
|
147 | (2) |
|
|
149 | (16) |
|
How does the dump database work? |
|
|
149 | (2) |
|
What does the load database do? |
|
|
151 | (1) |
|
How do I recover from a lost database? |
|
|
151 | (3) |
|
How do I recover the system databases? |
|
|
154 | (8) |
|
|
162 | (3) |
|
|
165 | (22) |
|
What locking is available? |
|
|
165 | (2) |
|
How are the slock and xlock used to ensure data consistency? |
|
|
167 | (2) |
|
Are there any problems using the default sql server locking? |
|
|
169 | (2) |
|
What locking granularity is supported? |
|
|
171 | (1) |
|
How do I see what locks have been acquired? |
|
|
172 | (2) |
|
What locks are set by a cursor? |
|
|
174 | (2) |
|
Why do I get so many deadlocks? |
|
|
176 | (3) |
|
How do I reduce the locking contention? |
|
|
179 | (5) |
|
|
184 | (3) |
PART IV: SYSTEM MONITORING |
|
187 | (38) |
|
|
189 | (6) |
|
|
189 | (2) |
|
|
191 | (3) |
|
|
194 | (1) |
|
13 SYSTEM MONITORING WITH SP_SYSMON |
|
|
195 | (30) |
|
|
195 | (2) |
|
|
197 | (26) |
|
|
223 | (2) |
PART V: TROUBLESHOOTING |
|
225 | (132) |
|
|
227 | (30) |
|
I have created an index but it is not being used |
|
|
227 | (3) |
|
It's a perfect index but still not being used |
|
|
230 | (1) |
|
I have updated the statistics and it still table scans |
|
|
231 | (2) |
|
How do I see the index choices for my sql? |
|
|
233 | (1) |
|
How do I see more detail on the optimizer index choices? |
|
|
234 | (5) |
|
Can I force an index to be used? |
|
|
239 | (2) |
|
Is there any optimum sequence to the where clauses? |
|
|
241 | (1) |
|
Is there any optimum sequence to the tables in the from clause? |
|
|
242 | (1) |
|
Can I alter the number of tables considered in the join sequence? |
|
|
243 | (1) |
|
Can I force the table evaluation sequence in a join command? |
|
|
243 | (1) |
|
Are there any other ways I can affect the optimizer decisions? |
|
|
244 | (2) |
|
How can I tell if the statistics have been created? |
|
|
246 | (1) |
|
How can I tell if the statistics are up-to-date? |
|
|
246 | (1) |
|
Can I see the expected number of I OS in the optimizer plan? |
|
|
247 | (1) |
|
How long does it take to create an index? |
|
|
248 | (3) |
|
Create index takes a long time: can I speed it up? |
|
|
251 | (1) |
|
I have created the index but it has no statistics |
|
|
252 | (1) |
|
My procedure has started going slowly |
|
|
252 | (2) |
|
|
254 | (3) |
|
15 STORAGE TROUBLESHOOTING |
|
|
257 | (26) |
|
How do I check the space allocations and object structures? |
|
|
257 | (7) |
|
Is there more detailed information on space allocation? |
|
|
264 | (5) |
|
Is there any more detailed information on pages and page chains? |
|
|
269 | (6) |
|
|
275 | (1) |
|
How do I correct allocation and page errors? |
|
|
275 | (1) |
|
So what errors will I get? |
|
|
275 | (6) |
|
|
281 | (2) |
|
|
283 | (8) |
|
|
283 | (7) |
|
|
290 | (1) |
|
17 RESPONSE TIME PROBLEMS |
|
|
291 | (18) |
|
Process appears to "hang" |
|
|
291 | (2) |
|
|
293 | (1) |
|
Slow transaction response time |
|
|
294 | (2) |
|
Steps in reviewing an optimization plan |
|
|
296 | (10) |
|
|
306 | (3) |
|
18 TROUBLESHOOTING WITH SP_SYSMON |
|
|
309 | (12) |
|
|
310 | (1) |
|
|
310 | (2) |
|
Total requested network I O |
|
|
312 | (1) |
|
|
313 | (1) |
|
|
314 | (1) |
|
Page splits rid update from clustered split |
|
|
314 | (1) |
|
|
315 | (1) |
|
|
315 | (1) |
|
|
316 | (1) |
|
Procedure reads from disk |
|
|
316 | (1) |
|
Ulc log semaphore requests |
|
|
317 | (1) |
|
|
317 | (1) |
|
|
317 | (1) |
|
|
318 | (1) |
|
|
318 | (1) |
|
|
319 | (1) |
|
|
319 | (2) |
|
19 NETWORK TROUBLESHOOTING |
|
|
321 | (8) |
|
Reduce opening and closing connections |
|
|
321 | (1) |
|
|
322 | (1) |
|
Minimize the client to server interactions |
|
|
322 | (1) |
|
Return only the necessary data to the client |
|
|
323 | (1) |
|
Match the network packet size to the type of processing |
|
|
324 | (1) |
|
Match the sql server default packet size to the network packet size |
|
|
325 | (1) |
|
Isolate heavy network users |
|
|
325 | (2) |
|
|
327 | (2) |
|
|
329 | (28) |
|
Avoid like when no wildcard |
|
|
329 | (1) |
|
Avoid min and max in the same statement |
|
|
330 | (1) |
|
Be careful when mixing columns and aggregate functions |
|
|
330 | (1) |
|
Do not mix the use of the where and having clauses |
|
|
331 | (2) |
|
Avoid use of greater than operator when column has large number of duplicates |
|
|
333 | (1) |
|
Make sure any where clause expressions and columns are the same datatype |
|
|
333 | (2) |
|
|
335 | (1) |
|
Always write search arguments in the where clauses |
|
|
335 | (1) |
|
Avoid unknown values in statements |
|
|
336 | (2) |
|
|
338 | (2) |
|
Do not test variable values in where clauses |
|
|
340 | (1) |
|
|
341 | (3) |
|
Avoid the use of not in (prior to System 11) |
|
|
344 | (2) |
|
|
346 | (1) |
|
Using characteristic functions |
|
|
346 | (5) |
|
Uses of the characteristic function calls |
|
|
351 | (6) |
APPENDIX A: SQL SERVER ERRORS |
|
357 | (32) |
APPENDIX B: PAGE HEADER STATUS BITS |
|
389 | (2) |
APPENDIX C: DBCC COMMANDS |
|
391 | (4) |
APPENDIX D: ADAPTIVE SERVER 11.5 |
|
395 | (12) |
INDEX |
|
407 | |