|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
人力成本上的节省,MySQL的用户Spacemonkey实验室的首席执行官MitchPirtle如此表示:“维护MySQL使得你不需要一个年薪15万美元的DBA。oracle|功能
Whatisthedifferencebetweencpu_costinginOracle9andtheoldcostingofOracle8?
Oracle9与Oracle8中CPU_COSTING有甚么变更?
Authorsname:JonathanLewis
AuthorsEmail:Jonathan@jlcomp.demon.co.uk
Datewritten:15thDec2002
Oracleversion(s):9
Whatisthedifferencebetweencpu_costinginOracle9andthepreviouscostingmethodsofOracle7and8?
Oracle9与之前的Oracle7和8中CPU_COSTING有甚么变更?
Oracle9introducesamoresubtle,andthoroughcostingmechansim.ItsagreatimprovementontheOracle7/8version,butIthinkthechange-overisgoingtobeabitlikethechange-overfromrule-basedtocost-based.Ifyoudontunderstandhowitworksyoumayseesomestrangeevents.
Oracle9引进了一套更精密和周全的价值机制。这是对Oracle7/8版的严重改善,但我以为这一改动相似从基于划定规矩变化至基于价值。假如你不睬解它是怎样运作的,你会看到奇异的事务。
Youcanenablecpu_costingsimplybycollectingsystem_statisticsforanappropriateperiodoftimewiththedbms_statspackage.Thisrecordsinthetablesys.aux_stats$valuesfor:
你能够用dbms_stats包搜集一段得当的工夫内的体系统计,以此来激活CPU_COSTING。
assumedCPUspeedinMHz假定的CPU速率(MHz)
singleblockreadtimeinmilliseconds单块读工夫(ms)
multiblockreadtimeinmilliseconds多块读工夫(ms)
typicalachievedmultiblockread.一样平常到达的多块读
Thesefiguresareusedtoproducethreemaineffects.
这些数字可发生三个次要功效:
InsteadofOracleassumingthatsingleblockreadsarejustasexpensiveasmultiblockreads,Oracleknowstherelativespeed.Thisisroughlyequivalenttosettingtheparameteroptimizer_index_cost_adjaccordingtothedbfilexxxxreadaveragewaittimes-itwillencourageOracletouseindexedaccesspathsinsteadoftablescansbecauseOraclenowunderstandsthattablescansaremoreexpensivethanitusedtothink.
Oracle其实不假订单块读与多块读一样高贵,它晓得绝对速率。这大抵与依据数据库文件xxxx读取的均匀守候工夫设置参数optimizer_index_cost_adj不异——因为Oracle如今以为表扫描比本来了解更高贵,这将勉励Oracle利用索引会见路径而不是表扫描。
Secondly,Oraclewillusetheachievedaveragemultiblockreadcounttocalculatethenumberofreadrequestsrequiredtoscanatable,insteadofusinganadjustedvalueofdb_file_multiblock_read_count.Sincemanypeopleuseavalueofdb_file_multiblock_read_countthatisinappropriate,theresultofthisisthatOracleislikelytoincreasethecostof,andthereforedecreasetheprobabilityof,doingtablescans(andindexfastfullscans).Note-therecordedvalueisusedinthecalculations,butOracletriestousetheinit.oravaluewhenactuallyrunningatablescan.
其次,Oracle将利用“到达的”(achieved)均匀多块读取数来盘算扫描一张表所需的读哀求数,而不是利用一个db_file_multiblock_read_count的调剂值。因为良多人利用的db_file_multiblock_read_count值其实不符合,如许就形成Oracle大概增添表扫描(和索引疾速全扫描)的价值,并由此削减表扫描(和索引疾速全扫描)的大概性。注重——纪录的值是用于盘算的,认真正举行扫描时,Oracle会实验利用init.ora中的值。
Finally,Oracleknowsthat(e.g.)to_char(date_col)=charactervaluecostsalotmoreCPUthannumber_col=number_value,soitmaychangeitschoiceofindextousealessselectiveindexiftheconsequentialcostofusingthatindexisloweronCPUusage.(Also,Oraclewillre-arrangetheorderofnon-accesspredicatestominimiseCPUcosts,butthedifferenceinperformancefromthisisnotlikelytobevisibleinmostcases).
最初,Oracle晓得(比方)to_char(日期列)=字符值的CPU价值比数字列=数值要打,以是Oracle大概修正索引的选择,若利用一个有更小选择性的索引的一连读价值(consequentialcost)低于CPU的利用价值,则会选择这一索引。(别的,Oracle将从头布置非会见(non-access)的谓词按次来减小CPU价值,但在多半情形下不会发觉功能的差别。)
Overall-itsdefinitelyagoodthing.Inpractice,youmayseeamuchstrongerbiastowardsindexedaccesspathswhichmayimpactperformance.
总之——这一定是一个功德。现实上,你能够发明对索引会见路径更强的偏好,这将影响功能。
Furtherreading:Oracle9.2PerformanceTuningGuideandReference
进一步浏览:Oracle9.2功能调剂指南和参考
--------------------------------------------------------------------------------
本文翻译自http://www.jlcomp.demon.co.uk/faq/译者仅保存翻译版权
DBaaS向客户提供了许多与其他云服务相类似的优势:一个灵活的、可扩展的MySQL学习教程、按需服务的平台,它以自助服务和便捷管理为导向,可以对环境中的资源进行调配。 |
|