Is there any performance difference in the order of columns referencing index?

I wish to find out if there is any performance difference or efficiency in specifying those columns referencing index(es) first in the WHERE clause of SQL statements. That is, whether the order of columns referencing the index is important???.
E.g. id is the column that is indexed
SELECT * FROM a where a.id='1' and a.name='John';
SELECT * FROM a where a.name='John' and a.id='1';
Is there any differences in terms of efficiency of the 2 statements??
Please advise. Thanks.

There is no difference between the two statements under either the RBO or the CBO.
sql>create table a as select * from all_objects;
Table created.
sql>create index a_index on a(object_id);
Index created.
sql>analyze table a compute statistics;
Table analyzed.
sql>select count(*)
  2    from a
  3   where object_id = 1
  4     and object_name = 'x';
COUNT(*)
        0
1 row selected.
Execution Plan
   0      SELECT STATEMENT Optimizer=CHOOSE (Cost=1 Card=1 Bytes=29)
   1    0   SORT (AGGREGATE)
   2    1     TABLE ACCESS (BY INDEX ROWID) OF 'A' (Cost=1 Card=1 Bytes=29)
   3    2       INDEX (RANGE SCAN) OF 'A_INDEX' (NON-UNIQUE) (Cost=1 Card=1)
sql>select count(*)
  2    from a
  3   where object_name = 'x'   
  4     and object_id = 1;
COUNT(*)
        0
1 row selected.
Execution Plan
   0      SELECT STATEMENT Optimizer=CHOOSE (Cost=1 Card=1 Bytes=29)
   1    0   SORT (AGGREGATE)
   2    1     TABLE ACCESS (BY INDEX ROWID) OF 'A' (Cost=1 Card=1 Bytes=29)
   3    2       INDEX (RANGE SCAN) OF 'A_INDEX' (NON-UNIQUE) (Cost=1 Card=1)

Similar Messages

  • Is there any significant difference between the headphone jack for 120gb or 160gb

    hi all,
    Is there any significant difference between the headphone jack for all ipod classic models.
    please advise?
    really appreciate.
    thanks

    Other than possibly the part number, probably not.
    B-rock

  • Are there any functional differences between the trial and the paid version?

    Are there any functional differences between the trial and the paid version for Labview 2009?  Thank you.
    Solved!
    Go to Solution.

    This outlines the limitations of the eval version of Labview: Limitations of the LabVIEW Evaluation Version
    Cheers, 
    Misha

  • TS3989 Is there any way to choose the order of photos in a shared photo stream?

    Hi. I need to share a photo stream with many people and I need to group the photos together a certain way, but it won't let me rearrange them. There HAS TO be a way to do this, right Apple? I could with Mobile Me...

    Yes.  As I recall it's by date-ascending. You did create the PS from iPhoto, right?
    Assemble the photos in an album, arrange them manually in the order you want, select all and then use the Photos ➙ Batch Change ➙ Date menu option?  Give them all the same date with a minute between photos.
    Then create the PS with those photos. They will disiplay in the order you had them in the album.
    OT
    Message was edited by: Old Toad

  • Is there any performance difference between unique and no unique index

    Hi,
    We are working with both databases Oracle and MS-SQL and we have an open channel to MS-SQL server core team.
    We got the word from them that there is a difference between unique and no unique index from the optimizer perspective, i.e. the optimizer knowing that the index is unique may choose a more suitable plan for running a specific query, we're still trying to find a specific example.
    Anyway, since we do not have an open channel to Oracle core, I thought maybe one of you guys knows something about Oracle optimizer behavior on this issue.
    I am interested verified answers from certified sources and not suggestions or thoughts.
    Thanks in advanced,
    Tal ([email protected]).

    Maybe, you will like to check this link for a similar question answered by Tom Kyte
    http://asktom.oracle.com/pls/ask/f?p=4950:8:385900000490041683::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:7641143144618,

  • HT201448 Is there any way to Change the order of preference?  Ie wiki before Xcode?

    http://support.apple.com/kb/TS5239 states the order services take precedence.  I would like wiki to come first.  Is there a way to configure redirection?

    Hi,
         Sorry for not updating.  I did eventually figure it out.  There are two files you need to edit, one for HTTP (port 80) and one for HTTPS (port 443):
    /Library/Server/Web/Config/apache2/sites/0000_any_80_.conf
    /Library/Server/Web/Config/apache2/sites/0000_any_443_.conf
         Then edit the line:
    DirectoryIndex index.html index.php /xcode/ /wiki/ default.html
         If you want the /wiki/ to come first put it before /xcode/
    If you want the main page to load first put default.html before /xcode/
         I'm not sure if the Server.app will overwrite this line.  It might, but it doesn't seem to overwrite Include directives.  In apache, the conf file is scanned top-to-bottom, and later-occurring directives will override the same type declared earlier.
         So if the line you modify ends up being overwritten (or even if you just want to use an Include in the first place), then what you'd do is add a line to the bottom of the <VirtualHost> entry in the the *80.conf and *443.conf files like so:
    Include /Library/Server/Web/Config/apache2/local_configuration_80.conf
         Then in your local_configuration_80(/443).conf files (that you create) you'd put the DirectoryIndex directive with the order you want and that would always override the one set by Server.app.

  • Any way to change the order??

    I created a slide show with the 5.0 theme Portfolio, and in the midst of creating this the original page with the title and the portfolio on it only shows up after the slide show when I play it. Ive tried to just drag and drop it in front of the slide show but it wont work. Is there anything I can do other then start all over again?

    Is there any way to change the order of the items in the Files Inspector?
    Yes, but it must be done on a site-by-site basis.
    In the Site Definition dialog box, select File View Columns. You can control the position and display of columns there. The only one that can't be changed is Name.

  • Are there any technical Differences between stanard R3 and ISU

    Hello everyone,
    I have recently been speaking to a client who is running ISU.  They are asking for assistance with thier landscape from a technical perspective (BASIS and DB).  i.e. monitoring db growth, reorgs, etc.
    Now, I have been working in BASIS for over 10 years now, and am very comfortable with the above rols.  My question however is -  are there any "technical" differences between the standard SAP system, and ISU?  or are the differences mainly seen on the functional side?
    Thank you very much for any insight any of you can provide.
    Kind regards
    Richard Rog

    Hi Richard,
    I have been a Basis administrator for IS-U/CCS systems for 7 years.  The points Juris made are correct. 
    There are no new transactions or procedures for maintaining and monitoring an ISU system.  ISU "sits" on top of R/3.  The main ISU transaction for customer contact CIC0 has an HTML component that needs an ITS server.  In a 4.6C system you will need to maintain an external ITS.  In ECC 6.0 you will have an integrated ITS.  The main difference from a Basis perspective is support pack application. 
    In 4.6C ISU is an add-in installed in SAINT.  There are conflict resolution support packages (CRT's) that are installed at the same time the SAP_APPL support packages are applied.  In fact SPAM recognizes the ISU add-in and won't let you upgrade APPL (and sometimes Basis) support packs without the CRT's.
    In ECC 6.0 IS-U isn't an add-in any more and has it's own support packs in module IS-UT.  IS-U must be turned on though during an installation or upgrade.  This is done in SPRO with "Activate Business Funcitons".
    Dustin
    Edited by: Dustin Justet on Jun 27, 2008 10:47 AM
    Edited by: Dustin Justet on Jun 27, 2008 10:51 AM

  • Any way to change the order of the items in the Files Inspector? DW CS4

    Hi,
    I'm using Dreamweaver CS4 with my menus split virtically.
    Is there any way to change the order of the items in the Files Inspector?
    Specifially I'd like to have them in this order:
    | Local/Remote Files | Modified | Size | Type |
    The reason being that next to the 'Local Files' the 'Modified' column is most impotant for putting updated files/images, and in split vertical mode I have to scroll right to see the 'Modified' column.
    Is this a feature request?
    Rich

    Is there any way to change the order of the items in the Files Inspector?
    Yes, but it must be done on a site-by-site basis.
    In the Site Definition dialog box, select File View Columns. You can control the position and display of columns there. The only one that can't be changed is Name.

  • The order of columns in the report/drill down

    By using the command SAPBWGetDataProvider I can get a list of characteristics/structures and whether they are in the rows or columns but.....
    Is there any way to see the order, IE is there any way to extract the information to say Material Type is in the first column, Plant is in the second column etc....?
    Any help will be appreciated.
    Cheers
    Shep.

    FYI: Found the answer, it was in position 19 if position 4 is filled with an X(Row) or Y(Column).
    Shep.
    Message was edited by: Neal Sheppard

  • Does the order of columns in an index matter?

    Hi,
    I have a table having composite index, five columns. (col1,col2,col3,col4,col5)
    Currently , my index is beginning with the column which having low distinct values and so on.
    ( in my case the first column have 1 distinct values due to functional behavior ). the second column have 3 distinct values , the third column have many distinct value ( half of the table).
    There are many DML queries on this table with different clauses.
    Examples:
    query 1 : where col1 =val1 and col2 = val2
    query 2 : where (col3,col4) in ( select col1,col2 from another_table ) ( for this we can add col1 =val1 and col2 = val2)
    My question is : what this best way to create index on this case ?
    The order of columns on index depends on its distinct values?
    Thanks

    BIJGA wrote:
    Hi,
    I have a table having composite index, five columns. (col1,col2,col3,col4,col5)
    Currently , my index is beginning with the column which having low distinct values and so on.
    ( in my case the first column have 1 distinct values due to functional behavior ). the second column have 3 distinct values , the third column have many distinct value ( half of the table).
    There are many DML queries on this table with different clauses.
    Examples:
    query 1 : where col1 =val1 and col2 = val2
    query 2 : where (col3,col4) in ( select col1,col2 from another_table ) ( for this we can add col1 =val1 and col2 = val2)
    My question is : what this best way to create index on this case ?CREATE INDEX
    The order of columns on index depends on its distinct values? yes
    Handle:     BIJGA
    Status Level:     Newbie (5)
    Registered:     Aug 24, 2009
    Total Posts:     66
    Total Questions:     18 (14 unresolved)
    I extend my condolences to you since you rarely get answers to your questions.

  • Is there any constrain in using the same order type for MTS and MTO

    Hi,
    i have the constrain to use single production order type .
    Can i use single order type for MTO and MTS.
    is there any constrain in using the same order type for MTS and MTO.
    pls help me.

    Hi,
    There is no constraint or limitation in using the same production order type for MTS and MTO . Settings in requirement class and material master will mainly control whether the flow is MTS or MTO.
    Regards,
    Mrinal

  • If I backed up with a newer version of iOS than the phone I am trying to backup to.. Is there any way to bypass the setup assistant in order to download the new iOS on the new phone then go back and restore from my old phone?

    if I backed up with a newer version of iOS than the phone I am trying to backup to.. Is there any way to bypass the setup assistant in order to download the new iOS on the new phone then go back and restore from my old phone?

    Try deleting your last backup by turning off iCloud Backup in Settings>iCloud>Storage & Backup, then tap Manage Storage, swipe across your backup and tap Delete, then go back and turn iCloud Backup back on again.  If it still won't back up, you may have an app that is preventing the backup from succeeding.  To locate which one, go to Settings>iCloud>Storage & Backup>Manage Storage, tap the name of your device under Backups, under Backup Options tap Show All Apps, then turn them all to Off (including camera roll) and try backing up again.  If it succeeds, then the camera roll and/or one of your apps is preventing the backup and you'll have to located by process of elimination. Turn the camera roll On and try backing up again.  If it succeeds, turn some of your apps to On and try backing up again.  If it succeeds again, turn some more apps to On then try again; repeat this process until it fails.  Eventually you'll be able to locate the problem app and exclude it from your backup.

  • Is there a performance difference between Automation Plug-ins and the scripting system?

    We currently have a tool that, through the scripting system, merges and hides layers by layer groups, exports them, and then moves to the next layer group.  There is some custom logic and channel merging that occasionally occurs in the merging of an individual layer group.  These operations are occuring through the scripting system (actually, through C# making direct function calls through Photoshop), and there are some images where these operations take ~30-40 minutes to complete on very large images.
    Is there a performance difference between doing the actions in this way as opposed to having these actions occur in an automation plug-in?
    Thanks,

    Thanks for the reply.    I ended up just benchmarking the current implementation that we are using (which goes through DOM from all indications, I wasn't the original author of the code) and found that accessing each layer was taking upwards of 300 ms.  I benchmarked iterating through the layers with PIUGetInfoByIndexIndex (in the Getter automation plug-in) and found that the first layer took ~300 ms, but the rest took ~1 ms.  With that information, I decided that it was worthwhile rewriting the functionality in an Automation plug-in.

  • Is there any way to tell the differences between auroras or betas?

    There are various arouras and betas released during each rapid release cycles.
    Is there any way to tell the differences (changes/fixes) between auroras or betas?
    bugzilla can only tell the target for landing but not releases for some of the changes/fixes ...

    The Beta builds of a version has about six to twelve with nine being the average in last while until the 34.0 Betas. For Aurora which now currently called Developer Edition has checkins almost everyday so therefore there are updates each of those days.
    For Beta builds you can look at http://release.mozilla.org/ and http://hg.mozilla.org/releases/mozilla-beta/
    For Aurora you can look through http://hg.mozilla.org/releases/mozilla-aurora/
    If you want to be a Tester then perhaps http://forums.mozillazine.org/viewforum.php?f=23 may be of interest as many Testers hang out there.

Maybe you are looking for