How to assure index is being used for Query

Hi All,
Indexed are best way to speedup the data retrieval process selectively.
however i wanted to how to trace that weather index is being used in a particular query.
1. Table tab1 has composite index on a and b.
2. Select a,b,c from tab1 where a>500 ;
Will this query use index create from 1 ?
Conceptually it should not because where as part contains only field A where as index is composit on field A and B.
However , i wanted to know to trace that a perticual query is using index or not ?
This question was asked to me in an interview.
Pls le me know at [email protected]
Thanks in Advance
Alok

Hi,
Use explain plan to know if index is use.
As you can see in the following example, even if index is composed and I use only a part in query, index can be used :
SQL> create table test (col1 number, col2 number, col3 varchar2(10));
Table created.
SQL> insert into test select object_id, data_object_id, substr(object_name,1,10) from dba_objects;
70211 rows created.
SQL> create index idx on test(col1,col2);
Index created.
SQL> explain plan for
  2  select col1,col2,col3 from test where col1 > 500;
Explained.
SQL> @$ORACLE_HOME/rdbms/admin/utlxpls
PLAN_TABLE_OUTPUT
| Id  | Operation                   |  Name       | Rows  | Bytes | Cost  |
|   0 | SELECT STATEMENT            |             |       |       |       |
|   1 |  TABLE ACCESS BY INDEX ROWID| TEST        |       |       |       |
|*  2 |   INDEX RANGE SCAN          | IDX         |       |       |       |
Predicate Information (identified by operation id):
PLAN_TABLE_OUTPUT
   2 - access("TEST"."COL1">500)
       filter("TEST"."COL1">500)
Note: rule based optimization
16 rows selected.
--If stats are collected, index is no more used
SQL> analyze table test compute statistics;
SQL> explain plan for
  2  select col1,col2,col3 from test where col1 > 500;
Explained.
SQL> @$ORACLE_HOME/rdbms/admin/utlxpls
PLAN_TABLE_OUTPUT
| Id  | Operation            |  Name       | Rows  | Bytes | Cost  |
|   0 | SELECT STATEMENT     |             | 69808 |  1227K|    16 |
|*  1 |  TABLE ACCESS FULL   | TEST        | 69808 |  1227K|    16 |
Predicate Information (identified by operation id):
PLAN_TABLE_OUTPUT
   1 - filter("TEST"."COL1">500)
Note: cpu costing is off
14 rows selected.
--But if you use an equlity in your query instead of >, index is still used
SQL> explain plan for
  2  select col1,col2,col3 from test where col1 = 500;
Explained.
SQL> @$ORACLE_HOME/rdbms/admin/utlxpls
PLAN_TABLE_OUTPUT
| Id  | Operation                   |  Name       | Rows  | Bytes | Cost  |
|   0 | SELECT STATEMENT            |             |     1 |    18 |     3 |
|   1 |  TABLE ACCESS BY INDEX ROWID| TEST        |     1 |    18 |     3 |
|*  2 |   INDEX RANGE SCAN          | IDX         |     1 |       |     2 |
Predicate Information (identified by operation id):
PLAN_TABLE_OUTPUT
   2 - access("TEST"."COL1"=500)
Note: cpu costing is off
15 rows selected.
SQL> Nicolas.

Similar Messages

  • I keep getting a message about my phone number being used for iMessage on a new iPhone. How can I see what devices are using my iMessage account and phone number?

    The message "Your phone number is now being used for imessage on a new iPhone" Keeps appearing on my macbook pro. It also says "If you just activated iMessage on a new iPhone, you can ignore this alert." But the only option is to ignore the alert, because the only thing I can do with it is click "ok" and dismiss it. Is there a way I can look at a list of the devices using my iMessage account, and if there are devices that I don't recognize on that list, how can I block them from using my account?

    Hi If you have another Apple  device check on that screen & accept. Cheers Brian

  • HT5878 how to check the detail of font being used for reading the file received by an email

    I received word file as an attachment with email on my iphone. I want to check the detail on font being used for reading the word file received as attachment in an email.
    Thanks

    You don't need to copy the cert out of your configuration. OpenSSL has an "s_client" subcommand which can open an SSL connection and verify the cert for you. It even knows how to do STARTTLS. Something like this ought to do it:
    openssl s_client -starttls smtp -CAfile /path/to/ca/file -connect your.ironport:25
    The /path/to/ca/file is necessary to provide openssl with a cache of root CA certs. You could use -CApath instead of -CAfile if you have a hashed directory of root CA certs instead of a single file containing them all.
    You can also point this at your partner's SMTP server as well.

  • HT4203 I have turned off the Data use on the I-phone 4s but am told by AT&T that data is still being used for applications.  How is this possible. Can someone help me understand this.  Thanks.

    I have turned off the Data use on the I-phone 4s but am told by AT&T that data is still being used for applications.  How is this possible. Can someone help me understand this. 

    I assume you are including the STIX font as part of your epub files?     
    Perhaps the folks who do this blog might be able to help -- they have done some work with font embedding:
    http://www.pigsgourdsandwikis.com/2011/04/embedding-fonts-in-epub-ipad-iphone-an d.html

  • HT1689 I don't want my visa being used for ITunes.  I have an ITunes card.  How do I prevent ITunes from using my Visa

    I don't want my visa being used for ITunes.  I have an ITunes card.  How do I prevent ITunes from using my Visa?

    It automatically uses the gift card balance first.

  • How to know which Smart-Form is being used for Purchase Order print output

    Hi Gurus ,
    How to find which Smart-Form and and methods/program being used for Purchase Order print output in SRM  ?
    In ECC we have tcode NACE where we can check all the details.Is there something similar in SRM ?
    Please help.
    Regards,
    Saurav

    There is no similar transaction in SRM for your purpose. Usually if the customers customize the smartforms, they would choose to use their own form by implementing BADI BBP_OUTPUT_CHANGE_SF. Take a look into your system and see if this BADI is implemented. If so, debug it (by pressing "Print Preview" for a PO for example) and find out what form it is using. Or, if the BADI is not implemented, by default, the system uses form BBP_PO.

  • TS4268 I recently lost an IPad mini before I could get all the icloud, etc. tracking set up.  I recently received a notice that it is being used for facetime/imessage.  Does anyone know how I could track the person now using my ipad mini?

    I recently lost an IPad mini before I could get all the icloud, etc. tracking setup.  I received a notice that it is being used for facetime and imessage - is there a way I can find out who is using my ipad mini?

    Report to police along with serial number. Change all your passwords.
    These links may be helpful.
    How to Track and Report Stolen iPad
    http://www.ipadastic.com/tutorials/how-to-track-and-report-stolen-ipad
    Reporting a lost or stolen Apple product
    http://support.apple.com/kb/ht2526
    Report Stolen iPad Tips and iPad Theft Prevention
    http://www.stolen-property.com/report-stolen-ipad.php
    How to recover a lost or stolen iPad
    http://ipadhelp.com/ipad-help/how-to-recover-a-lost-or-stolen-ipad/
    How to Find a Stolen iPad
    http://www.ehow.com/how_7586429_stolen-ipad.html
    Apple Product Lost or Stolen
    http://sites.google.com/site/appleclubfhs/support/advice-and-articles/lost-or-st olen
    Report Stolen iPad
    http://www.stolenlostfound.org/report-stolen-ipad
    Oops! iForgot My New iPad On the Plane; Now What?
    http://online.wsj.com/article/SB10001424052702303459004577362194012634000.html
    If you don't know your lost/stolen iPad's serial number, use the instructions below. The S/N is also on the iPad's box.
    How to Find Your iPad Serial Number
    http://www.ipadastic.com/tutorials/how-to-find-your-ipad-serial-number
    iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number
    http://support.apple.com/kb/HT4061
     Cheers, Tom

  • How do I prevent my hard drive being used for time machine back ups?

    I want to install Snow Leopard but it tells me that the OS cannot be installed because the disk is being used for Time Machine back ups. I don't recall setting up my hard drive to be used this way (why would I?!) but now I can't seem to

    Did you have TM turned on at any time? If so, and if you had no external hard drive attached, could it be that it created its own backup on a portion of your hard drive? I don't use TM, but I believe I read that this may be possible. Take a look at Disk Utility (Applications > Utilities) and report what you see on the left - under the top heading, is there more than one partition showing, such as here:
    (I have two partitions: one for Snow Leopard, the other for Lion) - what does yours show?

  • My iPhone 4s keeps showing more space being used for photos than i have - i have deleted cache folders, unselect and reselect in iTunes and nothing appears to work my iPhone still shows 6.5 gig use of photos when i only have the  camera roll listed

    my iPhone 4s keeps showing more space being used for photos than i have -
    i have deleted cache folders, unselect and reselect in iTunes I read one post
    where they said keep syncing and in a couple days it would correct itself, that
    hasnt happened.  I have see others have the same issue but no solution and nothing
    appears to work my iPhone still shows 6.5 gig use of photos when i only have the camera roll listed

    i thought the photo stream only holds 1000 i usuaaly take each month and save them to iphoto but if thats the my ipad should say the same amount and it doesnt - it shows 2.5 gig which is correct for iphoto.  and i havent ever had that much but if for some reason icloud has that much saved how do i delete and again if it does why doesnt ipad show that amount _ HELP!

  • How much memory are actually being used? db_32k_cache_size

    Hi everyone,
    Using Oracle 10g on RHEL 5.3.
    I've been asked to check how much memory are actually being used by our db cache's. Currently we are using the parameters db_32k_cache_size (user-defined) and db_8k_cache_size (default) both allocated with 12gb. Now I want to know if there is any way to find out how much of the 12gb are actually being used by the cache.
    Is this possible?
    Thanks

    Thanks Guys,
    Okay, so it is using the whole 12gb. I guess the next question would be, is 12gb really needed? You see, we are trying to increase memory where possible as this database has performance issues. Now we are thinking of taking some of the 12gb that is allocated to the 32k cache and assign it to the sga for instance.
    Does this make any sense?
    Regards

  • IllegalStateException:output stream is already being used for this request

    How to read binary data in JSP. I know, in servlets it can be done and JSP can handle only character data. When i try to open res.getOutputStream(), it is throwing the following exception:"IllegalStateException:output stream is already being used for this request". Is there any workaround in JSP?

    Can you save the file to a location in your server ? Even if you are creating a dynamic image, all you get is a byte array which can be stored in your server. If you can do so, you can set the content type and display the content as mentioned above.

  • How can a structured frame be used for translating books to foreign languages?

    I keep reading about how a structured approach can improve the translation process (from english to foreign languages), however, i can't seem to find specifics about a particular method or tutorials about how to go about it (specifically). My question is, how (specifically) can structured framemaker be used for translation from english to foreign languages?  Links to tutorials on this issue would be greatly appreciated. Thank you.

    @Ian Proudfood
    A well organized XML based project will definitely save translation costs. There are many advantages to the XML approach to translation management including:
    Almost zero DTP rework costs - make the EDD/Template do all of the work!
    Translation is application version independent - no need to wait for the Translation Memory/CMS system vendor to support the latest version of FrameMaker.
    »... a well organized XML based project will definitively save translation costs.« – I have read sentences like this from a lot of consultants. And I have consulted/supported a lot of customers after those consultants left the stage. I always hear more or less the same from all of those clients. No question, I hear a lot of arguments for working with XML in tech doc, most of the arguments you mention included. Most of the tech writers are happy with the new structured FrameMaker and enjoy writing. And, cross your heart: Finally there's no alternative to XML in the long term if you take your tech writer job seriously. No question – working with pure XML in a professional information architecture in a structured, guiding editing environment like FrameMaker is cool, fun, faster and produces more open, more accessible, more reusable, more reliable, more consistent, in a nutshell: more valuable data.
    But what I have never ever heard, and I'm talking about several hundred companies, is: We save more money on translation now. You might imagine that this is surprising me since many years. This is why I always ask: Did you save any costs in your translation projects? Surprisingly the answer is always: No. Actually some – no, wait: many – tell me, that their translation agency even charges more now, because they have a lot of new costs:
    Costs, to customize their translation memory system to the clients custom xml,
    costs to follow badly or not documented changes in the client's xml structure (DTD/Schema changes) in the TMS,
    costs because of more engineering work like 
    valididating xml in advance,
    fixing invalid xml exports,
    fixing invalid translations due to – sometimes massively – increased amount of tag errors because of tagging differences of "old" (legacy mif) and "new" (xml) tags,
    dealing with just too big XML files that need to be carefully split, so that the TMS has a chance to read it, or alternatively:
    "glue" the ten-thousand xml "snippets" to more handy chunks,
    project managers and translators that need to do additional checks, validations, verifyings - and often not knowing what to do with those cryptic error messages, meaning additional support costs
    Of course, many if no all of these and many other problems I did not mention here can be solved. And many are not exactly system immanent problems but communication problems (like introducing or renaming elements/attributes but not documenting this and not communicating this to the translation service provider) or would apply to any system change (e.g. also when switching from Word to Frame). However, I do not know of any single translation company on this planet (and I know virtually thousands of them from countries all over the world) that reduced the price per word for just a single pence, just because the client switched over from Word/Quark/FrameMaker/InDesign/Whatever to XML.
    Just ask your translation service provider: Will you charge me less per word if I send you XML instead of MIF? I would really be surprised to hear a "yes". And frankly, if you have ever compared a professional FrameMaker document with the same document in xml format in a professional system like Trados: There is actually no difference that would justify any price difference. The text is the same, the amount of words identical, the number of tags is identical, it even looks identical in the translation system (I can post screenshots if you like). From the translation perspective there is no single reason why a translator should charge a single pence less.
    So, it's a modern myth, that switching to xml reduces translation costs. That might be true, if you come from a really medieval documentation szenario with MS Word or the like, with manual formatting without any styles and so on (I see tech docs every day where even the TOC is typed in manually!!!) and swith from there to a modern structured xml authoring in combination with other supporting tools like authoring memory / authoring assistance, controlled language, translation memory and terminology managent and control, snippet based content management and so on. That will increase the consistency and quality of your data, which will reduce translation costs in the long term. But the truth is: This has nothing to do with XML per se, but with professional writing and professional management.
    So, what's left in the money saving story? No more DTP in the target languages? I always hear, that with XML and FrameMaker you do not have to "format" the translated document. The truth is: If you have a professionally formatted (unstructured) document, you don't have to take care of it, too. Modern tools like Trados keep 100% of the formatting 100% correct in the translated document. If the underlying template is intelligent enough to take account of text amount changes due to longer translations, and if you don't have too many local formatting overrides, the DTP is actually zero and can be reduced to a few mintes/hours for "flying" of the document to check out for unexpeted problems wich can occure in both structured and unstructured documents.
    Just to give some numbers on this: We are processing every day technical documentations for a quite big company. A typical documentation from them is about 250 pages in unstructured FrameMaker 9 (source language is English). Until now they were resistent to all my XML pushing. The Documentation is based on a straight, simple template (with our help "reduced to the max") and there are no formatting overrides (a script automatically checks this). The post translation Quality Assurance effort is - depending on the target language - usually something between 1 to 4 hours – that's a few seconds per page for the languages where already a lot of past Quality Assurance Steps went back into the Translation Memories and up to a minute per page for more "problematic" languages).
    So, again: XML will not save you a single pence on translations. But it might help you to produce more open, more accessible, more reusable, more reliable, more consistent, in a nutshell: more valuable data. But if you already have properly set up (ustructured) FrameMaker Documents and already work with a professional translation memory system, you will be quite disappointed to learn, that the impressive money saving promises you recently saw on that great PowerPoint slides melt down to a few bucks over a couple of years.
    Kind regards,
    Stefan Gentz

  • He iTunes Store account entered is already being used for an iTunes Connect account that distributes Apps

    I am getting the following message when trying to sign up with iTunesConnect for selling our companies eBooks.
    "The iTunes Store account entered is already being used for an iTunes Connect account that distributes Apps. To continue with this application, you must enter a different iTunes account."
    The email account I am using is not being used for distributing apps. We need to sell ebooks.
    We DO have a developer account to sell apps but it is a different email address (confirmed).
    How should I go about getting this straitened so we can get into iTunesConnect?

    That worked, thank you very much! The Apple support document is quite misleading then.

  • Received notification that Your Apple ID is being used for iCloud on a device that I do not know

    I have received notification that my Apple ID is being used for iCloud's on a new iPod touch. I do not recognize the device. This is the 2nd notice the first time I changed our password. How do we remove this device.

    Change the password without using email authentication as discussed here: Apple ID: Changing your password in case the other person has access to your email account.  If you aren't able to do that, contact the Apple account security team for assistance: Apple ID: Contacting Apple for help with Apple ID account security.

  • My ipad 2 will cut off completely if not being used for a while. you have to hold power button to power up everytime. anyone else having this problem? thanks

    My Ipad 2 will shut completely down if not being used for a while. You have to hold power button down for several minutes before it will power back on. anyone else have this problem and know how to fix?  My other sons ipad 2 doesnt do this and they have both had updates and are same generation.
    Thanks 

    I had major issues with the iPhone 4s battery, however it’s resolved.
    The tech who set the phone up at the Apple store did so with little training.
    if you have a mobile me account. First go and move all your data to the cloud by going on your computer and logging in at me.com/move. The cloud has replaced mobile me, so there is no need for those two accounts
    Also make sure that for any of your email accounts you set them up to fetch, not push. My tech person set them all to have the email servers push data to the phone. The new iphone4s antenna is extremely strong so it will continually try to access stuff that is pushed–***** a lot of battery life doing this. It makes it worse if you have exchange 2010 accounts. Something about changes made to exchange really suck battery life from devices that access such accounts.
    turning of locator and the push notifications from facebook--they have a lot!

Maybe you are looking for

  • Problems with import of static files/images

    I have a series of static files (such as jquery/jquery ui libraries) that we have been storing in WORKSPACE_IMAGES. We had hoped to be able to export the static files and use our automated build process to import the files via sqlplus. However, I hav

  • Select instance of polymorphi​c vi at compile time

    quick question: I have a fairly significant labview project that i'm deploying to several compactRIOs.  However, I have two possible configurations of that code.  The difference between the two configurations is a single VI.  That is, within my proje

  • How to identifyt he strock color in pdf

    cs11 cs 1 scn given in pdf document i can't able to find strock color so please help me to find it. cs11 contains color space dictionary and how i find color from it using scn value

  • View of previous messages blocked.

    When I type longer SMSes or compose MMSes, it blocks the view of previous messages. Is there a workaround for this? If I'm right it wasn't like this in earlier versions of Messages. Sorry if it's already been asked, I tried looking but there are 3k t

  • Problem in  alignment of cell content in Advanced Table

    Hi, I have a column which has some flag say 'Y' or 'N'. I have created an advanced table and followed the dev guide for aligning the value in the center of the cell.But i m getting null pointer exception when I m using getColumnFormats method of adva