机械毕业设计英文外文翻译162改进ADO 性能.docx
- 文档编号:7916952
- 上传时间:2023-01-27
- 格式:DOCX
- 页数:9
- 大小:38.93KB
机械毕业设计英文外文翻译162改进ADO 性能.docx
《机械毕业设计英文外文翻译162改进ADO 性能.docx》由会员分享,可在线阅读,更多相关《机械毕业设计英文外文翻译162改进ADO 性能.docx(9页珍藏版)》请在冰豆网上搜索。
机械毕业设计英文外文翻译162改进ADO性能
附录
1.英文资料
ImprovingADO.NETPerformance
Improving.NETApplicationperformanceandscalability
Summary:
Thischapterprovidesprovenstrategiestohelpyoudesignanddevelopscalabledataaccesssolutions.Topicscoveredincludedifferenttechniquestopassdataacrossapplicationlayers,managingthedatabaseconnectionpool,optimizingstoredprocedurecalls,reducingdatasetserializationcost,techniquesforpagingthroughlargeresultsets,managingtransactions,handlingBLOBS,andmuchmore.
Objectives
∙Optimizeyourdataaccessdesign.
∙ChoosebetweenDataSetsandDataReaders.
∙Runefficientdatabasecommands.
∙Passdatabetweenlayersefficiently.
∙Performefficienttransactions.
∙Optimizeconnectionmanagement.
∙Evaluatethecostofpagingthroughrecords.
∙Evaluatecriteriaforanalyzingdataaccessperformance.
∙Applyperformanceconsiderationstobinarylargeobject(BLOB)manipulation.
Overview
Well-designeddataaccesscodeanddataprocessingcommandsareessentialelementsforapplicationperformanceandscalability.Typically,thedatabaseisafocalpointforapplicationloadbecausethemajorityofapplicationrequestsrequiredatathatcomesfromadatabase.
Thischapterprovidesprovenstrategiesfordesigningandimplementingdataaccesscodeforperformanceandscalability.
HowtoUseThisChapter
Usethischaptertoimprovetheimplementationofyourdataaccesscodeforperformanceandscalability.Togetthemostoutofthischapter,considerthefollowing:
∙Jumptotopicsorreadbeginningtoend.Themainheadingsinthischapterhelpyoutoquicklyidentifyandthenlocatethetopicthatinterestsyou.Alternatively,youcanreadthechapterbeginningtoendtogainathoroughappreciationoftheissuesthataffectADO.NETperformance.
∙Usethechecklist.Use"Checklist:
ADO.NETPerformance"inthe"Checklists"sectionofthisguidetoquicklyviewandevaluatetheguidelinespresentedinthischapter.
∙Usethe"Architecture"sectionofthischaptertounderstandhowADO.NETworks.Byunderstandingthearchitecture,youcanmakebetterdesignandimplementationchoices.UnderstandcoreADO.NETcomponents,suchasdataproviderobjectsandtheDataSetobject.
∙Usethe"DesignConsiderations"sectionofthischaptertounderstandthehigh-leveldecisionsthatwillaffectimplementationchoicesforADO.NETcode.
Measureyourapplicationperformance.learnaboutthekeymetricsthatyoucanusetomeasureapplicationperformance.Youhavetomeasureapplicationperformancesothatyoucanidentifyandresolveperformanceissues.
∙Testyourapplicationperformance."Testing.NETApplicationPerformance"tolearnhowtoapplyperformancetestingtoyourapplication.Youhavetoapplyacoherenttestingprocessandanalyzetheresults.
∙Tuneyourapplicationperformance."Tuning.NETApplicationPerformance"tolearnhowtoresolveperformanceissuesthatyouidentifythroughtheuseoftuningmetrics.
∙TuneSQLServer.ReadChapter14,"ImprovingSQLServerPerformance"toensurethatyourMicrosoft®SQLServer™databaseisappropriatelyconfigured.
Architecture
ADO.NETreliesondataproviderstoprovideaccesstotheunderlyingdatasource.Eachdataproviderexposesasetofobjectsthatyouusetomanageconnections,retrievedata,andupdatedata.Thecoreobjectsarethefollowing:
∙Connection
∙Command
∙DataReader
∙DataAdapter
Inaddition,ADO.NETprovidestheDataSetobject,whichprovidesadisconnectedcacheofdata.TheDataSetobjectdoesnotrequireaspecifictypeofdatasourceandisnottiedtotheunderlyingdatasourcethatthedatawasobtainedfrom.
ThebasicADO.NETarchitectureisshowninFigure12.1.
Figure12.1:
ADO.NETarchitecture
ThefollowinglistoutlinesthepurposeofeachofthemainADO.NETobjects:
∙Connection.Thisobjectrepresentsaconnectiontoadatabase.
∙Command.ThisobjectrepresentsanSQLstatementthatisrunwhileconnectedtoadatasource.ThisobjectcanbeastoredprocedureoradirectSQLstatement.
∙DataReader.Thisobjectretrievesaread-only,forward-onlystreamofdatafromadatabase.TheDataReaderobjectisdesignedforconnectedscenariosandoffersbetterperformancethanreadingdataintoaDataSetobjectattheexpenseoffunctionality.FormoreinformationabouthowtouseDataReaderobjectsandDataSetobjects,see"DataSetvs.DataReader"laterinthischapter.
∙DataAdapter.ThisobjectchannelsdatatoandfromaDataSetobjectandtheunderlyingdatasource.TheDataAdapterobjectalsoprovidesenhancedbatchupdatefeaturesthatwerepreviouslyassociatedwiththeADORecordsetobject.
∙DataSet.TheDataSetobjectrepresentsadisconnected,cachedsetofdata.TheDataSetisindependentoftheproviderandisnottiedtotheunderlyingdatasourcethatmighthavebeenusedtopopulateit.DataSetcaneasilybepassedfromcomponenttocomponentthroughthevariouslayersofanapplication,anditcanbeserializedasXML.
YoushouldbeawareofthewayaDataSetisinternallyconstructedbecausetheDataSetcontainsapotentiallylargenumberofinternalobjects.ThismeansthatalargenumberofmemoryallocationsarerequiredtoconstructatypicalDataSet.
ADataSetconsistsofoneormoreDataTableobjectstogetherwithDataRelationobjectsthatmaintaintablerelationshipinformation.EachDataTablecontainsDataRowobjectsandDataColumnobjects.ConstraintobjectsareusedtorepresentaconstraintthatcanbeenforcedononeormoreDataColumnobjects.
Note YoucanalsousetypeddatasetsthatderivefromthebasicDataSetclass.Typeddatasetsprovidebenefitsatbuildtimeandatruntime.Formoreinformation,see"TypedDataSets"laterinthischapter.
∙DataView.AlthoughtheDataViewobjectisnotshowninFigure12.1,youcanuseaDataViewtosortandfilterdatainaDataTable.Thiscapabilityisoftenusedfordatabinding.
AbstractingDataAccess
ADO.NETisdesignedaroundasetofgenericinterfacesthatabstracttheunderlyingdataprocessingfunctionality.Youcanusetheseinterfacesdirectlytoabstractyourdataaccesslayersothatyoucanminimizetheimpactofchangingthetypeofdatasourcethatyouuse.Abstractingdataaccessisextremelyhelpfulwhenyouaredesigningsystemswhereyourcustomerchoosesthedatabaseserver.
ThecoreinterfacesprovidedbyADO.NETarefoundintheSystem.Datanamespace:
∙IDbConnection.Thisisaninterfaceformanagingdatabaseconnections.
∙IDbCommand.ThisisaninterfaceforrunningSQLcommands.
∙IDbTransaction.Thisisaninterfaceformanagingtransactions.
∙IDataReader.Thisisaninterfaceforreadingdatareturnedbyacommand.
∙IDataAdapter.Thisisaninterfaceforchannelingdatatoandfromdatasets.
Thevariousproviderobjects,suchasSqlConnectionandOleDbConnection,implementthesegenericADO.NETdataaccessinterfaces.Ifyoudecidetoprogramagainstthegenericinterfaces,beawareofthefollowingissues:
∙Thereissomesmallcostassociatedwithavirtualcallthroughaninterface.
∙Certainexpandedfunctionalityislostwhenyouusethegenericinterfaces.Forexample,theExecuteXmlReadermethodisimplementedbytheSqlCommandobjectbutnotbytheIDbCommandinterface.
∙Thereisnogenericbaseexceptiontype,soyoumustcatchprovider-specificexceptiontypes,suchasSqlException,OleDbException,orOdbcException.
∙Whenyouusethegenericinterfaces,youcannottakeadvantageofdatabase-specifictypesthataredefinedforthemanagedproviders;forexample,youcannottakeadvantageofSqlDbTypeinSqlClientandOracle-specifictypesintheOracleprovider.Usingspecificdatabasetypesishelpfulfortypecheckingandparameterbinding.
PerformanceandScalabilityIssues
Thefollowingisalistofthemainissuesthatcanadverselyaffecttheperformanceandscalabilityofdataaccessinyourapplication.
∙Inefficientqueries.Queriesthatprocessandthenreturnmorecolumnsorrowsthannecessarywasteprocessingcyclesthatcouldbestbeusedforservicingotherrequests.Queriesthatdonottakeadvantageofindexesmayalsocausepoorperformance.
∙Retrievingtoomuchdata.Toomuchdatainyourresultsisusuallytheresultofinefficientqueries.TheSELECT*queryoftencausesthisproblem.Youdonotusuallyneedtoreturnallthecolumnsinarow.Also,analyzetheWHEREclauseinyourqueriestoensurethatyouarenotreturningtoomanyrows.TrytomaketheWHEREclauseasspecificaspossibletoensurethattheleastnumberofrowsarereturned.
∙Inefficientormissingindexes.Queryefficiencydecreaseswhenindexesaremissingbecauseafulltablescanmustbeperformed.Also,asyourdatagrows,tablesmaybecomefragmented.Failuretoperiodicallyrebuildindexesmayalsoresultinpoorqueryperformance.
∙Unnecessaryroundtrips.Roundtripssignificantlyaffectperformance.Theyaresubjecttonetworklatencyandtodownstreamserverlatency.Manydata-drivenWebsitesheavilyaccessthedatabaseforeveryuserrequest.Whileconnectionpoolinghelps,theincreasednetworktrafficandprocessingloadonthedatabaseservercanadverselyaffectperformance.Keeproundtripstoanabsoluteminimum.
∙Toomanyopenconnections.Connectionsareanexpensiveandscarceresource,whichshouldbesharedbetweencallersbyusingconnectionpooling.Openingaconnectionforeachcallerlimitsscalability.Toensuretheefficientuseofconnectionpooling,avoidkeepingconnectionsopenandavoidvaryingconnectionstrings.
∙Failuretoreleaseresources.Failingtoreleaseresourcescanpreventthemfrombeingreusedefficiently.Ifyoufailtocloseconnectionsbeforetheconnectionsfalloutofscope,theyarenotreclai
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 机械毕业设计英文外文翻译162改进ADO 性能 机械 毕业设计 英文 外文 翻译 162 改进 ADO
![提示](https://static.bdocx.com/images/bang_tan.gif)