Which index will it take and why ?

Hi, 
I have a table Employee and i have an index on EmpID on this table. Now i have created a view EmpView on this table. I have created an index on this view for the same column EmpID.
Now my question is If i query select * from Empview where empId = something then which index will it consider and why?? 
Thanks in advance
Balaji 
Balaji - BI Developer

Good day Balaji
Prasad 
1. How long it took you to write the question in the forum?
You are asking about specific case in your database. I am sure that you could open click on the Execution Plan button and get a faster answer and much more accurate for your specific database. Not always the forum is the best and faster solution, sometimes
you can get it yourself.
Regarding the "why", it is a good question :-)
please post DDL+DML
2. As other mentioned if you want help regarding a query then we need to be able to reproduce the situation. Instead of stories on your tables, you could post the DDL+DML queries :-) that mean the create table (with indexes) query and the insert sample
data query. With this information we can click the Execution Plan button in our server :-)
Moreover, with DDL+DML we might suggest a better solution
  Ronen Ariely
 [Personal Site]    [Blog]    [Facebook]

Similar Messages

  • How can i know which index will be used when executing the query ?

    1 ) I have query in which i have 3-4 tables but there multiple index on one column .
    so how can i know which index will be used when executing the query ?
    2) I have a query which ia taking too much time . how can i know which table is taking too much time ?
    3) Please Provide me some document of EXplain plan ?

    Hi Jimmy,
    Consider the below example
    /* Formatted on 2011/02/04 21:59 (Formatter Plus v4.8.8) */
    CREATE TABLE FIRST AS
    SELECT * FROM all_objects;
    UPDATE FIRST
    SET object_name = 'TEST'
    WHERE owner != 'SCOTT';
    CREATE INDEX idx_first ON FIRST(object_name);
    SELECT *
    FROM FIRST
    WHERE object_name = 'TEST';
    It has not used index
    Execution Plan
    Plan hash value: 2265626682
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 58678 | 7334K| 163 (4)| 00:00:02 |
    |* 1 | TABLE ACCESS FULL| FIRST | 58678 | 7334K| 163 (4)| 00:00:02 |
    /* Formatted on 2011/02/04 21:59 (Formatter Plus v4.8.8) */
    SELECT *
    FROM FIRST
    WHERE object_name = 'emp';
    This has used the index
    Execution Plan
    Plan hash value: 1184810458
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 128 | 1 (0)| 00:00:01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| FIRST | 1 | 128 | 1 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | IDX_FIRST | 1 | | 1 (0)| 00:00:01 |
    From this we can come to the conclusion that, whether to use one index or not by oracle
    would also depend on the data which is present in the table. This has to be this way as
    we see in the bind peeking, if oracle sticks to only one plan, say only use the full table
    scan, it would be a performance hit when it searches for the second query ie where object_name
    ='emp';
    2.
    If we have a query like below.
    select * from emp
    where upper(ename) = upper(:p_ename);
    Evenif we have the index on ename column, oracle wouldn't be able to use the index, as there is a function in the predicate column. If you need oracle to use the index, we need to create a function based index as below.
    Create index idx_ename on emp(upper(ename));
    Regards,
    Cool

  • Cash sales which account will be debit and credited

    Hi All,
    Please let me in the special sales process.
    1. Cash sales
    2. Rush order.
    1When do the cash sales which account will be debit and credited.
    2. When do the rush which account will be debit and credited.
    Aditya.

    Hi,
    Rush order is like a normal standard sales order.
    Customer A/C - Debited
    Revenue A/C - Credited
    Cash Sales:
    Cash A/C - Debited
    Revenue - Credited.
    Revenue accounts are like discounts, prices, frieght...Etc

  • I have ip 3gs and ios 4.1 i want to upgrade it to download latest version of apps ,which ios will be compatible and is there any danger to update ios before i erased all settings and content and i tried to update but it failed .it is working properly

    i have ip 3gs and ios 4.1 i want to upgrade it to download latest version of apps ,which ios will be compatible and is there any danger to update ios before i erased all settings and content and i tried to update but it failed .it is working properly but i want to update from itunes.iwill do back up but is there any other thing i will face after updating like it will jut show apple loge and will not work. please answer quickly

    An iPhone 3GS is too old to update to the very latest iOS and you will never be able to use apps that are compatible.  The phone is just too old now in technology terms and the app makers have all moved on, so it's time to get a new phone. 
    Ideally, perhaps get an iPhone 4s or if you can afford it, an iPhone 5s or 5c which are the newest models.

  • Which  variables will not take part at the time of object seralization

    could any body tell me which variables will not take part at the time of object seralization

    -transient
    -non serializable class (basic class like String is ok)

  • MIDI CONTROLLERS WHICH ONE WOULD YOU CHOSE AND WHY?

    Between M-Audio 8v2 , M-Audio 02 , M-AUDIO 49E and M-Audio axiom 25. Which one of these would you choose and why?

    The Axiom 25.
    For the rotary encoders, pads and memory.
    I'd take this over the 49 because both of the keyboards will be pitiful and your better of getting a full size board with hammer action if its about the "piano" feel. These things are great to have at hand when fiddling with synths while setting up in logic.

  • Linux on Primary Or Logical? which is better?? and why?

    hello,
    what is the best way to install linux ( redhat,oracle enterprise ,etc)
    on primary partition or logical partition ? and why?
    i have 3 hd's ( hda,hdb,hdc) >> ( 40 GB,80GB,320GB) IDE
    why im asking this becoz i installed linux more than 3 times lately and i always ended up with GRUB errors and problems
    any idea plz shed some light on this
    need your experience regarding the optimal solution to install linux along with Windows OS
    thanks and regards,

    Hi,
    Q: what is the best way to install Linux ( redhat,oracle enterprise ,etc)
    A: Almost no difference between Redhat and Oracle Enterprise Linux. But Oracle has patched some additional patches for Oracle database based on Redhat released Enterprise Linux. If you would have subscribed Oracle Unbreakable Linux Network(ULN), which make it easier to update the system and deploy Oracle database. For more details refer to http://linux.oracle.com
    Q: On primary partition or logical partition ? and why?
    A: Your boot partition ought to be a primary partition, not a logical partition. So if you want to boot your operating system from the drive you are about to partition, it should be installed on primary partition. Otherwise, you can install it on logical partition.
    Q: why im asking this becoz i installed linux more than 3 times lately and i always ended up with GRUB errors and problems
    A: For this issue, what kind of GRUB error had you experienced? What the result after re-installing the grub?
    Happy new year!
    Terry

  • RFC and Webservice which one i should use and why?

    Hi,
      I have to write a extractor program in BI which would be fetching a huge data from CRM.
      I have two options to achieve this targer.
               1-> Create a RFC which will give me all the data
               2-> Create a Webservice in CRM and use it in BI
    Please advice me , which way i should go and advantage of that way.
    Regards
    PG

    Hi,
    If amount of data is huge then it is recomnded to use RFC because of its speed and reliability. Webservice not yet proven good for extracting and handling very large chunk of data.
    Regards,
    Gourav Khare

  • Which CC do you prefer and why?

    Choices are:
    Built-in CC effects of PR
    SpeedGrade
    RedGiants Magic Bullet
    Synthetic Aperture Color Finesse (requires QT)
    Given the 4 options shown above, what are your preferences and why? I know this is a broad question, but I would be interested to hear your opinions.

    Hmm. I am not sure how to answer. Back when I used CS3 I used Magic Bullet and I had no direct experience with the others at that time.
    Magic Bullet is easier to use, in my opinion, but that is not always going to make it the right choice.

  • Spotlight is indexing but what? And why does it want access to the web?

    I can see Spotlight is indexing, it spends several hours a day doing this, every day.
    Where can i find more details like previous OS X versions? Which drive, how much time left etc.
    Console was no help, any suggestions welcome.
    Also, with "Spotlight Suggestions" and "Bing Web Searches" disabled in the Spotlight Search Results references, why is the process "Spotlight Web Content" still trying to access the web several times a day? I am not using Spotlight when this happens nor am i trying to preview any files that have web content in them. Most commonly it tries to connect to static.amazon.com on the http port.

    In System Preferences > Spotlight > Search Results, if you have "Bookmarks and History" checked, then the "Spotlight Web Content" background process will crawl any web page that you recently visited to index its keywords. Uncheck that to turn it off.

  • Which is better for gaming and why?

    Hi,
    I was researching budget gaming laptops(around $1000, INR 55000) and came up with two choices.....
    1)HP Pavilion g6z-1d00 Notebook PC
    http://shopping2.hp.com/en_US/home-office/-/products/Laptops/HP-Pavilion/A2B39AV?HP-Pavilion-g6z-1d0...
    2)HP Envy 14-2130nr Notebook PC
    http://shopping2.hp.com/en_US/home-office/-/products/Laptops/HP-ENVY/QE295UA?HP-ENVY-14-2130nr-Noteb...
    Could anybody please tell me which is better for gaming (main purpose and best performance)?
    The HP Envy looks great but I don't know much about AMD Quad Core.....
    Also, is it possible to upgrade the graphics card on the HP Envy ( AMD Radeon 6630 to a better one) via a HP centre?
    It seems to run most games quite well, but I need it to be able to play new games for at least 4 years more (college), while not factoring in the costs for any possible graphics card upgrade....
    Please help!!

    Thanks Huffer _ very useful.
     I wasn't aware that there was a heat problem with the i7 processors, my dv8 runs at around 42 to 52 degrees, mind you I don't really put it under much load. I use it to play Blu-ray ISO files on my projector and for photo editing (Adobe CS4), it's an 820QM.
     I have also changed the thermal compound to ICDiamond and drilled holes in the speaker cover to improve air flow, that made a difference too.
     @ abhishekmaha
     Don't take my comment to seriously, although I think it has some truth to it, it was meant to poke a bit of fun at you. 
     Heat has always been one of the biggest factors when it comes to any computer, designers try to make them thinner, lighter and cheaper and those types don't work for gaming very well. They're OK for the occasional one, but not on a regular basis. I believe that if you game on any machine that was not meant for it, you will not get 4 years out of it _ 2 years.
     I wish I could tell you different, but I am not going to lie to you.
     Heat basically affects 3 things on a laptop, the solder that holds the components on the motherboard, any mechanical moving parts, eg the hard drive, fan _ and the battery. You can remove the battery to prolong its life when gaming.
     Heat breaks down the solder over time and the mother board simply stops working as far as the hard drive, it stops spinning because the tiny bearing(s) in there dry out and seize up.
     If you don't want to use a cooling mat then prop up the back of the laptop, hanging it over the edge of the table will expose the fan intake, but will block off other vents.
     60 degrees is a bit warm too, 50 is better or rather, the cooler the better. What ever machine you get, make a note of what the temps are when you first boot up and when it's hot. The idea is to get an average so you can judge when it is dangerously getting hot.
     P.S. Be sure and give Huffer a kudos too.

  • Which infrastructure are you using and why?

    Dear Portal Experts,
    I would be most interested in learning which tools portal developers are using in their daily work. I have therefore started a survey at the Collaboration Workspace (actually a discussion - 'survey' was not available).
    I would be happy if the readers of this forum could also participate to collect this information.
    Thanks a lot,
    Björn

    Still kinda debating on the two. I have the 8GB 3G right now and don't fill it up a lot.. but I also have another MP3 player that i keep my music on and don't take a ton of pictures. But I know with the better camera and video recording, I will be using it a lot. I am pre ordering tomorrow, but still undecided. Just don't know that I want to spend an extra $100. I can always transfer my pictures to my computer (or website) if I needed to. Just keep the ones I really want. Videos I will probably keep on my computer for sure. Guess I will go with the 16GB. Still leaves me room for songs (I like to keep around 200 at a time for a variety at work), pictures, apps, and some video.

  • I'm an architect looking forward to purchasing a new Mac. Which model do you recommend and why?

    I currently own a MacBook Pro 13 inch model (late-2011)
    Processor  2.8 GHz Intel Core i7
    Memory  8 GB 1333 MHz DDR3
    Graphics  Intel HD Graphics 3000 512 MB
    I'm an architecture student in my last semester, looking forward to buying a desktop Mac (for current and future use as a professional).
    Sadly, for us architects we are limited with some mayor Architecture Programs such as 3Ds Max & Revit (both of which I use frecuently and have to use in a PC )
    I have tried runing them in Parallels (in my MacBook Pro), but the result is slow and sluggish... so I plan on purchasing a new desktop computer as I believe these have more capacity to run this programs.
    I would like to avoid using Boot Camp (hate having to restart the computer frequently) so if a Mac with be it Parallels/VMWare Fusion/CrossOver can do the job EFFICENTLY I would be happy.
    So, which Mac model do you recommend for this case?
    I'm undecided and would like some advice from you guys.
    I'm not so limited on budget, but of course low cost would be appreciated.
    If you could give some specific specs as RAM, Processor model, etc. that would help me more.
    Im guessing the Power Mac is the best one...but just checking other opinions and answers.
    THANKS!

    Why not if you are going to run Windows pick up a PC with what you need?
    The new mac pro 2013 won't be out for couple months and figure more time for software, even Fusion etc to catch up.
    A VM is never going to be the same as running directly on the hardware natively.
    The new Mac Pro though should be able to handle what you throw at it but even support for Windows could take time.
    And looking at a new Mac operating system 10.9 Maverick. Windows 8.1 in same time frame.
    If you do use a VM, install Windows natively to begin with and then attach the VM to point to it. There are times you need or want to run or apply updates natively.
    The Mac has never had support for multiple high end graphic cards, no support for SLI and CrossFire-X, no 8-pin power connectors, if your software needs.
    Mac Pro 2013 product page - new design and up to 12-cores and FirePro (2) GPU if you want to burn a pile of $$s.
    http://www.apple.com/mac-pro/

  • Firefox browser continues to hang and sometimes crashes when trying to load more than 10 bookmarks in tabs. Please help with my request as I would like to choose which tabs will load webpages and have all others stopped.

    ''locking as a duplicate - https://support.mozilla.com/en-US/questions/876430''
    I have thousands of favorites and Firefox is my web-browser of choice. Sadly I'm backed up on what bookmarks I have stored and if the websites are still active or not.
    I cannot load more than 15 bookmarks it seems at once as my PC is trying to load all the web content for each page in the new tabs.
    This is my PC specs:
    OS Name Microsoft Windows XP Professional
    Version 5.1.2600 Service Pack 2 Build 2600
    OS Manufacturer Microsoft Corporation
    System Name xxxxxxxx
    System Manufacturer System manufacturer
    System Model System Product Name
    System Type X86-based PC
    Processor x86 Family 15 Model 75 Stepping 2 AuthenticAMD ~2210 Mhz
    Processor x86 Family 15 Model 75 Stepping 2 AuthenticAMD ~2209 Mhz
    BIOS Version/Date American Megatrends Inc. 0301, 21/08/2006
    SMBIOS Version 2.3
    Windows Directory D:\WINDOWS
    System Directory D:\WINDOWS\system32
    Boot Device \Device\HarddiskVolume1
    Locale United States
    Hardware Abstraction Layer Version = "5.1.2600.2180 (xpsp_sp2_rtm.040803-2158)"
    User Name xxxxxxxx/ADMIN
    Time Zone Atlantic Daylight Time
    Total Physical Memory 2,048.00 MB
    Available Physical Memory 1.53 GB
    Total Virtual Memory 2.00 GB
    Available Virtual Memory 1.96 GB
    Page File Space 3.85 GB
    Page File D:\pagefile.sys
    I have High Speed internet connection with the provider Rogers.
    Dlspeed is 12.9 Mbps
    Upspeed is514 kbps
    My PC supports Windows 7 OS which I have as a multiboot alternative when my PC starts up.
    I have continually waited and it says Firefox is not responding and I may be able to see the multiple tabs opened in my browser but cannot navigate or access them.
    I have read on various sites that users have had as many as 1500 bookmarks load at once in tabs in the Firefox browser version that are outdated.
    I have not been successful with just loading 50 bookmarks my goal is to be able to have 500 tabs loaded in firefox with webpage loading stopped on all of them. I will choose reload for about 10 tabs at a time to view webpage content and then close and move on to the rest.
    My ultimate goal is to clear up the Thousands of bookmarks I have piling on for the past 6 years and some are duplicates or similar page sites.
    Their is no Firefox 3rd party addons that I could locate that would allow this. Only to restrict the number of tabs loaded by giving warning messages when limit is reached.
    Please assist me as it will greatly help me with finally deleting and re-organizing my Favorite and frequent websites in my Browser of choice Firefox.
    The email is generic for privacy but it is valid please respond with methods on how I can achieve my request or suggestions on how I can modify my browser or PC settings to allow this. Thanks Firefox Administration Team.
    I edited with a recent Workaround added to Troubleshoot section.
    If there is a keyboard shortcut or easier way to do this would someone please let me know?

    Firebug is notorious for causing problems like you described.
    Disable it when you don't need it or install it in a 2nd Profile. Then you can launch the 2nd Profile separately to use Firebug and not affect what you are doing in the 1st Profile,

  • Which MacBook Pro is better and why?

    I'm planning on downsizing to a 15". I've got the 17" and love it, but my new company insists I use a PC so, because I'm addicted, I'll be traveling with two - a PC and a MBP.
    So which to get, the 2.0 mhz or the 2.16? Is there really that big a difference in the computing power?
    Likewise, what is the difference between the video memory being 256mb and 128? My main use will be to run graphics apps (Photoshop, Lightroom).
    Thanks in advance for any advice. Oh by the way I'll have the full 2GB of ram, of course...

    My understanding is that all mac book pros come with the 256MB video memory...
    I've had a 2.0ghz since February and it came standard with 256.
    Honestly, if you're getting a 2.0 with 2GB ram, I dont' think you'll notice much difference between the 0.16 the latter will offer you.
    I guess mine has 256 because in Feb 06 the 2.0 was the "2nd tier" MBP, and the 1.83 was 128MB video.
    Oh wow, I'm mistaken... It seems that the current 2.0 DOES have 128MB video...
    I think you should get the 2.16. Based on current rumors you may want to wait until the 25th... I don't think anything will happen, but I still think the hype may be worth the wait.

Maybe you are looking for