10.2.0.4 CBO behavior without histograms and binds/literals

Hello,
i have a question about the CBO and the collected statistic values LOW_VALUE and HIGH_VALUE. I have seen the following on an oracle 10.2.0.4 database.
The CBO decides for a different execution plan, if we use bind variables (without bind peeking) or literals - no histograms exist on the table columns.
Unfortunately i didn't export the statistics to reproduce this behaviour on my test database, but it was "something" like this.
Environment:
- Oracle 10g 10.2.0.4
- Bind peeking disabled (_optim_peek_user_binds=FALSE)
- No histograms
- No partitioned table/indexes
The table (TAB) has 2 indexes on it:
- One index (INDEX A1) has included the date (which was a NUMBER column) and the values in this columns spread from 0 (LOW_VALUE) up to 99991231000000 (HIGH_VALUE).
- One index (INDEX A2) has included the article number which was very selective (distinct keys nearly the same as num rows)
Now the query looks something like this:
SELECT * FROM TAB WHERE DATE BETWEEN :DATE1 AND :DATE2 AND ARTICLENR = :ARTNR;And the CBO calculated, that best execution plan would be a index range scan on both indexes and perform a btree-to-bitmap conversion .. compare the returned row-ids of both indexes and then access the table TAB with that.
What the CBO didn't know (because of the disabled bind peeking) was, that the user has entered DATE1 (=0) and DATE2 (=99991231000000) .. so the index access on index A1 doesn't make any sense.
Now i executed the query with literals just for the DATE .. so query looks something like this:
SELECT * FROM TAB WHERE DATE BETWEEN 0 AND 99991231000000 AND ARTICLENR = :ARTNR;And then the CBO did the right thing ... just access index A2 which was very selective and then acceesed the table TAB by ROWID.
The query was much faster (factor 4 to 5) and the user was happy.
As i already mentioned, that there were no historgrams i was very amazed, that the execution plan changed because of using literals.
Does anybody know in which cases the CBO includes the values in LOW_VALUE and HIGH_VALUE in its execution plan calcuation?
Until now i thought that these values will only be used in case of histograms.
Thanks and Regards

oraS wrote:
As i already mentioned, that there were no historgrams i was very amazed, that the execution plan changed because of using literals.
Does anybody know in which cases the CBO includes the values in LOW_VALUE and HIGH_VALUE in its execution plan calcuation?
Until now i thought that these values will only be used in case of histograms.I don't have any references in front of me to confirm but my estimation is that the LOW_VALUE and HIGH_VALUE are used whenever there is a range based predicate, be it, the BETWEEN or any one of the <, >, <=, >= operators. Generally speaking the selectivity formula is the range defined in the query over the HIGH_VALUE/LOW_VALUE range. There are some specific variations of this due to including the boundaries (<= vs <) and NULL values. This make sense to use when the literal values are known or the binds are being peaked at.
However, when bind peaking is disabled Oracle has no way to use the general formula above for an estimation of the rows so it mostly likely uses the 5% rule. Since in your query you have a BETWEEN clause the estimated selectivity becomes 5%*5% which equals 0.0025. This estimated cardinality could be what made the CBO decide to use the index path versus ignoring it completely.
If you can post some sample data to reproduce this test case we can confirm.
Just a follow-up question. Why is a date being stored as a number?
HTH!

Similar Messages

  • Gathering statistics without Histogram

    DB version:10gR2
    Metalink's workaround for a ORA-600 bug is : gather stats without Histograms.
    In 10GR2 how can i gather stats for a table without Histograms getting created. I know this can be done using the Input parameter METHOD_OPT in dbms_stats.gather_table_stats procedure. But i don't know how?

    Like this :
    exec dbms_stats.gather_table_stats(user,tabname=>'MYTABLE',method_opt=>'FOR ALL COLUMNS SIZE 1',estimate_percent=>100,cascade=>TRUE);
    (I've added estimate_percent and cascade as well)
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • Behaviors without helper functions

    Hi all, I'm trying to create a behavior that doesn't require
    a behavior
    function, is this possible using the behaviors API?
    Dreamweaver requires a behaviorFunction() function in
    behaviors, and
    returnig an empty string results in a message "The Action
    will not be
    applied".
    Is it possible to insert behaviors without a
    behaviorfunction?
    Sure I can create proxy functions that in turn call the
    actual command (eg
    alert()) but this seems a lot of overhead to put into the
    document.
    Joris

    "E Michael Brandt" <[email protected]> wrote
    in message
    news:fb3rqv$qv3$[email protected]..
    >
    > If you read the Extension help you'll see that certain
    functions are
    > indeed required by each type of Extension, whether
    Behavior, Command, or
    > Object. And certain methods are disallowed by each type
    as well.
    >
    Yes i have the manual in front of me, i'm building a behavior
    to call
    commands in the AIR runtime, the air object is just available
    in the
    document when the AIRAliases.js is included, it doesn't need
    a "helper"
    function.
    So what i'm doing now is inserting a proxy function to call
    the original
    function, return the name of the proxy function from
    behaviorFunction and
    wrap the call, that just seems like a lot of overhead.
    Joris
    function AIR_exec(cmdName) { //v1.0
    if(typeof air != 'Object'){
    alert('ERROR: AIR object not loaded, please include
    AIRAliases.js');
    } else {
    var cmd = 'air.'+cmdName+'(';
    for(var i=1; i<arguments.length; i++){
    cmd += (i==1) ? arguments
    : ','+arguments;
    cmd += ')'
    eval(cmd);
    //Return the name of the function that we want to be inserted
    into the
    user's document.
    function behaviorFunction(){
    return "AIR_exec";
    //Returns the actual function call string that will be
    inserted into the
    event handler
    function applyBehavior() {
    addAIRAliases();
    return
    "AIR_exec('trace',"+document.theForm.traceMessage.value+")";

  • Documentation for abstract classes (Behavior and Binding) ?

    Hi,
    I am looking at the beautiful sample-app made by Jasper Potts at the www.fxexperience.com. ("Javafx 2.0 Audio Player")
    There some abstract classes are used, for Behavior and Binding.
    It turns out that I have difficulties finding documentation for those classes. The classes are:
    com.sun.javafx.scene.control.behavior.BehaviorBase;
    com.sun.javafx.scene.control.behavior.KeyBinding;
    Could anybody give me hint, pls, where I could find documentation for those classes.
    They are all in the JavaFx-Runtime-Jar-file, together with all the Javafx-classes.
    The Javafx-classes are pretty well documented in the meantime.
    But, allthough in the same "package", the com.sun... classes are still black boxes to me.
    Appreciate a link from somebody who knows, pls.
    Hans

    Hi Hans,
    the classes in the com.sun.* packages are internal classes, in other words they are meant to be black boxes for you. :-)
    A developer should not use these classes, because they can change anytime without warning, even between minor releases. But a developer should also not need to use the internal classes. If Jasper needed them in the demo, it is a clear indicator that something is missing in the public API.
    The classes seem to be part of the UI controls, which were already open-sourced. If you just want to play with the classes, you can study the sources. As a long term solution, I suggest to add a feature request in JIRA for the parts you are missing in the public API (http://javafx-jira.kenai.com).

  • Really odd behavior on startup and power supply

    Hi there,
    I am using MAC book pro and have X v.10.6 Snow Leopard installed couple months ago. One day several weeks ago, there was a long single beeping while I was surfing the internet and the system shut down by itself. After that, there is no way to boot the system up again. I tried to take the battery down and only have the magsafe connected to the machine, still no good to boot up the system. I tried everything I can do: reset SMC and NVRAM, change magsafe. Still no good. Last week, don't know why, I succeed in booting the system with the battery connected but it shown that the battery was in very low power. After that, the system never boot up again. I put the battery back and try to charge it via magsafe, no good, flashing alternatively with green and orange lights. I left the machine alone with magsafe and battery on for two days. Today, I tried to power on the machine, the familiar sound comes again, and the battery seems fully charged (I check by another MAC). However, there is a progress bar appears on the grey boot screen, after it has been fully filled, the spinning wheel seem runs forever and the system doesn't really boot up and no login box shown. Since my machine have both Mac OS X and windows 7 installed with bootcamp. I pushed down the power button and ALT to load the windows 7, no problem at all. But when I come back to MAC OS, same problem appears again. The system's startup process takes forever to finish. So
    1) What's going on with the power supply? Since the problem lasting for too long, I assumed the logic broad must be damaged and I am ready to change a new one. But why it suddenly heals itself? And how come the battery fully charged? Weird!
    2) How to solve the problem of 'forever loading' on startup?
    I tried to boot from DVD by holding ALT and select DVD ROM on starting. The system shut down automatically after the DVD began to be loaded. And after that, I also tried to boot the system without DVD and the system automatically shut down in 10minutes.

    Hi, Kurt. What you're seeing with the ringlight on the adapter is normal behavior for an adapter connected to a noisy or "dirty" AC power line. It's not an adapter fault, and is nothing to worry about except that it may impact other devices, such as your iPod, that are connected and drawing bus power when the adapter shuts down. See item 2 in this article for a brief explanation and suggested remedy:
    http://docs.info.apple.com/article.html?artnum=302461
    This is off the main subject, but since you mentioned it, I'm very interested to hear that your iPod Touch works normally when connected to your IOGear USB 2.0 card. Does the card draw bus power from one of your built-in USB 1.1 ports or from its own AC adapter, or is it supplying sufficient power all on its own to run the iPod?
    Many people have posted here about troubles getting USB 2.0 devices, and iPods in particular, to work when connected to USB 2 cards in Tibooks. It seems that many such devices need more power than these cards can supply without auxiliary power. If the IOGear card can somehow pass along more power than others (which seems unlikely), or if the the iPod Touch doesn't need as much power as other iPod models (which also seems unlikely), those would be useful things to know.
    Message was edited by: eww

  • Why isn't my iTunes store loading properly? It lists everything in text without images, and I can't seem to access the store when I try to search for music or movies etc.

    Why isn't my iTunes store loading properly? It lists everything in text without images, and I can't seem to access the store when I try to search for music or movies etc.

    1) The best way to relocate the iTunes library folder is to move the entire iTunes folder with all subfolders to the new path, then press and hold down shift as start iTunes and keep holding until prompted to choose a library, then browse to the relocated folder and open the file iTunes Library.itl inside it.
    If you've done something different then provide some more details about what is where and I should be able to help.
    2) Purchases on the device should automatically transfer to a Purchased on <DeviceName> playlist, but it my depend a bit on whether automatic iCloud downloads are enabled. If there is a cloudy link then the transfer might not happen. You can use File > Devices > Transfer Purchases. In iTunes you should also check out iTunes Store > Quick Links > Purchased > Music > Not on this computer.
    3) Backup the device, then immediately restore it. In some cases you need to add a restore as new device into that equation. Obbviously not to be attempted until you're sure all your media is in your library. See Recover your iTunes library from your iPod or iOS device should it be needed.
    4) I believe there is complimentary 1 incident 90-day support with hardware purchases, but no free software support for iTunes itself. AppleCare gets you a different level of support.
    tt2

  • How can I open a url in oracle form 9i without toolbar and menubar

    I want to create a button in my form. When I click on the button it should open url without toolbar and menubar.
    I tried with web.show_document. but I am not able to remove the toolbar and menubar. plus not able to specify width and height. Any way to achieve this.
    Thanks,
    Mansoor

    Dear Frank,
    I have done as follows
    created a form with a button, and in my button pressed event I wrote
    WEB.SHOW_DOCUMENT('javascript:openMyURL("http://192.168.1.34/HELP/ADMF0005.html");', '_Self');
    and in my formsweb.cfg I have the following
    HTMLbeforeForm=<script> function OpenMyURL(page){window.open(page,"myURL","width=700,width=400,top=0,left=0,toolbar=no,menubar=no"); } </script>
    When I click on the button it is coming with toolbar , etc as well as no page found is coming with the following in the address bar.
    javascript:openMyURL("http://192.168.1.34/HELP/ADMF0005.html");
    My html view source comes as below for the form
    <HEAD><TITLE>Oracle9iAS Forms Services</TITLE></HEAD>
    <BODY >
    <script> function OpenMyURL(page){window.open(page,"myURL","width=700,width=400,top=0,left=0,toolbar=no,menubar=no"); } </script>
    <!-- Forms applet definition (start) -->
    <OBJECT classid="clsid:CAFECAFE-0013-0001-0009-ABCDEFABCDEF"
    codebase="/forms90/jinitiator/jinit.exe#Version=1,3,1,9"
    WIDTH="1000"
    HEIGHT="660"
    HSPACE="0"
    VSPACE="0">
    <PARAM NAME="TYPE" VALUE="application/x-jinit-applet;version=1.3.1.9">
    <PARAM NAME="CODEBASE" VALUE="/forms90/java">
    <PARAM NAME="CODE" VALUE="oracle.forms.engine.Main" >
    I am using Forms [32 Bit] Version 9.0.2.7.0

  • Production Order for a material without BOM and Routing

    Is it possible to create a production order for a given material without routing and BOM, I know we can
    create a production order for a material without a BOM (with a default routing) just wanted to check with
    the above criteria
    Thanks in Advance!!

    Members:
    Thank you for your valuable replies and time
    Santosh:
    Tried what you have mentioned, but system still picks up a default routing
    Kaushik:
    Maintained Default values in OPJG for the given order type, but system still picks up
    default routing
    Mangalraj:
    have no issue in creating a production order without a BOM, but I am trying to see
    is there a way where I can create a production order without a BOM and routing (not
    even default operation )
    Any suggestions on how to create a production order for a material without a BOM
    and routing (not even default one )

  • I have a ipod touch, an i pad and a iphone can i use my same apple id without texts and apps showing up on every device

    i have an ipod touch, an ipad and an i phone, can i use the same apple id without texts and apps showing up on every device. 

    Yes. Go to your iCloud settings on each device and configure what you do and do not want showing up on each device.
    Go to Settings>iCloud as well as Settings>iTunes & App Stores

  • Is there a way to move files from one folder to another without copying and pasting and then going back to delete the original?

    Is there a way to move files from one folder to another without copying and pasting and then going back to delete the original?  The cut and paste function is not available and there's no "move to" function.  Am I missing something?  It was so easy with Windows.

    Drag the files, or press Option when pasting them; this accesses the Move To function.
    (124070)

  • How do I print all responses as pdf without selecting and printing just one response at a time?

    How do I print all responses as pdf forms without selecting and printing just one response at a time?

    Sorry this is not supported at this time. You can only download the responses as PDF one at a time.
    You can export the response table and print the whole table but if you want to print each response individually you have to do it manually. Sorry.
    Gen

  • What is the procedure for a hard boot of my iPod touch 4th generation without itunes, and without computer, and without iPod data screen.?

    What is the procedure for a hard boot of my iPod touch 4th generation
    without iTunes, and without computer, and without iPod data screen?
    6 months after purchase I updated my iPod touch as recommend by iTunes.
    It has not worked since that day.  It frozen (disabled) with a "connect to
    iTunes" icon displayed...that is the only thing it does.  itunes does not
    recognize the iPod.  My Windows7 computer recognizes an Apple device. 
    Other computers recognize the devise but if iTunes resided on that
    computer it did not recognize the iPod
    I suffered a setback with deep depression and am just now getting out of it enough to do something.  The depression prohibited me from taking action.
    I have done every procedure recommended from Apple help and external
    sources.  I did this thoroughly with help for other owners and IT experts,
    Apple employees etc etc.  I and associates have perform reboots utilizing a
    number procedure using only button on the iPod.  These were unsuccessful
    also have performed.
    Please do not ask me to do the usual.
    Online I saw  a process using the buttons on the iPod to completely
    reformat 
    the iPod.  It was NOT the hold buttons for 10 sec let go of one wait 8 sec
    etc.  I can not find the process now...a friend showed it to me in passing
    I have lost contact with him.  This is the procedure, I believe, that with
    enable me to update and use the iPod. 

    You need an internet connection and likely a computer with iTunes but an iPhone, iPad or iPod touch with the FindMy iPhone App may work by:
    If you previously turned on FIndMyiPod on the iPod in Settings>iCloud and wifi is on and connected go to iCloud: Find My iPhone, sign in and go to FIndMyiPhone and use Remote Wipe to erase the contents of your device. If you have been using iCloud to back up, you may be able to restore the most recent backup to reset the passcode after the device has been erased.
    You can also wipe the iOS device by installing the FindMyiPhone app on another iOS device and using that app to wipe the device.
    Otherwise
    Disabled
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Forgot passcode or device disabled
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:                                                             
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: Back up and restore your iOS device with iCloud or iTunes       
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:           
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        
    If problem what happens or does not happen and when in the instructions? When you successfully get the iPod in recovery mode and connect to computer iTunes should say it found an iPod in recovery mode.
    Yo may have to go to an Apple store or a friend's house with an internet connection and iTunes.

  • ROS (without SUS) and EBP in same client-Transferred BP status?

    Friends,
    We are working on SRM 7.
    The ROS (without SUS) and EBP are implemented on the same SRM client.
    In supplier registration process, when the accepted business partner is transferred from ROS to EBP, a supplier is correctly created in EBP client with the same business partner number, but the status of the transferred business partner is not updated from 'ACCEPTED' to 'RELEASED', hence there is risk that user can transfer the business partner again.
    As per OSS note 857386, the status released is set automatically by the system when an accepted supplier has been distributed. Also the status is valid only for DISTRIBUTED suppliers, that is, ONLY for suppliers TRANSFERED through OPI.
    I understand, if ROS (without SUS) and EBP are deployed on separate clients in same server then when the accepted business partner is transferred from ROS to EBP, system triggers an XI message to update the ROS business partner status to 'RELEASED'. Is my understanding right?
    How do we update the transferred business partner status to RELEASED when ROS and EBP are on same client?
    Regards,
    Sandeep Parab
    Edited by: Sandeep Meghashyam Parab on Apr 9, 2010 11:43 AM

    Hi Sandeep,
    I too have a requirement to implement ROS without SUS in SRM 7.0 PPS.  Can you send the config guide or steps to follow both in the ROS side and in the SRM Side.  Your kind help will be rewarded and highly appreciated.
    with regards,
    Freemind

  • Bitlocker without TPM and USB

    Hello Team,
    I am working for a company which has  Windows Server 2012 R2 domain server and mixture of Windows 7 and Windows 8 client computers.
    The problem is, I need to configure bit-locker in all client machine, but some machine doesn't have TPM. I found a way to configure bit-locker without TPM, but it requires USB(key within it) at every startup.
    So I want to configure Bit-locker in all client machine without TPM and USB, but with PIN. And all bit-locker recovery keys should be backed up to Active directory.
    Please let me know the steps to configure this rather than HTTP links.
    Thanks in Advance.
    Have a great day ahead and make a great day for me.

    Hi.
    Having a PIN is only possible in combination with a TPM, but having a password alone is possible since windows 8.

  • HT201303 How can I find out what my security answers are? I am trying to purchase an app on a new device and it won't let me without answering and I have totally forgotten

    How can I find out what my security answers are? I am trying to purchase an app on a new device and it won't let me without answering and I have totally forgotten

    Welcome to the Apple Community.
    You might try to see if you can change your security questions. Start here, change your country if necessary and go to manage your account > Password and Security.
    I'm able to do this, others say they need to input answers to their current security questions in order to make changes, I'm inclined to think its worth a try, you don't have anything to lose.

Maybe you are looking for