Selectivity of the behavior of the CBO.

Hi all

This issue has been raised several times, but has found no reason on why optimizer chooses bad index.

I would like to know on what basis optimizer thought or why the optimizer thought that bad index would be useful? Can be real mathematical approach will be useful...

Imprecise plan:
SQL> SELECT ERROR,TIME_STAMP,O_RESOURCE,QUEUE,NEW_QUEUE FROM AMRWF1.LOG WHERE ID = '09306AMR117E19B' AND TYPE IN (11, 28, 25, 18, 60, 13) AND (LOG_SEQ>'238565731' OR TYPE =18 AND LOG_SEQ='238565731') ORDER BY TIME_STAMP ASC
  2  /

Execution Plan
----------------------------------------------------------
   0      SELECT STATEMENT Optimizer=CHOOSE (Cost=11 Card=2 Bytes=130)
   1    0   SORT (ORDER BY) (Cost=11 Card=2 Bytes=130)
   2    1     CONCATENATION
   3    2       TABLE ACCESS (BY INDEX ROWID) OF 'LOG' (Cost=4 Card=1
          Bytes=65)

   4    3         INDEX (UNIQUE SCAN) OF 'PK_LOG_LOG_SEQ' (UNIQUE) (Co
          st=3 Card=1)

   5    2       TABLE ACCESS (BY INDEX ROWID) OF 'LOG' (Cost=4 Card=1
          Bytes=65)

   6    5         INDEX (RANGE SCAN) OF 'PK_LOG_LOG_SEQ' (UNIQUE) (Cos
          t=3 Card=1)
Specific plan:
SQL> set autotrace traceonly exp
SQL> SELECT /*+ index(log log_id) */ ERROR,TIME_STAMP,O_RESOURCE,QUEUE,NEW_QUEUE FROM AMRWF1.LOG WHERE ID = '09306AMR117E19B' AND TYPE IN (11, 28, 25, 18, 60, 13) AND (LOG_SEQ>'238565731' OR TYPE =18 AND LOG_SEQ='238565731') ORDER BY TIME_STAMP ASC
  2  /

Execution Plan
----------------------------------------------------------
   0      SELECT STATEMENT Optimizer=CHOOSE (Cost=1522 Card=1 Bytes=65
          )

   1    0   SORT (ORDER BY) (Cost=1522 Card=1 Bytes=65)
   2    1     TABLE ACCESS (BY INDEX ROWID) OF 'LOG' (Cost=1518 Card=1
           Bytes=65)

   3    2       INDEX (RANGE SCAN) OF 'LOG_ID' (NON-UNIQUE) (Cost=27 C
          ard=1)
Sometimes we get specific plan without reference:
SQL> set autotrace traceonly exp
SQL> SELECT ERROR,TIME_STAMP,O_RESOURCE,QUEUE,NEW_QUEUE FROM AMRWF1.LOG WHERE ID = '09303AMR6349C60' AND TYPE IN (11, 28, 25, 18, 60, 13) AND (LOG_SEQ>'232414396' OR TYPE =18 AND LOG_SEQ='232414396') ORDER BY TIME_STAMP ASC
  2  /

Execution Plan
----------------------------------------------------------
   0      SELECT STATEMENT Optimizer=CHOOSE (Cost=1524 Card=287 Bytes=
          18655)

   1    0   SORT (ORDER BY) (Cost=1524 Card=287 Bytes=18655)
   2    1     TABLE ACCESS (BY INDEX ROWID) OF 'LOG' (Cost=1518 Card=2
          87 Bytes=18655)

   3    2       INDEX (RANGE SCAN) OF 'LOG_ID' (NON-UNIQUE) (Cost=27 C
          ard=287)
A few details:
SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle8i Enterprise Edition Release 8.1.6.3.0 - Production
PL/SQL Release 8.1.6.3.0 - Production
CORE    8.1.6.0.0       Production
TNS for Solaris: Version 8.1.6.3.0 - Production
NLSRTL Version 3.4.0.0.0 - Production

SQL> select INDEX_NAME,INDEX_TYPE,BLEVEL,CLUSTERING_FACTOR,STATUS,NUM_ROWS,LAST_ANALYZED from dba_indexes where table_owner='AMRWF1' and TABLE_NAME='LOG';
INDEX_NAME                     INDEX_TYPE                      BLEVEL CLUSTERING_FACTOR STATUS     NUM_ROWS LAST_ANAL
------------------------------ --------------------------- ---------- ----------------- -------- ---------- ---------
PK_LOG_LOG_SEQ                 NORMAL                               2            374452 VALID     2495032.8 01-NOV-09
LOG_ID                         NORMAL                               2           1491672 VALID       2616573 01-NOV-09


SQL> select density,NUM_DISTINCT,low_value,high_value from dba_tab_columns where owner = 'AMRWF1' and table_name = 'LOG' and column_name in ('LOG_SEQ','ID');
   DENSITY NUM_DISTINCT LOW_VALUE                                HIGH_VALUE
---------- ------------ ---------------------------------------- ----------------------------------------------------------------
2.9359E-07      3406141 C50309284434                             C50327231662
.001113586          898 3037313635414D5231323842424530           3039333035414D5231313731344230
Here, why even after having been low density on column ID... LOG_ID index is not used?

Please let me know if you need more details.

Earlier post links discussed on this same SQL statements...
CBC latch and buffer busy await you on the same table.

Re: Research of fragmentation of the table in Oracle 8.1.6.3.0

-Yasser

As I mentioned earlier, it is not the ID column but the log_seq column that causes the problem. You have histograms - but they have a size of a bucket.

so in the stats for log_seq - you will have a low value and a high value.

If for example the specified log_seq is greater than high value stored in the stats - so the optimizer will be expected back a few lines to the status log_seq >... and therefore make more attractive based log_seq index

Published by: Lacotte Renaud on November 4, 2009 08:03

Tags: Database

Similar Questions

  • The poor Internet behavior Device Manager error "' there is no selected for the item or a set of device driver information."

    Original title: poor Internet behavior.

    I bought a laptop Lenovo X100e used with Windows 7 Professional. It was a great computer, but when I go on the internet, it behaves as if the connection is slow or wobbly, even if the connection is fast. This is especially true of the streaming video, who stutters so much, it is virtually impossible to watch Netflix or YouTube or any other video streaming service. It is also a great computer so I really want to solve this problem, rather than buying another computer.

    I used this laptop on my network domestic WiFi so much and a direct connection with the same behavior. I diagnosed my network speed and its good, usually around 20Mps, again I tried this laptop in public places like Whole Foods, and it has the same: wobbly connection. I have an old Dell Latitude that works and it works great on the same network internet and I used my phone on my wifi at home and it works fine, so it's clearly the Lenovo.

    The network cards are 11 b/g/n Wireless LAN Mini-PCI Express Adapter II and Realtek GBE Family Controller christophepaille. I checked the drivers for the two (using Device Manager), and they are both currently. I used the function "diagnose problems" and found nothing. I googled for problems with them and have not found much.

    There is also a Qualcom Gobi 2000 listed (it's a WAN wireless driver for Windows 7) under other devices and he says "there is no driver selected for the item or a set of device information. I tried updating the driver, but got an error message saying "Cannot find Windows driver." software for your device I have no idea if this is relevant.

    In addition, the laptop plays the video without any problem if it is a file on the local drive, such as mp4, so I don't think that the video problem is in itself. It is the general communication with a network. Again, I don't think it's a problem of wifi because I get the same behavior, even if I plug a cable network directly to my router.

    Also, I tried several browsers updated, including Chrome, Firefox and IE. In addition, I ran several antivirus scans, and nothing is found.

    Any help would be greatly appreciated.

    (1) run chkdsk as follows:

    A prompt by right clicking and select "Run as Administrator"
    and then at the command prompt, type: chkdsk /f r, then press the Enter key.

    If you are asked to plan the volume to check the next time that the system/PC reboots,
    Enter: y

    Now, restart the PC.

    If you know the manufacturing of your hard drive you can also download their diagnostic software.

    Another use: SpeedFan has an online health analysis function
    (SMART tab) for hard drives. It will show how your disks
    compared with other discs of the same brand and model.
    http://www.almico.com/SpeedFan.php
    Note: Unfortunately now includes a lot of bloat-ware, be very careful when installing remove bloat-ware.

    =====================================================================

    2) run the SFC/scannow command. This will check and repair if necessary all of the critical Windows system files.

    Click on start / all programs/accessories then
    Right-click on the command prompt option and select "Run as Administrator".
    (or "Safe Mode" open a command prompt)
    At the command prompt, enter: SFC/scannow

    Windows 7 - order SCANNOW SFC - System File Checker
    http://www.SevenForums.com/tutorials/1538-SFC-SCANNOW-Command-System-File-Checker.html

    How to use the System File Checker tool to fix the system files missing or corrupted on Windows Vista or Windows 7
    http://support.Microsoft.com/kb/929833

    How to analyze the entries in log file generating the program Checker (SFC.exe) resources of Microsoft Windows in Windows Vista:
    http://support.Microsoft.com/kb/928228

    =================================================================

    If SFC Scannow could not repair any or all the corrupt system files
    follow these steps:

    (a) open a command prompt (start / all programs / accessories)
    Right click on the command line option, then select: run as administrator

    (b) at the command prompt, enter: DISM.exe/online/Cleanup-Image /ScanHealth

    Press the ENTER"" key.

    (c) then enter: DISM.exe/online/Cleanup-Image /RestoreHealth

    Press the ENTER"" key.

    (d) now rerun the command SFC/SCANNOW...

    At the command prompt, enter: SFC/scannow

    J W Stuart: http://www.pagestart.com

  • The download window - behavior on the selection of the Excel window open excel files

    Imagine that you are working on an Excel file. You have completed and saved. You leave open and want to download it via Firefox - whether for a portal, or to send an email or anything else.
    As soon as any Excel file is selected in the window of the Explorer/upload (be it by single click or highlighting by the arrows), Excel window is set up to forward - as if I had clicked on the icon in the taskbar.

    I can't make pile or face of this - it seems to be only Excel.
    It's pretty frustrating in itself and especially when needing to download several Excel files.

    Any ideas?

    Guigs2, you understand.

    COR - el, Yes, it happens only when Excel is already running. He does not Excel if Excel is not running.

    Update: now it no longer. I have no idea what has changed. I have probably quit Firefox, I killed all the process of Excel running, or just rebooted.

    I uninstalled the Flash plugins and installed the latest version.
    If the problem occurs again, I will try it in safe mode.

    Thanks for your help so far!

  • Explorer Windows moves the folder selected to the bottom of the folder list. How can I stop this?

    THIS ISSUE DOESN'T HAVE AN ANSWER.    I DID NOT MARK ANY RESPONSE AS SUCH.

    ATTENTION TO THE RESPONSE MODERATOR ABUSE!

    Open windows Explorer
    view folders on the left
    Double-click computer
    Double-click the C drive
    Scroll down to windows Double click

    Double click on diagnostics (example)

    Now, the folder is moved to the bottom of the folder list.

    This also occurs when you click on any folder and you click once on the open gadget.

    It is increadably boring.  How can I stop it?

    Hi j1234567890j - and everyone else that repsonded to the post.

    I also have expierence this problem and as with all those who have responded to this post one lot others that makes me crazy. To make things worse, this problem manifests itself also on open or save file dialog boxes in any application that relies on the Windows file dialog.

    In my case, I also found that the behavior is inconsistent. Sometimes the problem, and sometimes it isn't. -C' is why it is difficult to focus on the behavior and some people are unable to reproduce the problem. So, I think other answers on different computers where this problem cannot be replicated. As a developer, I understand that, since we often have the answer: "...". but it works in my computer... "- and yes it does, because usually a machine of dev/support is implemented for ideal circumstances. I digress...

    Trying to figure out the problem

    I noticed a pattern, however. I found that if I have the folder in question the collapse and redevelop (double click), the browser moves again, this time exposing all the subfolders that are direct descendants of the record in question. I also noticed that if subfolders are too many to display them in the navigation pane, the selected folder is scrolled to the top of the Panel, expose as many records which can be consulted.

    I think the intention of the browsing behavior, it is that when the user develops the folder, it will show as much as possible under folders in view - but I also think it is where there is a bug - or at least where some other parameter has an impact on behaviour. -For some reason, when a folder is expanded the navigation pane only finds the first subfolder and that one--exposes so boring movement of the folder selected from the current position of the mouse pointer.

    Find an answer

    And yes - even if I think that I understand the problem - I agree with everybody elses user experience - this needs to be fixed!

    I'm not sure that a moderator will pick up what this message is marked as awnsered - even if it isn't in my opnion.

    But if someone the fact: I think that provide an option on the general tab of the Folder Options dialog box, a user can turn off this behavior and expand just the folder without attempting to present all folders visible in the navigation pane.

    Concerning

    Andre Coetzee

  • Table multi-selection disabled the check boxes in ADF 10 g

    I think I met an obstacle when you work with a multi-selection table in 10 ADF.

    The selection itself works very well. However, my problem is to try to disable some of these boxes several selections. These boxes are disabled using the expression language. Once disabled, I can always choose these rows in the table using the button 'Select all' created by multiple selection facet. On the page sent, the disabled lines are not recognized as being selected, which is good. However, they always seem to be selected on the front-end server, which would be confusing for users.

    <af:table emptyText="No roles were found"
              binding="#{backing_userRoles.tableRoles}"
              id="tableRoles"
              value="#{backing_userRoles.userRoleList}"
              var="userRole">
                            <f:facet name="actions">
                              <af:commandButton text="Copy Roles"
                                                binding="#{backing_userRoles.cmdCopy}"
                                                id="cmdCopy"
                                                action="#{backing_userRoles.cmdCopy_action}"/>
                            </f:facet>
                            <f:facet name="selection">
                              <af:tableSelectMany text="Select items and ..."
                                                  binding="#{backing_userRoles.tableSelectMany1}"
                                                  id="tableSelectMany1"
                                                  rendered="#{backing_userRoles.managerFlag}"
                                                  disabled="#{userRole.role.autoGrantedFlag eq 'Y'}"/>
                            </f:facet>
    

    multiselecttable.PNG

    So as you can see, the disabled check box has been selected even when disabled. Any ideas on how to change this behavior? Or maybe just get rid of the default generated 'select all ' | 'Select none' orders?

    Thank you

    Cody

    Or, remove selection facet and make sure you have a selection logic - that is to say, some transient Boolean attribute of VO enabled/disabled state, and you have Select All/Select none

  • Bridge continues to change the selection of the sort each time that I reopen it the Bridge window... WHY?

    Bridge continues to change the selection of the sort each time that I reopen it the Bridge window... WHY?

    I continue to get "sort by modified date" but each whenever I open it a window that it is for manual selection.

    I searched the preferences but impossible to find something to help.  It didn't used to do this...

    John

    Well, I solved the puzzle myself.

    I noticed that somehow a stray .psd file was stuck in my side bar of the Mac Finder.  Don't ask me how it got there.

    At the beginning I couldn't delete it – until I tried a Mac forum and they suggested I hold down the command key and drag it off... to poof!

    It worked.

    And when I went back to bridge - now the bad behavior disappeared!  And when I close the window Bridge and reopen - the choice to "classify" same home!

    Yay... it's a small step for me, and one small step for computerkind.

  • Is it possible to forbid the selection in the TextField?

    I have a small problem: my text field keeps selecting itself, for example if I alt - tab application.

    For my application, text selection is not required and is not used - so I want to dismiss this annoying behavior. In fact, just implemented selection transparent or white color works perfectly.

    Is it possible to do this?

    just implemented selection transparent or white color works perfectly.

    Having an editable field without being able to see the selections on the ground seems kind of strange to me. But anyway, you can do so via css:

    textField.setStyle("-fx-highlight-fill: null; -fx-highlight-text-fill: -fx-text-fill;");
    

    Create a style .text-entry style sheet if you want to apply the style to all text entry fields.

    See the JavaFX css reference guide for answers to all your questions on css: http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html

    You can also listen on the selectedTextProperty and clear the selection, whenever something is selected.

    Sample application:

    import javafx.application.Application;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.scene.Scene;
    import javafx.scene.control.TextField;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    
    public class TextFieldHighlightFill extends Application {
      public static void main(String[] args) { launch(args); }
      @Override public void start(final Stage stage) throws Exception {
        TextField standardTextField = new TextField("Plain Jane");
    
        TextField styledTextField = new TextField("Jumping Jackrabbits");
        styledTextField.setStyle("-fx-highlight-fill: null; -fx-highlight-text-fill: -fx-text-fill;");
    
        final TextField forbiddenTextField = new TextField("Happy hippopotamuses");
        forbiddenTextField.setStyle("-fx-highlight-fill: null; -fx-highlight-text-fill: -fx-text-fill;");
        forbiddenTextField.selectedTextProperty().addListener(new ChangeListener() {
          @Override public void changed(ObservableValue observable, String oldValue, String newValue) {
            if (newValue != null || !newValue.isEmpty()) {
              int caretAt = forbiddenTextField.getCaretPosition();
              forbiddenTextField.selectRange(caretAt, caretAt);
            }
          }
        });
    
        final VBox layout = new VBox(10);
        layout.getChildren().addAll(standardTextField, styledTextField, forbiddenTextField);
        layout.setStyle("-fx-padding: 10; -fx-background-color: cornsilk;");
        stage.setScene(new Scene(layout));
        stage.show();
      }
    }
    
  • Where the CBO

    Hello

    CBO creates for a query execution plans, but where is the CBO; I mean, it is part of the server process or a user process. As I said select * from myTable; and press ENTER, how, when and where the CBO is available in photo? I'm a little confused. Please give me the link of doc to clear this doubt. What exactly CBO (cost based Optimizer on)?

    Thank you.

    user12050217 wrote:
    I thank very you much for your prompt and clear response. Please give me the link to doc to get the preliminary knowledge for CBO. that is what the CBO, how it works, which is work, when it comes to the image (if you mentioned) etc.

    Thank you.

    Of course, please have a look at the link below
    http://download.Oracle.com/docs/CD/E11882_01/server.112/e16638/part4.htm#g996847

    This warranty covers everything that is there for the setting of the query. Read the next section to learn more Optimizer,
    http://download.Oracle.com/docs/CD/E11882_01/server.112/e16638/optimops.htm#g92116

    Update:

    Please take a look at these two links
    http://download.Oracle.com/docs/CD/E11882_01/server.112/e16508/sqllangu.htm#CHDFCAGA
    http://download.Oracle.com/docs/CD/B28359_01/server.111/b28318/sqlplsql.htm#i1712 (11,1 Concepts guide)

    HTH
    Aman...

    Published by: Aman... may 1, 2011 10:56 added two other links.

  • Selection of the type (reverse type) does not appear when you select type

    I have AI CS5 on OS X 10.6.4. I just created an illustration. The problem is that when I try to type in this illustration, the text does not invert to indicate what was selected. The selection work; If I drag on the text, I would like to change, and then type the replacement text, old_text is replaced as expected. But it's as if we were working blindly.

    This is a weird problem and happens only in this particular document. If I copy the content to another document, it works very well there. It doesn't matter if I change the police. The problem occurs constantly in the present a document even if I open the document on another Mac, so do not appear to be specific to the computer.

    I found a solution by copying everything into a new document. However, I am curious to know why this is happening. I was wondering if anyone else had never seen this behavior.

    Show/hide the edges (selected in the view menu or via the Hotkey Cmd / Ctrl + H) is a per document setting. That would explain what you have seen.

    To "fix" your problem document, open, switch to Show Edges, then record under using the same or a different file name. (If you just Save without making further changes to the document, it will not take.)

  • How to select only the URLS in the same page

    I'm used to be able to select only the URL with right click of the entire page. After reinstalling Firefox, I can't use this feature more. Please let me know what kind of add-on, I need to have. Thank you

    I looked in the Wayback Machine for an older version of this page. He said:

    Multi links allows you to open, copy or favorite of several links at the same time rather than having to do them all individually.

    To open, links copy or bookmark, you simply right-click and do to drag a rectangle around the links to the desire to act. When you release the right mouse button, you will open/copy/bookmark these links.

    Note: The Wayback Machine does not cache downloads real extension due to the limitations of robots.txt on the site of modules.

    One of these current extensions could be partial replacement:

    I have not tried any of them myself.

  • I do not understand this statement "It is a good idea to keep track that uses a bunch of Audio channels selected in the arrange window, unless you actively play or record on a software Instrument."

    It's a good idea to keep track that uses a bunch of Audio channels selected in the arrange window, unless you actively play or record on a software Instrument.

    Which no longer applies in Logic Pro X 10.2.3. In old versions of logic, selecting a range with a software instrument automatically would make this instrument in "Live" mode, which means that the instrument has begun to transform any MIDI in sound with a minimum of delay. This direct mode becomes an instrument need CPU power (on a single processor) and peut overload the audio engine. It is a waste of CPU if there is no direct game. Then select an audio track would ensure that No instrument is in direct mode. Now (LPX 10.2.2 or more) in direct mode can be turned on or off on a track, chosen or not - it is the R button on the track header.

  • Search by location bar goes to my internet service provider instead of search engine selected in the search bar; Why?

    Using Firefox 26.0 for openSUSE 12.3

    I disabled the keyword in the address bar search, because instead of results research of the source selected in the search bar (google), my string input sent to my internet provider, a kind of impasse, unproductive page 'web search' without any result.

    I had typed in "ezsniper' in the address bar. After you disable the keyword search in subject: config, my string entry took me to ezsniper.com, which is better than the impasse page Charter.com

    I put my addresses DNS 8.8.8.8 and 8.8.4.4 (Google Public DNS)

    The problem is not to breed, but is stopped before I did the DNS change. Charter Communications seemed to allow a way to disable the 'service' who had ignored my browser/preferences, so that he could... I appreciate the answers, doubt that Charter will get another chance to again divert the DNS.

  • Keyword.URL no longer works, default search uses it who is selected in the search box, how can I get this search keyword.url in the address bar works again?

    just changed after the last update of firefox. It's very embarrassing because the address bar and search bar are two different entities.

    CTRL + L moves the focus to the address bar

    Ctrl + A then selects all the content
    Ctrl + Del, or a plain Del, or Ctrl + X then deletes that content.
    
  • Icons and the selection in the applications tab corner radius

    I noticed a small bug in the applications tab user interface, iTunes. The radius of rounded icons and selection are the same. When the selection RADIUS is 6px higher (6px is a distance between the edge of the icon and selection) - it's prettier.

    LLA is a user support forum, but you can send your comments directly to Apple via this link:

    http://www.Apple.com/feedback/

  • How can I stretch/tilt a rectangular selection in the preview?

    Hi all

    Q: can you the proportions for a rectangular selection of cut-and - paste be unlocked?

    Formerly, in Snow Leopard 10.6.8 cut and paste a rectangular selection of an image in the preview has resulted a selection with eight points of click-and - drag: one at each corner and one on each side.  By clicking and dragging one of these licences stretching/tilt the value selected in any direction.

    Now, in the current version of El Capitan 10.11.3 preview, dragging these points only expands or collapses the selection and the aspect ratio is locked.  I have the impression I'm missing something very basic, but can't find any way to unlock the proportions for the selection in the drop-down menus or toolbars.

    A minor inconvenience, but boring, as the old function provided an extremely useful tool for making models quick and easy collage images that eventually became the graphic designs.

    Many thanks in advance,

    btambaschi

    MacBook Pro, OS X El Capitan (10.11.3)

    Always stretching works for me, the tilt doesn't.

  • I use Photos to make a schedule, and when I add national holidays and have a personal calendar already selected for the import, national holidays replace a personal date when the two entries in conflict.  Any suggestions?

    I use Photos to make a schedule, and when I import two calendars of Mac, I can't play well together.  By example, if I add the national holiday calendar to a personal calendar already selected for the import, national holidays replacement a date personal when the two entries in conflict.  Users are allowed to several elements to show on a given date (I can add an article manually; and if I have two elements in a personal calendar, they both matter very well).  Does not seem serious if I import successively or simultaneously, the holidays always seem to prevail on personal items.  I am proud of my country, but want to avoid adding those who back in manually (and avoid having to check everything so closely).

    Any suggestions?  Thank you

    John

    (running Yosemite on a mini 2015)

    There is no way to have both separate schedules added and share a date.  Tell Apple what missing features you want restored or new features added in Photos via https://www.apple.com/feedback/photos.html.

    You could create a new calendar with personal anniversaries and holidays.  I think that would be the case with the exception of those holidays that might change the date to when if fell, which is Memorial Day for one.

Maybe you are looking for