??
????11????????? DBCC REINDEX ??DBCC INDEXDEFRAG?????????????? DBCC SHRINKDB??DBCC SHRINKFILE. ??????????????.??????????????????????????????????????????????????T-sql??д?????к?????????????г???????????????DBMS???????????????????????????
????1?? ???????????????顡??
????2?? ?????????DBMS?????????????
????3?? ??????????????????·???????????
????4?? ?????????????????滮????
????5?? ????????????????????????С???
????6?? ????н????????????Σ??????SQL SERVER????????????????????С?8K(8060)????8???????????????????B??????????
????12??Commit??rollback?????? Rollback:??????е????? Commit:???????????. ??б??????SQL??д????????д??д???????磺 begin tran exec(@s) commit trans ????????SQL д?????????洢?????????
????13??????Select???????Where????????????????????????裬??????????????????????????????I/O????????????????????????????????????????????佫?????????????????????????????????????
????14??SQL??????????????????κ????
????15???????????ù???????????????????????row-by-row????У????????÷????????磺???????????????????Table????????????????Case???????α???????????????????????з??? ??? ??????????е?????е????????С?FETCH NEXT ???????????????????????????????????????α????κε?????????????С??α???????SQL2000?±?ù???????????????????????????????????? READ_ONLY????????????α?λ????(Update)?????????????????????????? OPTIMISTIC WITH valueS:??????????????????????????????????????????????????????????Σ???????α??????е????У???к?С?????????????????????С???????α???????????????????????е??У???????????????????????????????????У?????е?????????????????????????????б???????κ????????????????????????????????????У???????????????????????????????????????
??????????????????OPTIMISTIC WITH ROW VERSIONING:???????????????????а汾?????????а汾????????е???????????汾??????????????????????????????????α???????????????? SQL Server ?У?????????? timestamp ???????????????????????????????????????и???????????????????????????????????@@DBTS????????κη????????? timestamp ?е??????SQL Server ???????????д洢????? @@DBTS ?????????? @@DBTS ????????? ??????? timestamp ?У?????????????м?????????????????е????????????????????洢?????????????????????????????????????????????е????????? timestamp ?м??ɡ??????ó??????? timestamp ?е?????????а汾????????????????α????????????????????????? SCROLL LOCKS ?????????????????????????????????У???????????ж????α??????????ó????????????????С?????÷??????α???????ж????α?????????????????????????????????????α?????????????????????????????????????????????????????α??????????????????α????????????????????????????????????????????????????????α?????????????????????????κ??????????????????????????????????????????????С???????????????????????????????????????????????????У?????????????????????????????????????????????α???? Select ???????????????????Щ?α???????????????????????????????????????????????????′?????????α??????????????????′????????????????????е??л????????????????????????е????????????????????????????????????????????????????????????????α??????????? COMMIT ?????????κδ????α?????????????????????????????????????????????????????????????????α????????α? Select ????е????????????? ??? ?????? ????а汾???? ????????? δ???? δ???? δ???? ???? NOLOCK δ???? δ????δ???? δ???? HOLDLOCK ???? ???? ???? ???? UPDLOCK ???? ???? ???? ???? TABLOCKX ???? δ???? δ???????????? δ???? δ???? δ???? ???? *??? NOLOCK ?????????????????????α???????????????
????16????Profiler???????????????????????????SQL??????????;??????????????????????
????17?????UNion??UNion all ??????UNION all?á???
????18????????DISTINCT??????б????????????UNION?????????????????????????????????????????
????19????????????????????С??С???
????20????sp_configure 'query governor cost limit'????SET QUERY_GOVERNOR_COST_LIMIT??????????????????????????????????????????????????????????????????????????? SET LOCKTIME???????????