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 Maha

Ganesan,
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

Similar Messages

  • Rule based & Cost based optimizer

    Hi,
    What is the difference Rule based & Cost based optimizer ?
    Thanks

    Without 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.

  • 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
    glen

    Hello 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.

  • 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.

  • Cost Based Optimizer Statistics

    Hi,
    I just wanted to check on how to do this activity............
    In my production system in R3........on HPUX 11.23 and Oracle DB 9i and ECC 5.0....
    When I go to DB02.......Checks.......Date of Table Analysis......The output shows as below
      Date of last analysis           SAPDAT         SYSTEM        others
    never analyzed                        0            129            195
    older one year                        0              0         40,871
    31 - 365 days                         0              0            782
    8 -  30 days                         0              0          2,942
    0 -   7 days                         0              0            337
      Total                               0            129         45,127
    How do I go about do the analysis for all the files so that there is an up-to-date status....
    Thanks in advance.
    Alfred

    You can force a creation of new statistics by using the "-f collect" force option:
    brconnect -u / -c -f stats- t all -f collect
    Nevertheless I usually would not recommend this because you can expect a high runtime of the statistics creation and "old" statistics are not "bad" statistics. Instead it is normal that statistics of static tables are months or years old. See note 825653 (7) for more information.
    Regards
    Martin

  • How to use Cost Based Optimizer

    Hi,
    I'm looking for a documentation about CBO, I found some information through google and here but anyone knows where I can found more informaton about CBO, how to use, how i'ts increase the performance and more?
    Thank You

    See Oracle® Database Performance Tuning Guide

  • Cost Based Opt Question

    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 Churchill

    user3390467 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.

  • 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,
    A

    I 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.

  • 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.

  • Performance of Top Link with clustering

    Hi,
    We are planning to use Top Link with a J2EE app that will reside on Oracle 9i app server. We are also planning to use clustering of app server. So we will need to configure Top Link ServerSessions accordingly (isnt it?).
    Do you think the performance of TopLink will be reduced badly if used in this fashion, since the server sessions have to talk to each other continuously !
    Thanks,
    Krishna

    Krishna,
    The Cache-Sync feature of TopLink is an excellent way to minimize stale data. The messaging and change-set propagation does not come without a cost though. Typically we try to recommend this for customers with a high percentage of reads. In these cases it is more beneficial to keep the cache and avoid trips to the database.
    There is no magic formula for when to use cache-sync. The messaging cost/efficiency is dependent on the mechanism (point to point over RMI/CORBA/IIOP or JMS), the size of the change sets or complexity of transaction, number of servers in the cluster, etc.
    What is important to understand though is that cache-sync is just one way to minimize stale cache. It does not ensure you won't have stale data. For this you must configure a locking strategy and adjust your cache relative to the expected life-span you need on cached objects.
    For a system like your I would recommend starting out without cache-sync. Use optimistic locking on all classes and use a weak cache for all classes that have a high occurrence of writes. For the rest I would recommend a Full cache on static/reference data and a soft-weak cache on those that fall in between. The size of the soft-weak cache will determine the number of objects potentially held (LRU) beyond their use.
    With these settings you should be able to monitor and account for changes made to stale objects through OptimisticLockExceptions. If you find specific use-cases that are prone to failure you could force the refresh on the query at the start of the UnitOfWork (TX).
    This approach will give you a system that ensures data integrity. Then you can experiment with scaling to multiple servers with or without cache-sync and monitor the load vs failures for your test environment.
    I hope this helps,
    Doug

  • Custom Styled Top Link Bar Sharepoint Foundation 2013

    I want to be able to style the top link bar with some custom CSS but I am unable to find any guides that walk me through the process. I could use a step by step guide. I have sharepoint designer and I know how to open the master page for editing. I've
    tried to link an external CSS page but I still am not quite getting the results I want. I only get part of the CSS to apply. Please help

    Hi,
    Please check the following article about how to style the top navigation with custom css.
    http://msdn.microsoft.com/en-us/library/office/dn205275(v=office.15).aspx
    Here is a good article  for branding top navigation in SP 2013 ,by explaining  the top navigation related style elements :
    http://sharepoint.rackspace.com/branding-top-navigation-in-sharepoint-2013
    Regards,
    If a post answers your question, please click Mark
    As Answer on that post and Vote
    as Helpful
    subhash reddy

  • SharePoint 2013 Foundation Top Link Bar wrong selected page when no navigation match

    Hello,
    I've got the following issue.
    At one of my clients we are working on a public web site based on SharePoint 2013 Foundation (yes I know... Foundation...). I've branded the Top Nav Bar and ran into a problem.
    When I navigate to one of the pages in the Top Link Bar the selected item is marked as "Selected", great! But when I navigate to one of the pages that is not added in the Top Link Bar the first item is marked as "Selected", not so great.
    For example when I navigate to /Pages/About.aspx the first item /Pages/Home.aspx is selected.
    Can you help me out?

    Hi,
    Could you give me more detailed information about this issue?
    Could you give me a Screenshot about this issue?
    In addition, there is an articles about customizing the top link bar, please have a look at:
    http://msdn.microsoft.com/en-us/library/office/gg252669(v=office.14).aspx
    http://msdn.microsoft.com/en-us/library/office/gg277254(v=office.14).aspx
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Back-to-Top Link in BW Report in Portal

    Hi,
    I'm trying to determine the best way to insert a back-to-top link in a BW Report. The Reports are displayed in the Portal as an iView or External Service depending on other factors.
    Portal is EP5 SP5, BW 3.0B and using the Web Application Designer to create the Portal Report.
    Would like a link at the bottom of the report which takes the user back to the top. Similar to what is seen on most pages. Using simple Bookmark and link does not seem to work.
    Thanks
    Paul

    Hi Paul,
    Have you tried the simple:
    <a name="top"></a>
    <a href="#top">Back to Top</a>

  • Open Link in New Window Option Not Working in Top Link Bar

    Hello,
    We have a 'Popular Links' section in our Top Link Bar for our intranet site that contains a list of frequently used links. Since most of these links navigate to sites outside of SharePoint, we would like these to open in a new tab or window when clicked. 
    I've enabled the 'Open Link in New Window' option under Site Navigation Settings for each link, however when a user clicks the links that have had this option enabled the content is still loaded in the current tab.
    Is this the correct set of steps to enable this content, or is there a better way to accomplish this that actually works?
    **SharePoint Server Publishing Infrastructure has been activated.

    You can try deactivating Minimal Download Strategy feature present under "Manage Site Features"....

  • Why Using Top Link is best in DB Adapter?

    Hi All,
    Can any one suggest , Why Using Top Link (Build-in Insert, Select etc. operation) is best in DB Adapter over using custom query?
    Thanks

    Hi Vikky,
    for insert/select it depends on what kind of user you are. TopLink lets you browse and click on a tables and have everything generated for you. If you are more a DBA or show me the SQL type then you can just type SQL directly.
    Some advantages of TopLink would be:
    -The range of SQL generated by TopLink is limited, but if you hard code complex SQL into your service you need to maintain it.
    -TopLink can generate at runtime the correct SQL for a given database, making switching from say DB2 to Oracle easy.
    -The merge operation will compare the input XML to the columns on the database and update only what has changed. It can also do a sparse merge. If only 4 columns in the XML were set, only those 4 columns in the database will be updated.
    -For inbound polling the strategy used (LogicalDelete, Sequencing Table, etc) is a configuration property and then at runtime multiple SQL statements are generated. The SQL also takes advantage of advanced syntax like the Oracle-only FOR UPDATE SKIP LOCKED, writing it all yourself may be tedious and error prone.
    -The main benefit of TopLink is when you go beyond thinking about a single table. If you import multiple related tables at once, TopLink will generate the SQL to select from and maintain multiple tables, establish a commit order, and generate a hierarchical XSD. With custom SQL the matching XSD is always flat. I.e. if you just need to insert an emp you could get away with custom SQL. If you need to insert a dept and emps, I would use TopLink.
    -This is also when the intermediary abstraction of an object/table makes more sense, as you only need to import a complex relational schema once, then generate inserts, selects, etc.
    So I hope that helps. They are each equally viable and can do something that the other can't. Where you see an overlap I would go with personal preference.
    Thanks
    Steve

Maybe you are looking for