Selectivity index

Hi the gems... Hello..

I have a table (Order_Table) in which there are 4 clues.
Assume that the column names are col1, col2, col3, col4, col5, col6.
The primary key is on col1, col2, col3 col4.

There are three index on the table:

Index1: col1
Index2: col1, col2, col3, col5
Index3: col1, col2, col3, col6

Now when I publish a select statement with a WHERE clause of col1 clause, col2, col3, then it uses index2.
Once again when I publish a select statement with a WHERE clause of col1, col2, then it uses the primary key.

I'm really confused about the selectivity of the index.

Can you please make me understand the feature or point to the documentation link.

Thanks in advance...

Hello

There are three components in the formula of the selectivity of the index:

basic index range scan cost = index blevel + ceil(index selectivity x leaf blocks) + ceil(table selectivity x clustering factor)

http://richardfoote.WordPress.com/2009/06/09/the-CBO-and-indexes-an-introduction-absolute-beginners/

with:
blevel index: number of levels in the index structure
index of selectivity: the part of the index the CBO must read with the conditions stated
blocks of sheet: the number of leaf blocks in the structure of the index (see USER_INDEXES)
Table of selectivity: the part of the table the CBO must read with the conditions stated
grouping factor: the relative order of the index compared to the table

So in your example the condition of col1, col2, col3 reduced the selectivity of the index (and the selectivity of the table) to a point where the CBO comes to a result that it is a good idea to read a small part of the index more for access to a small portion of the table. For the condition of col1, col2 internal arithmetic reach a different result and reads the smallest index and a greater part of the table. You can check the internal calculation with indicators of indexes and explain plan or - if you want more details - with the trace event 10053 (CBO track).

Concerning

Martin

Tags: Database

Similar Questions

  • How do the PaneManager TitleView repaint when selected index changes

    I have a PaneManager using the HorizontalScrollableController.  When I programmatically change the selected index (model.setCurrentlySelectedIndex), the content of the pane that shows the changes and the new pane fields appear.  But the HorizontalScrollableTitleView that is displayed does not change.  He continues to display the text in the selected pane title previously.

    How can I get the TitleView to repaint?

    I tried call invalidate() on it and also move the emphasis placed on the TitleView, and then back to it.  It will not always paint the title of the newly selected pane.

    I'll post a sample program demonstrating the problem tomorrow.  But I wanted to get the issue out there, in the hope that someone could give me a solution.

    Never mind. I found a kludgy autour work. Sucks, I have to find things. Would be nice if things like this everything worked properly in the first place.

  • Selected index when sorting?

    I have an application that makes changes to an element in a collection of table based on the selected item in a datagrid control. What I mean is that you select the line you want to change in the datagrid control, and then click a button to change. I was using the selected index to determine the index add the mofified element. Here's where I determine what element of the array is replaced:

    var theIndex:Number = theGrid.selectedIndex;
    theCollection.removeItemAt (theIndex);
    theCollection.addItemAt ({stuff: theStuff}, theIndex);

    Which works fine... until sort you the datagrid control. Obviously this does not work when once sorted, given that the clues are more synchronized, but what do I do to fix this? Is there a way to determine what the index into the array is when you select the row in a datagrid?

    Hello

    There are two ways in which you can accomplish this task.

    1 var theIndex:Number = theGrid.selectedIndex;

    (theGrid.dataProvider as ArrayCollection collection) .removeItemAt (theIndex);

    (theGrid.dataProvider as ArrayCollection collection) .addItemAt ({stuff: theStuff}, theIndex);

    Another solution:

    2. var theIndex:Number = theCollection.getItemIndex (theGrid.selectedItem);
    theCollection.removeItemAt (theIndex);
    theCollection.addItemAt ({stuff: theStuff}, theIndex);

    Hope this helps you.

    If this does not resolve your problem, then please let me know

    See you soon

    -Vikash

  • Selective index

    Hello
    What is selective index and what is a non-selective index?
    I found it in
    Oracle® database
    Performance Tuning Guide
    10g Release 2 (10.2)
    B14211-03

    Page 7-11:
    1. If the accessed object's index, whether the index is selective. If not,
    Grant the SQL statement to use a more selective index.


    Thanks for help.

    The selectivity of an index is a measure of how many lines of the index is likely to return to a specified criteria.

    If you have a table of ADDRESSES and an index to the COUNTRY column, it is probably not particularly selective. There are only a couple hundred countries in the world and the majority of the locations will be concentrated in a handful of very large countries. Therefore, the cost-based optimizer will tend not not to choose this index because it would be very expensive, for example, to analyze the index to the ROWID of the addresses in the United States and then search for the row of the table for each row. It is usually quicker to do a full table scan in this case.

    However, an index on the column ADDRESS_ID, assuming that it is the primary key, is no doubt perfectly selective. For any given ADDRESS_ID, the index will give an and a single line. The cost based optimizer will generally use selective index because it is relatively cheap to find a unique ROWID between the index and find this ROWID in the table.

    Between these two extremes, of course, there are different levels of selectivity. The cost-based optimizer uses its estimates of selectivity to figure out which, if any, clues are the cheapest deal with a given query.

    Justin

  • Selected index was not found in the editfield

    Hello

    I am facing a problem when adding listener to the BasicEditField. I'm not able to retrieve the index of the field in which the data has been inserted. I'm getting the same index for each field. Here is the corresponding code.

    BasicEditField[] quantField=new BasicEditField[10];
    quantField[i]=new BasicEditField("","",10,BasicEditField.FILTER_INTEGER | BasicEditField.NO_NEWLINE);
    quantField[i].setChangeListener(new FieldChangeListener(){
        public void fieldChanged(Field field, int context) {
            Dialog.alert("selected:"+field.getIndex());
        }
    });
    

    Please, help me in this issue.

    just to add to your options, you can use set/getCookie to identify the fields that have been added anonymously.

  • Search for Windows 7 is not find, I know that the files are there and when I go into the control panel and select indexing options, it doesn't seem to work

    Windows 7 search is not finding I know that the files are there and when I go to the control panel and select the indexing options, it doesn't seem to work. I guess that's a place where the problem of index - what can I do?

    Microsoft has NO solution.

  • Difference between Index Full Scan, and Scan select Index Full

    Quick Index Full Scan is an example of Index Full Scan, then what are the differences between Fast Full Index Scan and Index Full Scan. I have traveled the official documentation, but found it a bit complex, that no simple explanation will be great. Thanks in advance!

    Go to http://tahiti.oracle.com, select database Oracle 11g Release 2 (11.2) enter fast full scan small index in the 'Search' box, you may decide to read the results of three or four, but the fourth is setting performance Guide: the query optimizer

    Repeat the process for the analysis of comprehensive index of search term.

    Concerning

    Jonathan Lewis

  • Selection index line

    I need to find online the story ist parent whitch the current selection. How can I do?

    What about using the first selection PointInsertion:

    var currSel = app.selection[0];
    var currStartPosition = currSel.insertionPoints[0].index;
    var theResult = currSel.parentStory.insertionPoints.itemByRange(0, currStartPosition);
    alert('Current Selection starts in line: ' + theResult.lines.length)
    
  • Keep the selected index of a HorizontalList

    I have a horizontalList which is filled with a data provider. My page never refreshes after an interval of 30, 60 seconds.

    I have 5 item in the list. So when I select an item in the list at index 3, his article is highlighted with a different color. Now, when the page is refreshed in 30 seconds, I lose the highlight. How do I keep on refresh highlight color so that I know how I look at one.

    I throw every time an event that refreshes the page and I store the index selected on my model. But I could not set the property of the element selected highlighted or selected.

    Here is the code I put in place.

    private void handleAppRefreshed(event:Event): void {}

    trace ("Index:" + model.selectedHLIndex);

    hlist.selectedIndex = model.selectedHLIndex; where hlist is the horizontalList

    }

    Any help will be appreciated. Thank you.

    KM

    Thank you. Once you refresh the data, you will lose the selectedItem. You can store the value and reset it after that data is returned.

  • How do you define an editable ComboBox selected index?

    I have a combobox that is the editable value... For some reason when I put the selectedIndex property... it does not work... The text of get set to until the first item in the drop-down list box. Does anyone have some good ideas?

    make a calllater will solve this problem if your change in dataprovider and try to set the index selected on a modifiable combox

  • Failed to set the selected index of a ToggleButtonBar to "0".

    Hello:

    I have a problem with ToggleButtonBar.

    I put my toggleButtonBar with a viewStack with list of the VBoxes containing formItems. When the page loads for the firsttime, all right. The first button in the toggleButtonBar is selected with the correct formItem in the viewstack. I fill out the forms on each article and click on the submit button. It will take me to the homepage again. Next time when I click on a button to take me to the toggleButtonBar, the last selected button is selected with the form associated with that. I need to reset the togglebuttonBar to the first selection. I tried to set the selectedIndex property of toggleButtonBar and the viewStack to '0', but doesnot work.

    Someone at - it immediate help would be highly appreciated.

    Happy to help you. Maybe my post being the answer does not appear yet, but if you forgot to mark my poist as the answer, that would be appreciated.

  • DataGrid row selection index-Z & amp; itemRenderer background

    Hi, I have a datagrid with custom element converters (HBox). Now if I change the color of information Hbox and move the mouse over a few lines in the datagrid control, actually target line visualization (blue line) is UNDER the itemrenderer background color so I do not see what line is focused with the mouse. I wish I had this selection of lines above the item converter.

    Thanks for help.

    Solved. Made by the substitution of a function in the custom itemRenderer class updateDisplayList.

  • How to change the selected index of a list of a DG?

    It is probably simple and I'm in the right place. I have a datagrid. When I select an element of the DG, he fills out a form that can be updated. One of the form fields is a list control with a remote object values. I want this list to highlight/select the value that corresponds to that of the DG when the item is selected. For example if I have a list of numbers 1, 2, 3, 4, 5 and the question that I select in the DG contains a 4, then I want the list to automatically select 4 as a default in the list when I select the element of the DG.

    You must loop through the result of your RemoteObject looking for a match, after that you have added to the list. I posted a sort of model of example to show what I mean, yours will be different of course, but I think you can grasp the concept based on what I'm trying to show.

  • Need to get the last selected index to a button

    I have 3 buttons below the GRID: one to redirect to the edition, one page to redirect to the page of transfer and the other to redirect to the page of split. Because I wasn't able to find a way to have three buttons on each line of my cfgrid, I opted to put them below. Ticket helpdesk request concern.

    Naturally, when the user clicks one of these buttons, the system will be required to include the TICKETID in the url (as a parameter as TICKET = 346 where 346 will be the selected line, corresponding to this post). Everyone talks about the onChange and everyone talks about editable CFGRID controls but not many people seem to use the CFGRID controls in the way that I need! Is it just me or this component is really difficult when used with more needs? Anyway, I'm not here to argue about that, I just want to spend on this simple idea! Very easy to use bind in a form, but controls the CFGRID seems to have a wall for not having this facility even!

    All of the code that I have attached, examine the code in a Flash FORM.

    Thanks for any help!

    You know that programming can be a challenge sometimes when we try to get outside these examples gave everywhere. But, I still think that everything is possible and prove once again with this new problem, I got.

    I knew that somehwere in my head, is it possible to talk to the grid directly without establishing a remote connection to the network itself. You will find my solution residing on a function to call between cfformitem type = script.

    As all of these forums are analyzed regularly and be available from a GOOGLE search query (or one of your favorite search engine), I hope that this will help any programmer who are looking for this same challenge and finding not enough documentation to meet their needs. As you will see in the code, it is not so easy to pass the value to the specific column/line selected in your grid. In fact, once the solution is found, everything will be easier!

    Please note that my example also includes a filter at the top of the grid.

  • List not correct selected Index

    Hello

    I have a list with a custom ItemRenderer.  When I raise the lstMessages_changeHandler(event:IndexChangeEvent):void event the selectedItem is always first in the list.  Once it is triggered, it does not occur again.  Looks like a simple thing to get the item... but I am at a loss.

    Thank you in advance,

    Paul

    View the Code

    <? XML version = "1.0" encoding = "utf-8"? >

    " < = xmlns:fx s:View ' http://ns.Adobe.com/MXML/2009 "

    xmlns:s = "library://ns.adobe.com/flex/spark" title = "The Wall" creationComplete = "init ()" >

    < fx:Declarations >

    <! - Place non-visual elements (e.g., services, items of value) here - >

    < / fx:Declarations >

    < fx:Script >

    <! [CDATA]

    import com.facebook.graph.Facebook;

    import com.facebook.graph.FacebookMobile;

    import com.trinet.bl.BusinessLogic;

    import mx.binding.utils.BindingUtils;

    import mx.collections. *;

    import mx.managers.CursorManager;

    import spark.events.IndexChangeEvent;

    import mx.events.FlexEvent;

    import mx.events.ItemClickEvent;

    public private static var bl:BusinessLogic = BusinessLogic.getInstance ();

    [Bindable]

    public var posts: ArrayCollection collection;

    protected function init (): void

    {

    bl.wallView = this;

    bl.getWallPosts ();

    }

    protected function btnAdd_clickHandler(event:MouseEvent):void

    {

    CursorManager.setBusyCursor ();

    bl.addWallPost ();

    CursorManager.removeBusyCursor ();

    }

    protected function lstMessages_changeHandler(event:IndexChangeEvent):void

    {

    //var object: action = lstMessages.selectedItem;

    //navigator.pushView (WallPostDetail, lstMessages.getChildAt (event.newIndex));

    trace (event.newIndex);

    }

    ]]>

    < / fx:Script >

    < s:Label id = "lblMessage" left = "10" right = "10" top = "10" text = "Message" / >

    < s:Button id = "btnAdd" right = "12" high = "39" label = "Add" click = "btnAdd_clickHandler (event)" / >

    < s:TextArea id = "txtMessage" left = "10" right = "96" top = "34" / >

    < s:List id = "lstMessages" left = "10" right = "10" top = low "116" = "6".

    Exchange = "lstMessages_changeHandler (event)" dataProvider = "messages from {}" fontSize = "20" "

    itemRenderer = "renderer. LabelField WallItemRenderer"="message"> < / s:List >

    < / s:View >

    Code ItemRenderer

    <? XML version = "1.0" encoding = "utf-8"? >

    " < = xmlns:fx s:ItemRenderer ' http://ns.Adobe.com/MXML/2009 "

    xmlns:s = "library://ns.adobe.com/flex/spark" >

    < fx:Script >

    <! [CDATA]

    import mx.events.ItemClickEvent;

    import com.trinet.bl.BusinessLogic;

    import mx.core.FlexGlobals;

    import spark.components.List.

    [Bindable]

    public var myBGColor:int = 0xFFFFFF;

    mydata:Object private var;

    override public function set itemIndex(value:int):void

    {

    if ((value%2) == 0)

    {

    myBGColor = 0xFFFFFF;

    }

    if ((value%2) == 1)

    {

    myBGColor = 0xCCFF66;

    }

    }

    override public function set data(value:Object):void

    {

    mydata = value;

    lblMessage.text = value.message;

    var comments: Array = value.comments.comment_list;

    lblComments.text = lblComments.text + value .comments .count;

    lblLikes.text = lblLikes.text + value .likes .count;

    }

    ]]>

    < / fx:Script >

    < s:Rect id = "myRect" left = "0" right = "0" top = low "0" = "0" alpha = "1.0" >

    < s:stroke >

    < s:SolidColorStroke color = weight of the "0xA8C6EE" = "1" / >

    < / s:stroke >

    < s:fill >

    < s:SolidColor color = "{myBGColor}" / >

    < / s:fill >

    < / s:Rect >

    < s:Label id = "lblMessage" left = "5" "5" = low top = width = "21" "458" fontSize = "15" text = "Label".

    textAlign = "left" verticalAlign = "top" / >

    < s:Label id = "lblComments" left = "10" low = "1" height = "12" fontSize = "12" text = "comments:" / > ""

    < s:Label id = "lblLikes" left = low "111" = "1" fontSize = "12" text = "like:" / > ""

    < / s:ItemRenderer >

    in itemrenderer also override the method get itemIndex and data.

    hope this will solve the problem.

Maybe you are looking for