Rule based optimizer vs Cost based optimizer - 9i
Is Rule based optimizer not used any more or can be used depending on the application etc.
I think Rule based optimizer still has some advantages. Please give your input if you think otherwise.
Thx
I think Rule based optimizer still has some
advantages. Please give your input if you think
otherwise.You are absolutely correct. There are a few advantages to RBO.
RBO is better for any application that meets the following criteria:
- designed for Oracle version 7;
- has not been updated since Oracle 7;
- was hand tuned in Oracle 7;
- will not be upgraded to Oracle Database 10g (where RBO is obsolete);
- will not use Bitmap Indexes, Materialized Views, Query Rewrite, or vitrtually anything that was introduced in Oracle8 and beyond.
CBO, while not perfect, will allow new features to be used. And it is improving with every release.
Similar Messages
-
Re: Oracle 8i (8.1.7.4) Rule based v/s Cost based
Hi,
I would like to know the advantages/disadvantages of using RULE based optimizer v/s COST based optimizer in Oracle 8i. We have a production RULE based database and are experiencing performance issues on some queries sporadically.
TKPROF revealed:
call count cpu elapsed disk query current rows
Parse 0 0.00 0.00 0 0 0 0
Execute 3 94.67 2699.16 1020421 5692711 51404 0
Fetch 13 140.93 4204.41 688482 4073366 0 26896
total 16 235.60 6903.57 1708903 9766077 51404 26896
Please post your expert suggestions as soon as possible.
Thanks and Regards,
AI think the answer you are looking for is that Rule Based optimizer is predictive, but Cost Based optimizer results may vary depending on statistics of rows, indexes, etc. But at the same time, you can typically get better speed for OLTP relational databases with CBO, assuming you have correct statistics, and correct optimizer settings set.
-
Partitioning on Oracle 8i (Rule Based vs. Cost Based)
At my current engagement, we are using Oracle Financials 11.0.3 on Oracle 8.0.6. The application uses rule-based optimizer. The client wants to implement Oracle partitioning. With this in mind, we are concerned about possible performance issues that the implementation of partitioning may cause since RBO does not recognize it.
We agree that the RBO will see a non-partitioned table the same as a partitioned. In this scenario where you gain the most is with backup/recoverability and general maintenance of the partitioned table.
Nevertheless, we have a few questions:
When implementing partitions, will the optimizer choose to go with Cost base vs. Rule base for these partitioned tables?
Is it possible that the optimizer might get confused with this?
Could it degrade performance at the SQL level?
If this change from RBO to CBO does occur, the application could potential perform poorly because of the way it has been written.
Please provide any feedback.
Thanks in advance.If the CBO is invoked when accessing these tables, you may run into problems.
- You'll have to analyze your tables & ensure that the statistics are kept up to date.
- It's possible that any SQL statements which invoke the CBO rather than the RBO will have different performance characteristics. The SYSTEM data dictionary tables, for example, must use the RBO or their performance suffers dramatically. Most of the time, the CBO beats the RBO, but applications which have been heavily tuned with the RBO may have problems with the CBO.
- Check your init.ora to see what optimizer mode you're in. If you're set to CHOOSE, the CBO will be invoked whenever statistics are available on the table(s) involved. If you choose RULE, you'll only invoke the CBO when the RBO encounters situations it doesn't have rules for.
Justin -
How can I know the database is using Cost Based or Rule Based?
Hi all expertise,
How can I know the database is using Cost Based or Rule Based?
If cost based it is using, what methods are need to use to minimize the cost when database is running? And which tables I can see the performance of the database?
Thanks
Amyhow to see database setting ?
use this
SQL> sho parameter optimizer
NAME TYPE VALUE
optimizer_dynamic_sampling integer 1
optimizer_features_enable string 9.2.0
optimizer_index_caching integer 0
optimizer_index_cost_adj integer 100
optimizer_max_permutations integer 2000
optimizer_mode string CHOOSE
choose means if table statistics is available then it will use cost
else
use rule based optimizer
for seeing performnace of table use
set autotrace on
and run your query
if it doen't show cost.it means it use rule based
for using cost based
u will calculate table statistics
9i
dbms_stats.gather_table_stats('owner','table');
8i
analyze table <table_name> compute statistics;
hope it will help you
kuljeet pal singh -
Reconciliation of costing based COPA and account based COPA
hi experts,
I want reconciliation statement of A/c based copa and costing based copa through SAP. we have not configured any account based copa reports. now we are manually doing the reconciliation. Please tell me the configuration.
Thanks & regards
jayHI
Costing-based Profitability Analysis is the form of profitability analysis that groups costs and revenues according to value fields and costing-based valuation approaches, both of which you can define yourself. It guarantees you access at all times to a complete, short-term profitability report.
Account-based Profitability Analysis is a form of profitability analysis organized in accounts and using an account-based valuation approach. The distinguishing characteristic of this form is its use of cost and revenue elements. It provides you with a profitability report that is permanently reconciled with financial accounting
Regards,
Vijayanand Sankaran -
Difference between account based and cost based in co-pa
hi friends,
what is main deffirencebetween account based and cost based in co-pa. what scenerio we use account based and what scenerio we use cost based.
Thanking u
suneel.Hi,
It all depends on the OPerating oncern which you are going to use for the CO-PA implementaion.
For a account based Operating concern you can define accopund based copa.
For a Cost Based Operating concdern you will have tp define account based Copa.
You can create account based Copa on cost based operating concern and vice versa.
In most of the FI implemntaion is done before BW inplemetation and therefore Operating concerns are already defined by the FI people.
Thanks
Message was edited by:
Ajeet Singh -
COPA : Accounting Based and Costing Based
Hello Guru's,
We are on ECC 6.0 and BI 7.3. Our customer is going to implement Accounting based COPA and Costing based COPA in ECC. We have a requirement to have both the Accounting based and Costing based COPA analysis available in BI.
My questions and concerns:
If we configure both type of COPA in ECC then Can we create both type of data sources also in ECC ? one for Accounting based COPA and one for Costing based copa ? If yes then do we need to have 2 infocubes in BI or one infocube with mapping of both the data source will work ? ... do please correct me or suggest me.
Regards,
Komik ShahHi Sridhar,
Thanks for your reply, can you explain if we want to stop one of the method, what is the steps that need to be done?
thanks again! -
Rule based & Cost based optimizer
Hi,
What is the difference Rule based & Cost based optimizer ?
ThanksWithout an optimizer, all SQL statements would simply do block-by-block, row-by-row table scans and table updates.
The optimizer attempts to find a faster way of accessing rows by looking at alternatives, such as indexes.
Joins add a level of complexity - the simplest join is "take an appropriate row in the first table, scan the second table for a match". However, deciding which is the first (or driving) table is also an optimization decision.
As technology improves a lot of different techiques for accessing the rows or joining that tables have been devised, each with it's own optimium data-size:performance:cost curve.
Rule-Based Optimizer:
The optimization process follows specific defined rules, and will always follow those rules. The rules are easily documented and cover things like 'when are indexes used', 'which table is the first to be used in a join' and so on. A number of the rules are based on the form of the SQL statement, such as order of table names in the FROM clause.
In the hands of an expert Oracle SQL tuner, the RBO is a wonderful tool - except that it does not support such advanced as query rewrite and bitmap indexes. In the hands of the typical developer, the RBO is a surefire recipie for slow SQL.
Cost-Based Optimizer:
The optimization process internally sets up multiple execution proposals and extrapolates the cost of each proposal using statistics and knowledge of the disk, CPU and memory usage of each of the propsals. It is not unusual for the optimizer to analyze hundred, or even thousands, of proposals - remember, something as simple as a different order of table names is a proposal. The proposal with the least cost is generally selected to be executed.
The CBO requires accurate statistics to make reasonable decisions.
Even with good statistics, the complexity of the SQL statement may cause the CBO to make a wrong decision, or ignore a specific proposal. To compensate for this, the developer may provide 'hints' or recommendations to the optimizer. (See the 10g SQL Reference manual for a list of hints.)
The CBO has been constantly improving with every release since it's inception in Oracle 7.0.12, but early missteps have given it a bad reputation. Even in Oracle8i and 9i Release 1, there were countless 'opportunities for improvement' <tm> As of Oracle 10g, the CBO is quite decent - sufficiently so that the RBO has been officially deprecated. -
Top Link Special Considerations in moving to Cost Based Optimizer....
Our current application architecture consists of running a Java based application with Oracle 9i as the database and toplink as the object relational mapping tool. This is a hosted application about 5 years old with stringent SLA requirements and high availability needs. We are currently using Rule Based Optimizer (RBO) mode and do not collect statistics for the schemas. We are planning a move to Cost Based Optimizer (CBO)
What are the special considerations we need to be aware of from moving RBO to CBO from top link perspective. Is top link code optimized for one mode over the other ?. What special parameter settings are needed ?. Any of your experience in moving Top Link based applications to RBO and best practices will be very much appreciated.
-Thanks
Ganesan MahaGanesan,
Over the 10 years we have been delivering TopLink I do not recall any issues with customizing TopLink for either approach. You do have the ability to customize how the SQL is generated and even replace the generated SQL with custom queries should you need to. This will not require application changes but simply modifications to the TopLink metadata.
As of 9.0.4 you can also provide hints in the TopLink query and expression framework that will be generated into the SQL to assist the optimizer.
Doug -
Cost Based Optimizer (CBO)
not sure if this is a daft question or what. but i am trying to find out where exactly it exists.
i know, when performing ST05 and viewing the execution plan, we see what the CBO has used, but is the CBO purely performed at the database server, and not at the SAP Application.
When updating the statistics, are these passed to the database server, and once again, the CBO utilizes them for the execution plan, or do the database statistics actually reside in the database server.
finally, in viewing the execution plan, the statement "execution costs = xxx" (xxx being a numeric value). what exactly is xxx. maybe an internal index used to compare execution plans, or maybe the number of blocks required to read the "estimated #rows".
anyone ??
thanks
glenHello Glen,
So far as my knowledge is concerned, the statistics are actually located on the database server. That is what appears to be more logical too. what is the use of maintaining the access paths on tha application server ? Most of the modern database servers are equipped with the CBO functionality. And Cost-Based-Optimizing is dependent on the database.
Here's what the documentation says:
<i>You can update statistics on the Oracle database using the Computing Center Management System (CCMS). The transactions to be used are DB20 and DB21.
By running update statistics regularly, you make sure that the database statistics are up-to-date, so improving database performance. The Oracle cost-based optimizer (CBO) uses the statistics to optimize access paths when retrieving data for queries. If the statistics are out-of-date, the CBO might generate inappropriate access paths (such as using the wrong index), resulting in poor performance.
From Release 4.0, the CBO is a standard part of the SAP System. If statistics are available for a table, the database system uses the cost-based optimizer. Otherwise, it uses the rule-based optimizer.</i>
Regards,
Anand Mandalika. -
SQL 문장이 RULE 에서 COST-BASED로 전환되는 경우
제품 : ORACLE SERVER
작성날짜 : 2004-05-28
SQL 문장이 RULE에서 COST-BASED로 전환되는 경우
==============================================
PURPOSE
SQL statement 문장이 자동으로 cost-based mode로 전환되는 경우에 대해
알아보자.
Explanation
Rule-based mode에서 sql statement를 실행하더라도 Optimizer에 의해
cost-based mode로 전환되는 경우가 있다.
이런 경우는 해당 SQL이 아래와 같은 경우로 사용되는 경우 가능하다.
- Partitioned tables
- Index-organized tables
- Reverse key indexes
- Function-based indexes
- SAMPLE clauses in a SELECT statement
- Parallel execution and parallel DML
- Star transformations
- Star joins
- Extensible optimizer
- Query rewrite (materialized views)
- Progress meter
- Hash joins
- Bitmap indexes
- Partition views (release 7.3)
- Hint (RULE 또는 DRIVING_SITE제외한 Hint가 왔을경우)
- FIRST_ROWS,ALL_ROWS Optimizer의 경우는 통계정보가 없어도 CBO로 동작
- TABLE 또는 INDEX에 Parallel degree가 설정되어 있거나,
INSTANCE가 설정되어 있는 경우(DEFAULT도 해당)
- Table에 domain index(Text index등) 이 생성되어 있는 경우 -
Settlement Rule based on FL cost center
Hi Guys,
My client wants CC to be maintained in the Functional location and they don't want to maintain in the Equipment.
Their Requirement is, when ever a person creates the Maintenance order for any equipments attached to the Functional location,Settlement rule should gets created automatically based on the CC maintained in the FL.
But in standard it creates automatically when CC is maintained in the Equipment.
How to handle this scenario.Is there is any Customer exit to handle this scenario?
Pl guide me
Regards
ISWARIDear Mr Thiyagarajan,
I really appreciate your immediate response for any threads.
Here they want to create order based on equipment(for analysis of cost through MO) and want settlement should be on the CC of FL.Hence they don't want to maintain CC in Equipment master and want to maintain CC in FL.
As you said ,If I maintain Cost center in FL and not maintain Cost Center in Equipment master,then while MO creation in location tab all data's were copied from equipment and CC field is empty.Hence while releasing the order,system asks for settlement rule.
How to make the system to copy the FL cost center to the location tab of order.Pl suggest if there is any exit/badi
Regards
ISWARI -
Adding HINTS produce a cost based plan ?
I have an SQL with Oracle Hints. If I do an explain plan report on this SQL, there is data under Rows, Bytes and Cost. If I remove the hints from the SQL, the explain plan has no data under rows, bytes, cost and a note: rule based optimization.
If I compute statistics on one of the tables used by the SQL, using ANALYSE TABLE as recommended, then I have a third explain plan, with data under rows, bytes and cost.
So how, in the absence of statistics, can Hints help produce a cost based plan ?When you provide hints in the SQL statments you typically are controlling the execution path and the nature of join that SQL statment is choosing. This can give you good results or can slow down performance of your query as the time passes and database is subjected to changes.
If on the other hand you choose COST based optimization and collect statistics as recommended by Oracle then you make optimizer think instead of your self which yealds competative performance when you let optimizer engine decide the execution plan. So If i where you would think of performing following tasks.
1)Collect the statistics for all the tables and indexes refrenced in the SQL statment.
2)Set the optimizer goal to choose.
3) Vary the optimizer sampling size while collecting the statistics using ANALYZE command. In the past I have noticed that optimizer behavior will change as per the sampling so you might have to adjest your stats while using ANALYZE command to fine tune the behavior of SQL statment.
4)This should improve performance of your query. -
I have the following Select Statement:
SELECT FGBTRND_SUBMISSION_NUMBER, FGBTRND_TRANS_AMT, FGBTRND_COAS_CODE, FGBTRND_FUND_CODE, FGBTRND_ORGN_CODE,
FGBTRND_ACCT_CODE, FGBTRND_PROG_CODE, FGBTRND_ACTV_CODE, FGBTRND_LOCN_CODE, FGBTRND_RUCL_CODE
FROM FGBTRND
WHERE FGBTRND_DOC_CODE = 'F0022513'
AND FGBTRND_RUCL_CODE IN ( SELECT FGBTRNH_RUCL_CODE FROM FGBTRNH
WHERE FGBTRNH_DOC_CODE = 'F0022513' )
AND FGBTRND_LEDGER_IND='O'
AND FGBTRND_FIELD_CODE='03' --:B4 01 02 03
AND DECODE('Y','Y',BWFKPROC.F_SECURITY_FOR_WEB_FNC(FGBTRND_COAS_CODE, FGBTRND_FUND_CODE, FGBTRND_ORGN_CODE, 'PBEED'),'Y' ) = 'Y'
AND ((FGBTRND_SUBMISSION_NUMBER IS NULL AND '0' IS NULL) OR (FGBTRND_SUBMISSION_NUMBER='0' ))
This statement is ok without the following:
AND DECODE('Y','Y',BWFKPROC.F_SECURITY_FOR_WEB_FNC(FGBTRND_COAS_CODE, FGBTRND_FUND_CODE, FGBTRND_ORGN_CODE, 'PBEED'),'Y' ) = 'Y'
The call is to a security package which has to evaluate to Y inorder for the user to see the result. This statement in total would work fine provided the decode in the where clause is called last. However, the cost based optimizer is determining that it needs to evaluate this first.
Question is:
How do I get the cost based optimizer to evaluate the decode last and not first?
I am on 10.2.0.3
Patrick Churchilluser3390467 wrote:
" Consider setting your optimizer_index_caching parameter to assist the cost-based optimizer. Set the value of optimizer_index_caching to the average percentage of index segments in the data buffer at any time, which you can estimate from the v$bh view.
Can someone give me the query to use to estimate from v$bh view mentioned above?
What are other considerations for setting this parameter for optimizationThis post, and the flood of your other posts, appear to be quoting sections of a Statspack Analyzer report. Why are you posting this material here?
If you want to set the optimizer_index_caching initialization parameter, first determine the purpose of the parameter. Next, determine if the current value of the parameter is causing performance problems. Next, determine if there are any unwanted side-effects. Finally, test the changed parameter, possibly at the session level or through an OPT_PARAM hint in affected queries.
Here is a link to the starting point. http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/initparams159.htm
Blindly changing parameters in response to vague advice is likely to lead to problems.
Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc. -
Differance between the Cost based costing and Account based costing
Hi,
What is the Differance between the Cost Based Costing and Account Based Costing ?You can check sap note 69384
COSTING-BASED PROFITABILITY ACCOUNT-BASED PROFITABILITY
ANALYSIS ANALYSIS
OBJECTIVE
o profitability and sales accounting
o evaluation of market segments (for example,
customers, product groups, sales areas) and corporate
units (for example, division, sales organization) with
regard to their profit or contribution margins
o calculation of profits procedures
- cost-of-sales accounting
- interim and reconciled sales report
- periodic and transaction-based allocation
- Profitability Analysis on the basis of full and
direct costs
o posted and costing-based values o account-based values
o can be reconciled with FI for o always reconciled with
account groups (revenues, sales FI on account level
deductions, costs of goods
Note 69384 - Information: Account-based Profitability Analysis
manufactured, and so on)
DATA STRUCTURES
o definition of operating concerns o definition of operating
with fixed characteristics and concerns with fixed and useruser-
defined characteristics defined characteristics
and value fields
o cumulative storage by posting o cumulative storage by
periods and weeks posting periods
o storage in operating concern o controlling area currency,
currency (as of Release 4.0 also company code currency
optional in company code currency and transaction currency
if req.)
o user-definable summarization levels
FUNCTIONS
o transfer of profit relevant o transfer of profit-relevant
business transactions from SD, FI activities from SD, FI, CO, MM
CO, MM (revenues, sales deductions (revenues, sales deductions and
and costs organized by value fields) costs organized by accounts)
o Derivation of characteristics from master
data or using derivation rules
o Realignments also for data that is already
posted
o Valuation
(Costs of goods manufactured, imputed
costs and sales deductions)
o sales and profit planning o profit planning
- flexible layout - flexible layout
- periodic distribution - periodic distribution
- valuation, revaluation - forecast procedure
- forecast procedure - top-down distribution
- top-down distribution - simulation
- simulation
o profit analysis by means of 'interactive drill-down
reporting'
- Report Painter
- object list/ranking lists, database schema
- drill-down
- key figure systems
- flexible hierarchies
- navigation between reports
- exception reporting
- ABC analyses
- Exporting (Excel, Winword, Mail)
Maybe you are looking for
-
Error SAPMF05A 0700 E - while clearing document in F.13
Hi All, While running the automatic clearing through t.code F.13. Getting the following error. ScName Scr. Mtyp Mid Mno Message text SAPMF05A 0131 S F5 074 4 items were selected SAPMF05A 0700 E /DS 310 Please Enter Valid Trading P
-
my iphone 4 will no longer connect to my Itunes since 7.1.1 update, itunes has latest update as well followed help which involved using mobile device properties no good re installed itunes still same problem iphone is showing up on pc as connected bu
-
HP Z400 Workstation Power Supply not Supported
Good Day All, I would like to seek help on the issue that i am currently facing. Currently, I am using an HP Z400 Workstation and decided to switch to a bigger casing. I Bought a Full tower and casing and just realized that i am unable to move the po
-
Blue banner bar not loading web pages
I'm having or have had for some time a problem with pages fully loading on Safari 3.2.1. Even now as I write this the blue banner bar only loads to about 75% and stops. Other times is less than 50%. I have 12.1 GB out of 40.0 GB free on my iBook. I r
-
Tutorial on file upload/downloads questions
Hi Everyone. Can you tell me how to clear a field such as the :p2_file_name field? I was thinking you could use :p2_file_name := '' like we do in Oracle Forms but that did not work. I put that code into a pl/sql process. The intent was to clear the f