How to make use of indexes when using group by caluse?

Hi All
I am using a query with a group by caluse without any WHERE caluse.There are indexes on columns in the select clause,but the explain plan shows a full table scan.Can this be avoided and make use of indexes?
Execution Plan
   0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=347 Card=27007 Byt
          es=1053273)
   1    0   HASH (GROUP BY) (Cost=347 Card=27007 Bytes=1053273)
   2    1     TABLE ACCESS (FULL) OF 'TABLEXYZ' (TABLE) (Cost=73 Ca
          rd=27007 Bytes=1053273)
Statistics
          1  recursive calls
          0  db block gets
        317  consistent gets
          0  physical reads
        116  redo size
     373725  bytes sent via SQL*Net to client
      12351  bytes received via SQL*Net from client
       1086  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
      16268  rows processedThanks in Advance

user10450559 wrote:
Hi All
I am using a query with a group by caluse without any WHERE caluse.There are indexes on columns in the select clause,but the explain plan shows a full table scan.Can this be avoided and make use of indexes?In principle there are cases where Oracle can use an index range or full scan to do a group by without sorting if the "group by" columns are the leading columns in the index. But if you want an intelligent answer in your case, you will have to post the query and the definition of the index you think is the one that should be used.
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
http://www.jlcomp.demon.co.uk
"Science is more than a body of knowledge; it is a way of thinking" Carl Sagan

Similar Messages

  • How do i make WebView automatically load when using TakeStringURLFrom??

    I haven't added any code yet. I've WebKit, a Webview and a editable textbox where it takes the URL from. Normally it would require you to hit enter, but i would like it to just load it automatically. How do i do this? Please explain EXACTLY how! I would also like to know how instead of it using scrollers, i can make it just do like if you play a windowed game, u know, so u can still see it all. Also i would like to know how u make it stretch out when it enters fullscreen, please.

    Open Accounts preferences, click on the Login Items tab. Select entries and press Delete [-] to remove. Click on the Add [+] button to place an application into the list.
    Note that the more items in the list you load at startup the slower your startup time will be.

  • How to prevent Oracle from using an index when joining two tables ...

    How to prevent Oracle from using an index when joining two tables to get an inline view which is used in an update statement?
    O.K. I think I have to explain what I mean:
    When joining two tables which have many entries sometimes it es better not to use an index on the column used as join criteria.
    I have two tables: table A and table B.
    Table A has 4.000.000 entries and table B has 700.000 entries.
    I have a join of both tables with a numeric column as join criteria.
    There is an index on this column in table A.
    So I instead of
      where (A.col = B.col)I want to use
      where (A.col+0 = B.col)in order to prevent Oracle from using the index.
    When I use the join in a select statement it works.
    But when I use the join as inline view in an update statement I get the error ORA-01779.
    When I remove the "+0" the update statement works. (The column col is unique in table B).
    Any ideas why this happens?
    Thank you very much in advance for any help.
    Regards Hartmut

    I think you should post an properly formatted explain plan output using DBMS_XPLAN.DISPLAY including the "Predicate Information" section below the plan to provide more details regarding your query resp. update statement. Please use the \[code\] and \[code\] tags to enhance readability of the output provided:
    In SQL*Plus:
    SET LINESIZE 130
    EXPLAIN PLAN FOR <your statement>;
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);Usually if you're using the CBO (cost based optimizer) and have reasonable statistics gathered on the database objects used the optimizer should be able to determine if it is better to use the existing index or not.
    Things look different if you don't have statistics, you have outdated/wrong statistics or deliberately still use the RBO (rule based optimizer). In this case you would have to use other means to prevent the index usage, the most obvious would be the already mentioned NO_INDEX or FULL hint.
    But I strongly recommend to check in first place why the optimizer apparently seems to choose an inappropriate index access path.
    Regards,
    Randolf
    Oracle related stuff:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle:
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • How to make VM to suspend when it not use , VDI3.0 with SGD 4.5

    Hi All,
    We are using SunVDI3.0 with VBox 2.0.10 and connecting via SGD 4.5.
    i konw that we can do suspending vm on vmware esx, however i couldn't find it in VirtualBox provider.
    how to make VM to suspend when vm is not using for some period time.
    thanks in advance
    -kevin-
    Edited by: kevin on Sep 27, 2009 5:44 PM

    Hi All,
    We are using SunVDI3.0 with VBox 2.0.10 and connecting via SGD 4.5.
    i konw that we can do suspending vm on vmware esx, however i couldn't find it in VirtualBox provider.
    how to make VM to suspend when vm is not using for some period time.
    thanks in advance
    -kevin-
    Edited by: kevin on Sep 27, 2009 5:44 PM

  • Using indexes when using group by clause

    How can I make use of indexes when there is a group by clause in the sql/ pl/sql. Heard that when ever there is a group by clause , sql bypasses use of indexes. Is it true?
    Thanks in advance

    Hi,
    Depending on the query containing the group by, indexes will still be used.
    For example, create a big table based on the all_objects table. Then create an index on the object_type column. Then run this query:
    select count(*), object_type from big_table where object_type != 'PACKAGE' group by object_type
    The execution plan for this query will show the index to be used, the group by does not prevent the optimizer from using an index. Then run this query:
    select count(*), object_type from big_table group by object_type
    The execution plan for this query will show the index not to be used because the whole table - no restrictions - needs to be read to get the result.
    Hope this helps!
    Regards,
    Marco Stuijvenberg
    =
    www.marcostuijvenberg.nl

  • Time Capsule only works for one device at a time, how to make it capable to be used for multiple devices at times

    Time Capsule only works for one device at a time, how to make it capable to be used for multiple devices at times.
    Please help to set it up, thanks in advance

    You need to give more info..
    Firstly only works for what.. networking.. backup.. wireless. You need more nouns.. more adjectives... describe what you want and what fails.. then we can figure out why.
    Most likely you have bridged it when it should be in router mode..
    Most likely you are using Lion or ML which has the airport utility bridge the TC by default.
    Change it to working as a router. That might help.
    If you press reset button it will default back to router btw.
    If you are on Lion.. use a real utility. http://support.apple.com/kb/DL1547

  • How do I close a JInternalFrame when using subclasses and a separate cla...

    The heading should be: How do I close a JInternalFrame when using subclasses and a separate class for the actionListener?
    I have just created a JInternalFrame appclication and now I want to structure up my code. I have a Superclass that contains the usual settings for the two JInternalFrame:s, and the two subclasses with frame specific information. Both the JInternalFrames use the same OK button. I want to have the actionListener outside the classes to avoid repetition of code. But the dispose()-function does not work properly, it does not close the opened JInternalFrame. What�s wrong?
    class Superclass extends JFrame
         JButton b= new JButton("ok");    
         Superclass()
    class Subclass1 extends Superclass
         Subclass1 ()
              add(ok);
           ok.addActionListener(new Listener());
    class Subclass2 extends Superclass
         Subclass2 ()
              add(ok);
           ok.addActionListener(new Listener());
    class Listener extends Superclass implements ActionListener
         public void actionPerformed(ActionEvent e)
                   dispose();
    }How do I controll in the Listener class that the button in Subclass1 is beeing pressed?

    First of all I think I misunderstood your question. You said you had two internal frames, so I thought you wanted to close the internal frame.
    It now looks to me like you want to close the entire JFrame, which makes the code even a little easier. Something like:
    JComponent component = (JComponent)event.getSource();
    JFrame frame = (JFrame)SwingUtilities.windowForComponent( component );
    frame.dispose();
    Ok, I will make a try:
    public static Container getAncestorOfClass(Class c, Component comp)
    w.getAncestorOfClass(w, this); Fiirst you need to learn the basics of reading the API.
    "getAncestorOfClass()" is a static method. That means you don't use a variable to invoke the method. You use the class itself.
    "w" is a variable, which is a JFrame, but that is not what the first parameter should be. The first parameter is a "Class".
    "this" will refer to your Listener class, but you need the Component that generated the ActionEvent.
    When I thought you wanted to close an internal frame then the code would have been something like:
    JComponent component = (JComponent)event.getSource();
    Container container = SwingUtilities.getAncesterOfClass( JInternalFrame.class, component );
    JInternalFrame internalFrame = (JInternalFrame)container;
    internalFrame.invokeSomeMethodHere();If you need further help then you need to create a "Short, Self Contained, Compilable and Executable, Example Program (SSCCE)", that demonstrates the incorrect behaviour.
    http://homepage1.nifty.com/algafield/sscce.html

  • How can i detach the video from a clip so i can only use the audio when using imovie?

    how can i detach the video from a clip so i can only use the audio when using imovie?

    First, go to iMovie/Preferences and enable the Advanced Tools.
    Import the video clip into an iMovie Event. When you get ready to use it in an iMovie Project, select the clip in the Event and drag & drop it on top of a video or photo clip in the project at the place where you want it to begin. When the pop-up menu appears, choose Audio Only.

  • How can we get ADFSecurity work when used in OC4J, OID and OAM?

    I am getting error in http server log "mod_oc4j: Response status=499 and reason=Oracle SSO, but failed to get mod_osso global context."
    But I am not using Oracle SSO and my client doesn't want to use it either, I am using OAM SSO(CoreIDSSO) in my configuration. Please read the details below.
    I am using ADFSecurity in an app that is protected by OAM. To migrate ADFSecurity permissions from
    system-jazn-data.xml to OID, I used JAZNMigrationTool to populate OID with Grantees and Permissions. OAM gives login page, and authentication works fine.
    But ADFSecurity is not working. ADFComponent Delete button is enabled even for roles that dont have permissions for the iterator delete.
    - The app works fine when I use without OAM. ADF Security permissions work fine.
    - The app works fine when used with OAM, but with ADFSecurity disabled (enforce=false).
    - When I enforce ADFSecurity alongwith OAM, ADFSecurity is not working.
    In the doc "Oracle Containers for J2EE Security Guide b28957", there is a mention of use of CoreIDPrincipal for permissions. Our OID Permissions entries show
    LDAPRealmRole for attribute orcljaznprincipal. I am not sure if this could be the reason.
    We have configured AccessServerSDK for the SOA instance and have policy for the urls in the policy manager. We have entries in orion-application.xml, orion-web.xml and system-jazn-data.xml as per the documentations.
    How can we get ADFSecurity work when used with OID and OAM?

    Have you been able to successfully integrate OAS with OAM & OID? We have similar requriement and so far we have not been able to get it working.
    We have application specific roles which we map to OID roles using orion-application.xml.
    Any pointers to achieve this would be greatly appreciated.
    thanks,
    Dipal

  • How do I manage Lightroom photos when using 2 computers, keeping all edits made on either one?

    Based on http://forums.adobe.com/thread/1308132?tstart=0 I decided to add each question seperately:
    Hello, I'm quite interested in buying Lightroom 5.2. I tried the RC which ran out now. Yet, I have a several questions that I can't really find good conclusive answers to, that I'd like to get answered before buying LR. Please don't write maybe like this or that (assumptions), since I don't want to start my whole workflow and then realize that I have to change everything around, so please answer, if you know for sure that something works and you are, preferably, using that method too.
    This is the biggest question, where I mainly want a conclusive answer:  How do I manage Lightroom photos when using 2 computers, keeping all edits made on either one of them, using the same photos for editing. I won't use DNG. Details: I mainly use my older MacBook Pro, but would like to be able to use my PC as it's way better (Specs: i5 2500K, 16GB RAM, SSD, USB3, nVidia GTX 560 TI etc.). I have 2 external HDs that I could use, one for Backup and one for the actual Photos/Edits. I'll probably need to use it as my internal HDs are quite full, and I can't just delete stuff or move it to an (Developer programs, Lossless music, etc.).
    Based on this, how do I back up the whole thing e.g. Photos folder (all photos and edits, and preferably presets too)?

    I believe it should be possible to work cross-platform without having to relink files each time, or without having to keep exporting/importing the catalog, by keeping the single catalog and the image library on the one external drive which is then switched between systems as needed.
    Obvious first requirement is an external drive that is formatted in such a way (e.g FAT32) that it can be used on both platforms in read/write mode. Given that, if the catalog AND the images parent folder are both established at the same level in one overall parent folder, then it should be possible to take advatage of Lightroom's ability to use relative paths rather than absolute paths to detect the images, no matter if the drive is named (Mac) or lettered (PC). This is how "export as Catalog" works, i.e. it creates a "package", aka a parent folder, containing the catalog and a replica of the exported images folder hierarchy alongside the catalog. Take that "package" to another system (same OS or not) and "it just works" even if the drive letter is different or the OS is different....because the relative path from catalog to images is still the same.
    I haven't tested this cross-platform (though I have between different PC systems with different drive letters) so for me it's still just a theory, but there may be others who have done this successfully.

  • How do I stop system sounds when using AirPlay on my MacBook Pro?

    Hi all,
    Probably a quick question, but I'm fairly new to Macs. I've a Macbook Pro 13 Late 2011 and now I've got an Apple TV, I use AirPlay. But how do I stop system sounds when using AirPlay?
    Many thanks in advance, Jon.

    Open AirPort Utility located in HD > Applications > Utilities
    From the AirPort Utility menu bar click AirPort Utility > Preferences
    Deselect:   Monitor AirPort base stations for problems

  • How to make Avery 8160 address labels using pages

    Anyone know how to make Avery 8160 address labels using Pages? 

    Open the Avery 8160 Word template from their website.
    Peter

  • If i dont use the display when using the GPS and only listen to the voice instructions can that also makes the iphone overheat even if you dont use the display

    because when i use the gps app in my iphone 4s in the car my iphone gets overheat so
    if i dont use the display when using the GPS and only listen to the voice instructions can that also makes the iphone overheat even if you dont use the display
    will that help?

    When you use your GPS does your iPhone get hot enough to shutdown?  The reason I ask is that I have run my GPS app with the screen brightness set to near max connected to power for hours.  My iPhone got hot, but didn't shutdown.

  • How can I customize the toolbar when using the attribute browser

    In CVI 2012, the toolbar changes depending on the environment, e.g. it is different for the source window and the UI editor. The toolbar can be customized using the menu Options / Toolbar...
    Unfortunately, when using the attribute browser of the UI editor, another toolbar is displayed, i.e. not the UI editor toolbar.... I would have assumed that the attribute browser belongs to the UI editor, obviously it doesn't... So how can I customize the toolbar when using the attribute browser?
    Solved!
    Go to Solution.

    Luis,
    It's nice to have you back 
    Thank you for the clarification, so I'll elaborate a bit more: In the regular workspace toolbar, I have a disk symbol to save the file. This symbol is gone in the attribute browser...
    So I have three different toolbars, for source code (workspace), UI editor, and the UI editor displayed but the attribute browser clicked on (selected)... 
    Thanks
    Wolfgang
    Source code:
    UI editor:
    Attribute browser:

  • In windows 7, how to make firefox start automatically when I turn on the computer

    In Windows 7, how to make Firefox start automatically when I turn on the computer. Note, I am asking how to do this with Windows 7, not xp, not vista.

    You need to place a shortcut to open Firefox in the Start > Programs > Startup folder.<br />
    That is basically the same in all Windows versions.

Maybe you are looking for

  • HT1692 My Contacts synced once to my iPod, how do I get them to sync again with updates?

    My Outlook Contacts synced to my iPod once (after finally finding out how to so that). Since then it has never synced with Contacts again. It syncs the music just fine. Some instructions I have read mention an "Info Tab" after selecting the device. I

  • Recovering secure notes from keychain

    I recently had my 2011 Macbook Pro's logic board fail on me so I bought a new MacBook Pro and just finished restoring my old Time Machine Backup. Much to my dismay, all of my secure notes (and maybe some of my website passwords) are nowhere to be fou

  • Hard Drive Failing

    When I run disk utility I'm told there is a hardware problem with my hard drive and the S.M.A.R.T. status is listed as "Failing". Anyone have any suggestions other than to take the machine to an Apple Store?

  • MATERIAL DOES NOT EXISTS OR NOT ACTIVATED

    Dear Experts, I want to change Material Master data. I have downloaded the material list from data base table MARC plant data for materials. i want to  extend the material master view. but system is issuing the error message - Material dose not exist

  • Get IStyleInfo when observing style changes.

    Hello. Is there a way to get information on the processed style when adding/deleting/editing character and paragraph styles? I am using the doc observer and can act on these changes: { SDK_DEF_STRINGIZE(kDeleteParaStyleCmdBoss), 0x250 }, { SDK_DEF_ST