Optimizer to choose the bad object on a table unparsed

Hello

I'm on Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi and noted the following.
When you query a table with several columns and a 1-column PK for its number of lines, the DB uses the TABLE object, not the object-INDEX-PK.
When you "ANALYZE TABLE COMPUTE STATISTICS x", PK-INDEX-object are used subsequently.

* In my opinion the PK-index (or more generally: the more short-column unique index) must always be used to count the lines as it contains exactly the same number of rows as the original (due to the unique property) object and is always shorter and the number of blocks to read is always equal or smaller compared to the use of the original object.* table

H4. Please see the attached simple test case:
CREATE TABLE x
(
a NUMBER,
b NUMBER,
CONSTRAINT x_pk PRIMARY KEY (a)
) ;
INSERT INTO x
(a, b)
SELECT LEVEL, LEVEL * 2 AS b
OF THE DOUBLE
CONNECT BY LEVEL < = 100000;
COMMIT;
REMOVE PLAN_TABLE;
EXPLAIN PLAN SET STATEMENT_ID is 'test_count_star_pk' for SELECT COUNT (*) FROM x.;
SELECT id, parent_id, position, OPERATION, OPTIONS, OBJECT_NAME, OBJECT_TYPE, OPTIMIZER PLAN_TABLE WHERE STATEMENT_ID = 'test_count_star_pk' ORDER BY id, parent_id, position;
ANALYZE TABLE COMPUTE STATISTICS x;
REMOVE PLAN_TABLE;
EXPLAIN PLAN SET STATEMENT_ID is 'test_count_star_pk' for SELECT COUNT (*) FROM x.;
SELECT id, parent_id, position, OPERATION, OPTIONS, OBJECT_NAME, OBJECT_TYPE, OPTIMIZER PLAN_TABLE WHERE STATEMENT_ID = 'test_count_star_pk' ORDER BY id, parent_id, position;
DROP TABLE x;

H4. Result (see the lines in bold):
Table X is.
100,000 Zeilen eingefugt.
festgeschrieben.
3 Zeilen Debby.
been SET plan.
ID PARENT_ID POSITION RUNNING OBJECT_NAME OBJECT_TYPE OPTIMIZER OPTIONS
SELECT CHOOSE 0
1 0 1 SORT AGGREGATE
* FULL ACCESS X TABLE * 2 1 1 TABLE

Table X analysiert.
3 Zeilen Debby.
been SET plan.
ID PARENT_ID POSITION RUNNING OBJECT_NAME OBJECT_TYPE OPTIMIZER OPTIONS
CHOOSE 0 193 SELECT STATEMENT
1 0 1 SORT AGGREGATE
* 2 1 X_PK INDEX ANALYSIS 1 FULL (SINGLE) ANALYSED *.

Table X play.

What is your opinion on that?

First of all, stop using the ANALYZE and start using DBMS_STATS. Secondly, I can't reproduce your results:

SQL> select * from v$version
  2  /

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
PL/SQL Release 10.2.0.4.0 - Production
CORE    10.2.0.4.0      Production
TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production

SQL> CREATE TABLE x
  2  (
  3  a NUMBER,
  4  b NUMBER,
  5  CONSTRAINT x_pk PRIMARY KEY (a)
  6  ) ;

Table created.

SQL> INSERT INTO x
  2  (a, b)
  3  SELECT LEVEL AS a, LEVEL*2 AS b
  4  FROM DUAL
  5  CONNECT BY LEVEL <= 100000;

100000 rows created.

SQL> COMMIT;

Commit complete.

SQL> explain plan for
  2  SELECT COUNT (*) FROM x;

Explained.

SQL> @?\rdbms\admin\utlxpls

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
Plan hash value: 2071710178

----------------------------------------------------------------------
| Id  | Operation             | Name | Rows  | Cost (%CPU)| Time     |
----------------------------------------------------------------------
|   0 | SELECT STATEMENT      |      |     1 |    55   (0)| 00:00:01 |
|   1 |  SORT AGGREGATE       |      |     1 |            |          |
|   2 |   INDEX FAST FULL SCAN| X_PK |   100K|    55   (0)| 00:00:01 |
----------------------------------------------------------------------

Note

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
-----
   - dynamic sampling used for this statement

13 rows selected.

SQL> 

SY.

Tags: Database

Similar Questions

  • How to choose the object that others will line up to?

    Hi I'm attacking with Illustrator, having been familiar with CorelDRAW X 5, and some of the fundamental things in artificial intelligence are just weird!

    A common operation is to have a bunch of stuff I want to align, where I spent the time of positioning on the particular object so I want that everything stays aligned him to this object. I can do it in artificial intelligence?

    For example, I have two rectangles A and B, separated horizontally with a greater than B. I want that the upper edge of the B to align to the top edge. I select A, then B and align top. It works - B moves upward.

    However if I want albums edge to align the top edge of the B, it does not work how I expect. B always moves. It doesn't matter if I choose first or second, B is the one who moves, when A is above B.

    It's frustrating when I have a lot of objects that are carefully aligned, and I want to align a new object with them. What often happens is that all of my objects placed move to align with the Unplaced object, so I spend a lot of time.

    Y at - it a simple way to choose the object that others in the choice of align on? In CorelDraw, it's the last selected object that determines how many others will be moved.

    Thank you

    Rob

    Select all the objects you want to align, and then click again on the object of the selection you want that all the others will match (object key).

    the key of the object will appear thicker than others.

  • Binds the data object graph, causing memory

    Hello

    I want to create a WPF application that uses Measurement Studio to display the data points on the graph.

    We have already implemented a HAL, the data in the reports of the UI (after a few manipulations), using the DAQmx.

    I saw in your examples you display only the last second points, but my users can choose to see the data in an hour, and if I continue in the data memory of the points for the last hour I get out of memory (the data object become very big).

    How can I display in the chart of the data of the last X minutes / hours without keeping all the data in memory?

    Sorry, it was my fault (the years were defective in my local test as well, just, I had not noticed). Fortunately, what makes the solution even simpler: the CustomXAxis implementation can change just object ISourceDataProvider.TryGetSourceDataStart() { return default(DateTime); } .

    Also, for future reference: to the changes of the properties in WPF, you must be a dependency property or INotifyPropertyChanged , but not both (i.e. didn't need you OnStartTimePropertyChanged in CustomXAxis ).

  • 'Find the UI object' is not jump to certain controls

    I did a search and found other posts of 'Find the UI Object', but none quite match my observation.

    Here's the question.  I'd rather have my distributed signs in my UIR, without overlap.  This allows me to work on panels without getting lost.

    The problem with this model is that when I choose the context menu option 'Find UI Object' of a callback function, it takes me to the top of the UIR, not down below were the Panel is located.

    If I do the same steps for a control that happens to be in a panel near the top of the UIR, then fine.  The IUR is simply not scroll down to show me where the control is actually.

    What version of the CVI are you using? Until 2012 of the CVI, I observed a behavior similar but only for the controls on the tab panels. I posted a suggestion in the exchange of ideas on that CVI: you can comment on this idea by adding your experience and/or congratulations to support.

  • The event of COM + a system attempted to RAISE the event object. Warning event Id: 4353.

    Original title: anyone know what this means? Its a new one on me!

    Anyone know what this means?

    The event of COM + a system attempted to RAISE the event object: change subscription events but had received a bad return code.    HRESULT was 80040201.

    Warning event Id: 4353

    Im not accustomed to see messages like this.

    What happens if the bad thing is fired?

    Someone please answer as soon as POSSIBLE. My imagination

    will work 24/7 to 100% until I get the

    response. Thank YOU, larrythehawk

    This has happened on Windows XP Pro. The Application of event viewer

    Hi Larry,

    Sorry for the late reply. Let us know a few things before you proceed.

    • You are looking at these errors in Event Viewer?
    • Is affecting how your computer performs?
    • Have you tried troubleshooting on the same?

    Please response so we can help you best.

  • CHOOSE THE INSTALLED UPDATES

    HOW CAN I CHOOSE THE UPDATES (SENT BY ASSISTANCE FROM HP SUPPORT) TO INSTALL ON MY LAPTOP? I'M A LITTLE CAUTIOUS BECAUSE I HAD PROBLEMS TO BE CREATED ONCE THE UPDATES ARE INSTALLED.

    IN ADDITION, BECAUSE I CHOSE THE OPTION "INSTALL ALL UPDATES AUTOMATICALLY" ON THE WIZARD WHY HE LET ME KNOW TO AUTOMATICALLY INSTALL UPDATES INSTEAD?

    Thank you

    Anthi,

    Welcome to the HP Forum!

    If you're careful, you can set the HPSA to "Notify" instead of "automatic".

    Why prevent?  Most of the time, HPSA will give you good advice; It is important that you have a choice as to what is happening on your computer before that happens.  If you know beforehand that the system will be updated, you can (optionally) take the time to make sure that you have your completed backups, perhaps a new Image made, and whatever other precautions you want to take.

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

    Comment

    It is the opinion of the Expert that you should never allow the HPSA update your BIOS for you.  The update can backfire and you could find yourself with a brick system.  Yes.  The disaster is not necessarily because of the BIOS updated by the HPSA, although there is a risk to such a significant task in a program; the results can be the result of the system is not ready for the update when it is suddenly thrown on the computer, it could be due to a bad image of the BIOS, it might be simply to cause you to have external devices attached during the update conflict with the update of the BIOS.

    1. Set updates the HPSA BIOS to "ignore".
    2. Open your Web page of the computer and check to see if there is indeed a BIOS update for your computer
    3. READ the BIOS update information and decide whether or not you need the update on your computer

    If you decide to update your BIOS

    • Make sure that ALL backups are up-to-date and complete - this means that everything you need to restore the system in case something goes wrong.
    • Unplug the USB drives and other useless material.  Keyboard and mouse can stay connected.
    • Always run power cable to update the BIOS, never on the battery
    • Touch the system during the update is underway
    • Optional: leave wireless touch YOU, but turn off the router (make sure that there is no interruption)

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

    I don't know the answer to why the HPSA does not update automatically.  The program is capricious.  You could, if you want to always updates automatic, uninstall your existing HP Support Assistant to programs and features program, restart the computer and install a new copy of the program HPSA.

    HP Support Assistant

    See: use and troubleshooting of HP Update

    HP Software Update, also called HP update, is HP tool to help keep your computer up-to-date. The HP Update program research updates for HP software, drivers, firmware, BIOS, tools and utilities installed on your computer and you give the choice to install. It also updates the technical innovations such as troubleshooting tips.

  • How to choose the more int?

    Hi, I have a code creating 5 random integers between 1 and 100. Y at - it an easy way to choose the most high these numbers and more giant yew statements? Thanks for any help!

    You could always sort and take the end. You will need to create a new object table however.

    http://www.BlackBerry.com/developers/docs/5.0.0api/NET/rim/device/API/util/arrays.html#sort (int [], i...

  • Error JVM 525: bad object persistent ~ ~ ~ help!

    I do a game and I want to keep him persistent statistics.  I use the PersistantObject class as in my code below, but I get the following error on the Simulator:

    Error JVM 525

    Bad object persistent: Stats

    The Simulator does not load fully.

    This code is where I declare my instance variables - it's straight out of the JDE 4.7.0 QAnywhere

    private static Stats Statistics
    private static PersistentObject persist;
    {public static
    long KEY = 0xa3b3159378f59a29L;
    persist is PersistentStore.getPersistentObject (KEY);.
    Statistics = persist.getContents () (statistics);
    If (statistics == null) {}
    Statistics = New Stats();
    persist.setContents (statistics);
    Persist.Commit ();
    }
    }

    This method is to update my persistent object

    protected void updateStats (int score) {}
    statistics.hiScore = (statistics.hiScore > = result)? statistics.hiScore: mark.
    statistics.recentScore = result;
    statistics.aveScore = (statistics.aveScore * statistics.gamesPlayed + score) / ++ statistics.gamesPlayed;
    Persist.Commit ();
    }

    It's the Stats class

    public class {Stats
    public int recentScore = 0;
    public int hiScore = 0;
    public int aveScore = 0;
    public int gamesPlayed = 0;
       
    Stats() {}
    His stats (rs, int, int, like int gp hs int) {}
    recentScore = rs;
    hiScore = hs;
    aveScore = have;
    gamesPlayed = gp;
    }
    }

    Any help would be appreciated - thanks

    Cameron

    You must implement Persistable in your stat. class as

    public class Stats  implements Persistable
    {
    
    }
    

    Concerning

    Bika

  • extend ListField, how to get a valid result of getSelectedIndex inside the method object?

    Hi all

    I have replace the method object to extend ListField to create my own color ListField.

    I need to avoid the double drawRow between the method object

    and the drawFocus() method.

    inside the method object, I always get the 'bad' selectedIndex (previous)

    (or rectangular previous on getFocusRect()).

    my questions are:

    1. how to get current selectedIndex (or FocusRect) inside the method object when we extend ListField?

    2. is there any other method called before object, the method which returns SelectedIndex valid?

    3. how to avoid the double drawing between object and drawFocus()?

    Thank you.

    If everything you do is add your own color, and then you can do this by using a fillRect in the drawListRow method.  In there.  I have the code that did this, but only for lines not targeted, as it detects with:

    If (listField.getSelectedIndex ()! = index) {}

    //

    }

  • A snapshot could not be created. Check the event logs application VSS amd SPP for more information. Details: the specified object was not found.

    I get this message to 5 seconds after attempting to back up using a Seagate external hard drive. The drive has plenty of space (1 TB) and is formatted NTFS. System recognizes no problem when I Plug and I can move files to and from it no problem otherwise.

    No other thread does deal directly with this version of the problem (with the object "not found"). Any help or ideas are appreciated.

    Hello

    This occurs generally when the Volume Shadow Copy service and SPP services are not started. We will analyze and identify the cause of the problem.

    I suggest you perform the steps mentioned by "Diana D replied October 23, 2010" to a similar discussion.

    Reference:

    snapshot could not be created Details: the specified object was not found.

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-performance/shadow-copy-could-not-be-created-details-the/a55057f8-67ed-4FA3-b61e-15f8904aaba1

    Note: Make sure you put in road security software and Windows Firewall later once you are finished with the test.

    Important: when running chkdsk on the drive hard if bad sectors are found on the disk hard when chkdsk attempts to repair this area if all available on which data may be lost. When you run the checkdisk, there are risks of data loss you can take a backup before starting the checkdisk.

    See also:

    Back up and restore frequently asked questions

    http://Windows.Microsoft.com/en-us/Windows7/back-up-and-restore-frequently-asked-questions

    Back up your files

    http://Windows.Microsoft.com/en-us/Windows7/back-up-your-files

    Hope this information helps. Response with status so that we can help you.

  • Invert the background object

    Guy

    I am new user to HAVE.

    I have a red circle, then a green square.

    the green square goes beyond the red circle, but I would like the invert that.

    Should I please?

    Thnak you

    If you speak of the stacking order, select the Green object and choose: object > Arrange > move back.

    Or cut the Green object, select the Red object and choose: Edition > glue to the back.

  • POS 6.1 can choose the correct time zone please?

    Hello.

    IM at the stage of configuration VDP now (...:8543/vdp-configure) and I can't find the good zone time (I need UTC + 7). I use usually Asia/Krasnoyarsk tz, there are a lot of UTC + 7 areas here invalid time zone values and in the SLES itself BUT without these areas at the POS configure the web interface. Can someone tell me why? May be I can complete the configuration with wrong time zone and change later recreating the link/etc/localtime or in the console vm POS? Or should I choose correct time zone during the initial Setup?

    OK, I got a solution. Initial configuration of POS has been completed with the incorrect time zone. Then I changed timzone in the vm console VDP (define-> Asia-> Russia-> Krasnoyarsk time zone), but the bad timzone was still in the POS-configure page. However after the restart of the POS POS-configure vm page indicates the correct time zone (Asia/Krasnoyarsk). Unfortunately, I still can not choose this area to POS - configure-> time zone.

  • User choose the alert folder

    Hi all

    very new to scripting and I'm just kinda stuck.

    I made a script that works, but I want to refine even more to make it more user-friendly.

    When the script starts, it asks the user to choose a folder where their images, but there are two problems with that.

    First of all as the default dialog box the DESKTOP folder and the user accidentally press OK, the script will take action even if it is an incorrect location.

    Secondly there is no exit procedure if uses rather press CANCEL in the dialog box.

    I'm trying to implement a fail-safe, so the end-user will have feedback that is when pressing OK a popup asking the user if the folder "x" corresponds to the correct location and give a YES/NO dialog - YES go - PERSON will go back to the file selection screen.

    Also, I need to make the script exit cleanly if the user selects the button CANCEL on the file selection screen.

    Here is a snippet of my code as it is:

    // Ask user for DARK input folder
    alert("Please Choose The Folder Where Your DARK Frames are located.", "DARK FRAME FOLDER LOCATION");
    
    
    var DARKinputFolder = Folder.selectDialog("****Please Select The Folder Where Your DARK FRAMES Are Located****");
    
    
    // Ask user for LIGHTS input folder
    alert("Please Choose The Folder Where Your LIGHT Frames are located.", "LIGHT FRAME FOLDER LOCATION");
    
    
    var LIGHTSinputFolder = Folder.selectDialog("****Please Select The Folder Where Your LIGHT FRAMES Are Located****");
    
    
    // ***HANDLE THE DARK FRAMES***
    
    
    // get all files in the DARK input folder
    var FILE_TYPE = ".orf"; // The type of files that this script works on -- you can change
    var SEARCH_MASK = "*" + FILE_TYPE; // Image file filter to find only those files
    var DARKfileList = DARKinputFolder.getFiles(SEARCH_MASK);
    
    
    if (DARKfileList.length <= 0)
    {
    var FILE_TYPE = ".tif"; // The type of files that this script works on -- you can change
    var SEARCH_MASK = "*" + FILE_TYPE; // Image file filter to find only those files
    var DARKfileList = DARKinputFolder.getFiles(SEARCH_MASK);
    }
    
    
    if (DARKfileList.length <= 0)
    {
    var FILE_TYPE = ".tiff"; // The type of files that this script works on -- you can change
    var SEARCH_MASK = "*" + FILE_TYPE; // Image file filter to find only those files
    var DARKfileList = DARKinputFolder.getFiles(SEARCH_MASK);
    }
    
    
    if (DARKfileList.length <= 0)
    {
    var FILE_TYPE = ".jpg"; // The type of files that this script works on -- you can change
    var SEARCH_MASK = "*" + FILE_TYPE; // Image file filter to find only those files
    var DARKfileList = DARKinputFolder.getFiles(SEARCH_MASK);
    }
    
    
    if (DARKfileList.length <= 0)
    {
    var FILE_TYPE = ".jpeg"; // The type of files that this script works on -- you can change
    var SEARCH_MASK = "*" + FILE_TYPE; // Image file filter to find only those files
    var DARKfileList = DARKinputFolder.getFiles(SEARCH_MASK);
    }
    

    Any help would be appreciated

    Kind regards..

    There was a typing error in the above code. You put it ';' is not fair. I put a hat i because, if it's bad. The code should be:

    var myFolder = new Folder('/c/test');
    var holdFolder = new Folder()
    
    var dlg = new Window('dialog','Select a Folder');
        dlg.getTheFilesBtn = dlg.add('button',undefined,'Select a folder');
            dlg.getTheFilesBtn.onClick = function(){
                holdFolder = new Folder(myFolder);
                holdFolder = Folder.selectDialog('select a folder to process',myFolder);
                if(holdFolder){myFolder = holdFolder};
                dlg.close();
            }
            dlg.show()
    
  • The attributes defined for SelectCheckbox in the view object Failed

    Hello

    I expanded the view object of the table to filter the records and the table contains the selection box (no change has for this box). When I choose one of the records to help select the check box and go to an action, the error is coming as "Attribute defined for SelectCheckbox in the view object TeamTableVO failed" ... Is the error due to VO scope or any other reason...

    Help, please...

    Kind regards

    Praveen

    Hello..

    Check the following

    1. check if the value of any attribute is set, if yes remove

    2. check the attribute map

    3. set your columns can Yes

    4. check if its VO selected to interview

  • Copy the properties of the dynamic object

    Hi people.

    As it is Christmas time, I thought I'd do a nice picture of Christmas with snow.

    It was ok until I tried to make a new layer by dragging my 'Smart Object' layer to the new layer icon, and not using 'Control-J', as by dragging to the new layer icon must copy the properties also.

    The layer copy very well, but the properties do not copy with it, which would be a pain I want to make a number of copies and do not want to change one by one.

    Any help people.

    Hi BigDingus,

    When you use the standard shortcut command + J (PC: Ctrl-J) to duplicate a smart object, the changes to the smart object will affect both copies. To avoid this, Ctrl-click (PC: right-click) on the smart object, then choose new Smart Object Via Copy. Now two smart objects can be edited separately.

    Concerning

    Jitendra

Maybe you are looking for