`

The CPU Costing Model: A Few Thoughts Part V (Reality)

    博客分类:
  • CBO
 
阅读更多

There’s plenty more I could talk about regarding the CBO CPU costing model and system statistics but I’ll make this my final little comment on this subject for now.
 
As previously discussed, the CPU costing model basically takes the time it takes to perform the all necessary I/O related activities and all the time it takes to perform all necessary CPU related activities and adds them together to get the overall time to complete a task. The CBO then takes this total and divides it by the average time to perform a single block I/O so that it expresses the overall costs in units of single block I/Os.
 
There are two advantages with expressing CBO costs in this manner.
 
Firstly, it makes the move from the old I/O costing model a little easier in that the “units” of cost under both CBO costing models is very similar.
 
With the I/O costing model, the unit of cost was also basically the number of I/Os. It’s just that the CBO made no (automatic) distinction between the I/O costs associated with single and multiblock reads. The cost was simply the expected total number of I/Os for a given execution plan, with single block and multiblock I/Os being consider the same (unless the optimiser_index_cost_adj parameter kicked in).
 
With the CPU costing modelling, the costs are expressed specifically in units of single block I/Os. However, the CBO automatically takes into consideration and differentiates the relative costs associated with multiblock I/Os (and CPU operations) and incorporates them automatically into the final cost.

The other nice advantage is that one can use the actual cost values as an indication of how long an operation or execution plan is likely to take. The overall execution times of the plan are divided by the average time of a single block I/O when using the CPU costing formula. Therefore by multiplying these cost values out again by the average time of a single block I/O (SREADTIM system statistic), one can have an indicative idea of the overall expected execution time.
 
The overall execution times as estimated by the CBO using the CPU costing model is therefore basically = cost of execution plan multiplied by SREADTIM system statistic.
 
Using my previous example with the FTS where the overall cost of the execution plan was 70, and the SREADTIM system statistic was 5:
 
the overall execution time as estimated by the CBO is approximately 70 x 5 = 350 ms.
 
Now this of course is only an indicative value. As all system related statistics are simply averages, there could obviously be discrepancies with how long specific I/Os take to actually perform, the size and number of specific multiblock read operations, etc. There may also be caching characteristics of objects that may influence the actual number of physical reads and associated wait times, it doesn’t take into consideration time taken to actually return data to the “client”, etc. etc. etc.
 
However, it provides one with a rough “ballpark figure”. If the actual executions times in the above example were (say) 20 seconds, then it’s a strong indication that the CBO may have got it wrong, that it may have calculated the wrong cost and maybe as a result the wrong execution plan. Somewhere, something such as the segment statistics, the system statistics, optimizer parameters, etc. may be inaccurate and is causing the CBO to get its costings incorrect.
 
The CBO cost value doesn’t compare well to reality and so is perhaps worthy of further investigation.
 
The cost values associated with CPU costing model is not some random, ambiguous, mysterious number but a value that can often be derived and which can be most useful in determining and resolving problematic SQL statements and execution plans.

 

参考至:http://richardfoote.wordpress.com/2010/01/13/the-cpu-costing-model-a-few-thoughts-part-v-reality/

如有错误,欢迎指正

邮箱:czmcj@163.com

分享到:
评论

相关推荐

    200页详细的特斯拉Model3域控制器拆解分析

    8.Tesla Model 3域控制器 Reverse Costing 分析:通过对域控制器的Reverse Costing 分析,可以了解自动驾驶系统的成本结构和经济效益,了解自动驾驶系统的市场竞争力和商业战略。 9. 域控制器电子设计自动化(EDA)...

    Visual C# Homework Projects: A Computer Programming Tutorial

    Visual C# Homework Projects: A Computer Programming Tutorial by Philip Conrod English | 7 Aug. 2017 | ASIN: B074N8QQG3 | 920 Pages | AZW3 | 23.48 MB Visual C# programming concepts are taught while ...

    Shipment Costing.pdf

    根据提供的文档信息,本文将对SAP中的运输成本计算(Shipment Costing)进行详细的解析。主要内容包括SAP TM管理的定制设置、主数据配置以及流程演示等方面。 ### 一、简介 本文档旨在介绍SAP系统中运输成本计算的...

    微软内部资料-SQL性能优化5

    The trees are managed, and branches are grafted as necessary, so that navigating down the tree to find a value and locate a specific record takes only a few page accesses. Because the trees are ...

    oracle project costing manual

    标题《Oracle Project Costing Manual》表明本文档是关于Oracle项目成本管理的使用手册。文档描述指出,它用于指导Oracle项目成本管理系统的实施。标签“project costing”指明这是专门针对项目成本管理的专业内容。...

    costing sheet

    Costing Sheet - 成本核算单原理与后台配置 成本核算单(Costing Sheet)是一种重要的成本会计工具,用于计算和分配间接生产费用。它能够帮助企业更好地控制成本,提高生产效率和经济效益。 成本核算单的原理 ...

    dynamic costing

    动态成本(Dynamic Costing)是一种基于决策制定的成本管理方法,它强调根据不同的决策情境来定义和衡量成本。这种方法对于现代企业的财务管理至关重要,因为它可以帮助企业在不断变化的市场环境中做出更明智的决策...

    IEC 60300-3-3:2017 可靠性管理-第3-3部分:应用指南-生命周期成本计算 - 完整英文电子版(94页)

    完整英文电子版 IEC 60300-3-3:2017 Dependability management-Part 3-3:Application guide - Life cycle costing(可靠性管理-第3-3部分:应用指南-生命周期成本计算)。IEC 60300-3-3:2017 对生命周期成本的概念...

    Oracle成本管理培训资料.pptx

    - 平均成本法(Inventory Average Costing):适用于仅库存组织,跟踪库存的平均成本。 - 标准成本法(Standard Costing):适用于所有组织,允许设定标准成本并进行成本差异分析。 - 制造平均成本法...

    活动成本及活动activity based costing and activity based management.ppt

    活动成本及活动基础管理(Activity-Based Costing and Activity-Based Management,简称ABC/ABM)是管理会计中的核心概念,主要用于更准确地分配间接成本并优化决策制定。在现代企业环境中,间接成本通常占据了总...

    2015九年级英语全册Unit13We’retryingtosavetheearth第3课时同步练习新版人教新目标版

    - 9题:参加活动用take part in,选A. take part in。 - 10题:负担不起用can't afford,选A. afford。 4. 汉译英: - "当你出去的时候,不要忘记关灯。"译为"Don’t forget to turn off the lights when you go...

    Lean_manufacturing_Production_flow_and_activities_AX2012

    The document serves as a guide for those responsible for production, costing, or supply chain management. It aims to educate them on the range and scalability of the functionality offered by the lean ...

    Job Costing Tracking system:跟踪所有工作成本,确保您不会亏钱-开源

    预订工作卡,分配员工以记录在工作上花费的时间,该时间转移到时间表中,并添加成本,例如内置库存系统中的物料。 最后创建与XERO在线会计集成的发票或打印PDF发票。

    Oracle Project Costing User Guide Release 11i

    《Oracle Project Costing 用户指南 11i 版》是Oracle公司发布的一份技术文档,主要作者包括Jeffrey Colvard、Stephen A. Gordon,以及多位贡献者。该指南旨在为用户详细阐述如何在Oracle Project Costing 11i版本中...

    Pro PowerShell for Amazon Web Services DevOps for the AWS Cloud

    The cloud offers information technology workers significant cost savings and agility unimaginable even just a few years ago. Tasks that traditionally took weeks of work, costing thousands of dollars,...

    成本流程及制造成本表.ppt

    3. 倒流式成本制(Backflush costing):在精益生产或实时制造环境下,只有在产品完成并卖出时才记录成本,简化了成本计算过程。 4. 实际成本制:以实际发生的成本为基础进行成本计算。 5. 预计成本制:基于预测的...

    QAD Costing

    QAD Costing是QAD公司提供的一个专门针对产品成本管理和控制的解决方案。QAD Costing旨在帮助企业精确地计算和管理其产品的成本,从而优化运营效率,提高盈利能力,并作出更明智的决策。 产品成本法是QAD Costing的...

    Tanning Salon

    Research has shown that if a customer arrives and there are no beds available, the customer will turn around and leave, thus costing the company a sale. Your task is to write a program that tells the...

    专题资料(2021-2022年)2017浙大远程生产运营管理在线作业.docx

    章】在作业成本法(Activity-Based Costing, ABC)中,成本动因是:A 直接成本 B 间接成本 C 造成成本发生的活动或事件 D 成本分配的基础 E 以上都不是 正确答案:C 单选题 23.【第 05 章】以下哪种方法不是用来估计...

Global site tag (gtag.js) - Google Analytics