Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (230.64 KB, 2 trang )
Foreword
Duringmyyearsasadeveloper,andlaterasadatabase
administrator,theonlyperformancetuningareainwhichI
developedanyexpertiseandhadanylevelofsuccesswasthat
oftuningindividualSQLstatements.Becauseofthat
background,IwasveryinterestedwhenDanTowcametome
withhisideaforabookonSQLtuning.
TheproblemwithSQLtuning,atleastfrommyown
perspective,isthatitwasoftenreasonablyeasytopinpoint
badlyperformingSQLstatementsthatneededtobetuned,and
itwasreasonablyeasytodeterminetheexecutionplan
currentlybeingusedforthosebadlyperformingstatements,but
thencamethehardproblem:findingabetterexecutionplan,to
makeanoffendingSQLstatementexecutefaster.Manyisthe
timeI'vestaredatapoorlyperformingSQLstatement,
reviewingitspoorlyperformingexecutionplan,andwondered
justwhatIshoulddonext.Forthatmatter,wasthereevenany
roomforimprovement?Perhapstheexecutionplanthat
performedsobadlyfromauser'sperspectivewas,infact,the
bestpossibleexecutionplan.PerhapsIwaswastingmytime
tryingtoguessatabetterone.
There,Iusedthatwordguess,andthat'sattheheartofwhat
sometimesmadetuningSQLstatementsafrustratingactivity.It
allcamedowntomylookingataSQLstatementandtryingto
guessatabetterplan.Ofcourse,I'dattempttofactorinmy
experience,myintuition,andmyknowledgeofthedatabeing
queried,andI'dpullouttipsandtricksthatI'dreadaboutin
booksandmagazinearticles,butintheendI'dmakeaguess,
tryanewplan,makeaguess,tryanewplan,andsoforth.I'd
stopwhenoneoftwothingshappened:
Igotluckyandguessedaplanthatwasagood-enough