Choosing the best query

Hi there,
Can some one help me on selecting the best query from the following two queries:
QUERY 1:
select p.name, d.descr
from table1 p, table2 d
where p.cod_table1 = d.cod_table2(+) and d.dom(+) ='T';
ID Query Plan
0 SELECT STATEMENT Cost = 5
1 HASH JOIN OUTER
2 TABLE ACCESS FULL table1
3 TABLE ACCESS BY INDEX ROWID table2
4 INDEX RANGE SCAN DDOM_DOM_FK                     
QUERY 2:
select p.name, (select d.descr from table2 d where p.cod_table1 = d.cod_table2 and d.dom='T') as descr
from table1 p;
ID Query Plan
0 SELECT STATEMENT Cost = 2
1 TABLE ACCESS FULL table1                    
I'm a bit surprise about the explain result of the second query, because there is no reference to table2 access. What's happening ?
Tks in advance for any tip,
Helena.

I've noticed that issue with the query plan for those types of querys (in 8.1.7. It may be better in a lter database).
I think the queries will take the same time.
However if you are basing a view on the query, the second would be better as the lookup table will only be accessed if the descr is selected from the view, and performance will therefore be better for queries not accessing the descr column.
[I asked pretty much the same question on asktom.oracle.com]

Similar Messages

  • Choosing the best query of the two

    Hi All,
    I would like to know from the below two queries(which gives me the same o/p), which one is optimum in terms of performance?
    1)
    DELETE
    FROM FMS_CSE_DETL
    WHERE CSE_CD IN
    (SELECT CSE_CD FROM T_AFMS_CSE_DETL ) ;
    2)
    DELETE
    FROM FMS_CSE_DETL F
    WHERE EXISTS
      (SELECT T.CSE_CD
         FROM T_AFMS_CSE_DETL T
         WHERE T.CSE_CD = F.CSE_CD);The table FMS_CSE_DETL has a primary key index on the column CSE_CD.
    The table T_AFMS_CSE_DETL has a primary key index on the column CSE_CD.
    Please advise.
    Thanks!

    Hi Jeneesh,
    The explain plans are as below:
    SQL> explain plan for
      2  DELETE
      3  FROM FMS_CSE_DETL
      4  WHERE CSE_CD IN
      5  (SELECT CSE_CD FROM T_AFMS_CSE_DETL );
    Explained.
    PLAN_TABLE_OUTPUT
    Plan hash value: 1485950241
    | Id  | Operation               | Name               | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | DELETE STATEMENT        |                    |  5478 |   668K|  2632   (1)| 00:00:32 |
    |   1 |  DELETE                 | FMS_CSE_DETL       |       |       |            |          |
    |   2 |   MERGE JOIN            |                    |  5478 |   668K|  2632   (1)| 00:00:32 |
    |   3 |    INDEX FULL SCAN      | FMS_CSE_DETL_PK    |   818K|    92M|  2624   (1)| 00:00:32 |
    |*  4 |    SORT JOIN            |                    |  5478 | 38346 |     8  (13)| 00:00:01 |
    |   5 |     INDEX FAST FULL SCAN| T_AFMS_CSE_DETL_PK |  5478 | 38346 |     7   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       4 - access("CSE_CD"="CSE_CD")
           filter("CSE_CD"="CSE_CD")
    18 rows selected.
    SQL> explain plan for
      2  DELETE
      3  FROM FMS_CSE_DETL F
      4  WHERE EXISTS
      5    (SELECT T.CSE_CD
      6            FROM T_AFMS_CSE_DETL T
      7            WHERE T.CSE_CD = F.CSE_CD);
    Explained.
    PLAN_TABLE_OUTPUT
    Plan hash value: 2932044013
    | Id  | Operation               | Name               | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | DELETE STATEMENT        |                    |  1594 |   194K|  2632   (1)| 00:00:32 |
    |   1 |  DELETE                 | FMS_CSE_DETL       |       |       |            |          |
    |   2 |   MERGE JOIN SEMI       |                    |  1594 |   194K|  2632   (1)| 00:00:32 |
    |   3 |    INDEX FULL SCAN      | FMS_CSE_DETL_PK    |   818K|    92M|  2624   (1)| 00:00:32 |
    |*  4 |    SORT UNIQUE          |                    |  5478 | 38346 |     8  (13)| 00:00:01 |
    |   5 |     INDEX FAST FULL SCAN| T_AFMS_CSE_DETL_PK |  5478 | 38346 |     7   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       4 - access("T"."CSE_CD"="F"."CSE_CD")
           filter("T"."CSE_CD"="F"."CSE_CD")
    18 rows selected.

  • Advice needed on choosing the best SSD for 13-inch macbook 5,1.

    I'm thinkning about to upgrade my macbook. It's a late 2008 aluminum version. I want to replace the old HD with a nice SSD. I'm struggling to choose from the following two SSD.
      1. Crutial M500 (960G)  SATA III 6Gbps
      2. Intel dc s3700 (800G)
    I can get both of these at similar price around 300pounds just for this 2 days. But I don't know which would work the best on my macbook. Need advice please.

    Thanks for the link, unfortunatly there's no option for intel dc s3700.
    After seeing crucial M500's score there, I'm not that empressed. I heard that the Intel dc s3700 (800G) worth over 1000pounds, is it worth it just for the sake of getting the intel at a much cheaper price?  I don't know Why I've got the impression that Intel dc S3700 acturallly better than crucial M500.

  • Tips For Choosing the Best Samsung Cell Phone Battery

    It is difficult to imagine the world would be like if you do not use a mobile phone! We have become so dependent on the use of Samsung mobile phones, we will be panic, if we mistakenly forgot at home. The Samsung mobile phone is a key part of most people's lives, and get them up every minute of friends, family and business partners.
    Taking into account a new Samsung mobile phone purchase, but also consider the Samsung mobile phone battery. Here are some suggestions to help.
    More standby time and talk time, you should choose a Samsung cell phone battery with high capacity. However, when you select a high-capacity Samsung mobile phone battery, there will be a heavier weight. A bigger Samsung cell phone battery, cell phones can not enter the cell phone pocket, or protectors. If you plan to travel a lot with the phone, which could lead to a problem, your phone may not be easy to carry.
    Select the Samsung cell phone battery, lower cost, and may not be the best choice, quality. Make sure you ask if you buy a new battery or refurbished one, which is a key issue! Tips to find a renovation is the incredibly cheap price. Refurbished batteries may have old parts, it may not work as effectively as a new battery.
    Buy a new battery, you get a guarantee that if you have any questions? Remember, some just do not work, as long as expected. Usually Samsung phone manufacturers will provide a new battery only when it is purchased in a specified amount of time.

    mtongy wrote:
    we will be panic, if we mistakenly forgot at home.
    i won't.

  • Choosing the best BPM tool

    Hello,
    We are a small size pharmaceutical company with an existing SAP ECC 6.0 installation. Currently we do not have any BPM system. We are looking for the best possible BPM tool (cost considerations exist) that will
    - automatically create some graphical business process documentation using our live SAP system data
    - supports an eEPC or BPMN based documentation option that is managable by a team
    - is user friendly enough so that business and IT would want to cooperate using this tool when designing processes.
    Any viewpoint on the right tool? We only know Intellicorp's LiveModel + LiveCompare so far. We like it but want to hear about alternatives.
    Regards,
    Hakan

    You might like to search SAP's EcoHub for BPM tools.  This link should produce a number of results:
    [http://ecohub.sdn.sap.com/irj/ecohub/solutions?query=bpm|http://ecohub.sdn.sap.com/irj/ecohub/solutions?query=bpm]
    Two products in particular will be found: LiveModel (our product) and ARIS.
    If you have any questions about LiveModel, feel free to contact me directly (<removed>).
    Chris.
    CTO.
    Edited by: Moderator on Feb 20, 2010 9:51 AM - Please refer to business card rather than posting your email address

  • Please Help me to Choose the best config to run forms on web

    Hi,
    I have started upgrading my application from Dev2000 1.3 to Dev2000 6i in order to deploy on web. I have few questions to ask
    1. I need to know which config is the best & fast to run my applications out of
         1. Applet
         2. IE50Native
         3. JInitiator
    2. For testing I have configured forms server in socket mode. When I am using JInitiator even after exiting the application from test terminal, "ifweb60.exe" process initiated due to this session remains running. It takes long time when I try to initiate the same application for second time. This problem is not frequent, but this has happened 4 times while testing. Could this be due to Pentium4.
    Thanks in advance
    Syed

    saj123 wrote:
    I'm quite new to j2EE developement.
    Currently im working on a web based user management application ( a small scale one ).
    For that im hoping to use JSP s for presentaion tier and EJBs for business logic. This business logic seems to be having more on database accessing. Im not using Entity Beans for data access , but hope to use Session Beans.Why EJBs? POJOs will work just fine.
    >
    Is it ok if i develop according to this model , or is it better to use Entity Beans for data acccess ?Neither. Use POJOs. What are EJBs buying you?
    Is it a bad design to use Session Beans for data accessing ?Why?
    Or else , what if i avoid EJB s completely and database access is done via JSP itself ?Ouch, no. JSPs are for presentation only.
    Or i have another option , that is , using JSP for the presentation layer and Servlets for database accessing.Wrong again.
    what is the preferred way ? How i can decide a better way ?Learn how to layer an app properly. Learn Spring. http://www.springframework.org
    %

  • Help me on choosing the best sound quality for my music on my itunes!!!

    I heard that AIFF Encoder is the best sound quality you can import your music into Itunes. On the settings for AIFF Encoder do you know what Sample Rate, Sample Size, and what Channel I should set it to? Should I just leave them on Auto? How about if I have a HDCD? What are your suggestions?

    I agree use Apple Lossless. Bizarrely it is also easier to share Apple Lossless with Windows Media Player than AIFF.
    I have my entire iTunes library in Apple Lossless and shared with WMP and also Media Center 2005. I can also use it in full lossless quality with Roku SoundBridge, Apple TV, iPhone, iPod, etc. etc. etc.

  • Need help in choosing the best laptop

    I want the best laptop for running Windows Server/Client, Linux/Unix and VMWARE.

    I am looking to switch from a desktop to a laptop what would people suggest. I would need something that could handle heavy graphics and a lot of ram.

  • Choosing the best processor for the tasks

    I am looking into purchasing a new mac pro to use as a server and am trying to select the best processor for task.
    I will have at least 20 clients. This will mostly be used as a file server. The team would like to be working on the server with Photoshop and AfterEffects files. What processor is best for this requirement?
    3.5GHz 6-core with 12MB of L3 cache [Subtract $3,000.00]
    3.0GHz 8-core with 25MB of L3 cache [Subtract $1,500.00]
    2.7GHz 12-core with 30MB of L3 cache
    What other kind of infrustructure should I invest in?
    Please note I will be opting for 64GB of RAM.

    The Mac Pro is really a very expensive server.  You are probably better suited with a Mac mini Server. 
    The Pro has two video cards you will never use.  The Pro has 5, 7, or 11 cores you will never use unless you are making this an AfterEffects render node.  The Pro has very little internal storage and no option for redundant internal storage.  The Pro is very expensive and is designed and marketed as a workstation (a powerful one at that).  The Pro is a unit that should be used by a user, not operating 24 hours a day and doing nothing for 16 of those hours.
    That being the case, a Mac mini with 16 GB of RAM is more than enough for a 20 person department.  Invest in a quality ethernet switch and good wiring. 
    R-
    Apple Consultants Network
    Apple Professional Services
    Author "Mavericks Server – Foundation Services" :: Exclusively available in Apple's iBooks Store

  • Help me to choose the best, it will be a gift T_T

    Greetings to all
    Im going to buy a camera for my husband
    I know his type is the DSLR
    He had one long  time, but sold it so i dont know what itz model
    Am thinking to get him the latest by Canon
    I read many reviews now I need to know the best for someone likes to shoot portrays
    According to what I read 650D is good and 70D
    I went amazon and I saw many options goes with that
    so I found about lenses and other accessories which i dont know, and now I find myself lost
    like what is the difference between
    18-55mm EF-S IS STM Lens vs 18-135mm EF-S IS STM Lens ?
    I wanna give him everything that he needs a full package
    price doesnt matter
    so please guide me
    what is best for portray shooting
    what all accessories that essential and must have
    Solved!
    Go to Solution.

    The body needs to be good enough to be up to the task at hand.  Example:
    Suppose I want to take an image of a flowers in a vase in excellent lighting.  The camera is on a tripod.  The subject is not moving (no "action" to capture.)  
    In a situation like that, you basically have all the time in the world to frame up and capture that shot.  This shot isn't going to test the limits of what a camera can do -- any camera body would be fine.
    If, on the other hand, you're shooting in very poor lighting, then a body that can handle high ISO senstivity levels while keeping the image "noise" levels low would definitely have an advantage.  If you're shooting "action" photography then a camera with a great focus system and a fast frame rate would be definitely have an advantage.
    Since portraits tend to be posed and aren't "action" photography, the focus system and frame rate isn't usually critical.  You also usually get to control the lighting in portraiture rather than having to make-do with whatever lighting happens to be available -- so even the ability to shoot at very high ISO settings isn't actually very important (again... for portraiture.  For some other type of photography that might be really important.)
    The new 70D will certainly be a more capable camera than the 650D.  
    The 650D is part of Canon's "Rebel" series.  These are all entry-level bodies... the T3 being the low-end of the range and the T5i being the high-end of the "Rebel" range.  
    The 70D is part of Canon's mid-range bodies... these are bodies that start to have the benefits of the pro bodies (e.g. the control layout on the camera is much closer to the pro bodies.)  
    The big new feature on the 70D is Canon's new hybrid AF mode which is especially nice for shooting video.  The 70D also has basically the same focus system as is found on the Canon 7D (the 7D has a lot of optimizations which make it ideal for action photography).  It has a 19 point auto-focus system (vs. the 9 point system found on the Rebel bodies.)
    Again... if you're subjects aren't moving then having a more advanced focus system isn't a big deal.
    What would be a big deal for portraiture... is lighting gear.  
    Tim Campbell
    5D II, 5D III, 60Da

  • Need help choosing the best laptop or desktop for video editing.

    Hi guys.  I'm a videographer and am in need of upgrading my current Dell Dimension 8300 desktop to either another desktop or a laptop.  My current Dell is just too slow.  It takes forever to render a video.
    Anyhow, what do you guys recommend for video editing?  I'd like something with plenty of hard drive space, plenty of memory, and a powerful video card.  There are just too many to choose from and was hoping to get some feedback.
    Thank you,
    Brian

    You can find a fairly cheap quad core desktop with a nice video card.  So if you need something that will last a while and not cost too much I would go this route.
    If you want a laptop, put yourself in one of these categories: someone who needs high mobility/battery life (14 in screen or smaller), someone who needs high mobility with a big screen (15.4in), or someone who needs a powerful computer with a big screen (17-18.4 in).
    Don't worry too much about laptop brands, only a handful of them actually make their own laptops, most of the big brands use the same two or three laptop manufacturers.
    Get the most powerful intel processor you can afford, and put either a 9 series nvidia, or an ati radeon 4800 series in, four gb of ram, and a 7200 rpm hard disk.
    After that it really comes down to price and personal style, I would stay away from the hp laptops, the brand that they use doesn't do so well making the internal components.
    Here are some good picks. 
    1) ASUS G Series G50VT-X3 (15.4in)
    2) Sager 5793 (17in)
    3)ASUS N80 Series N80Vn-X5 (14.1in)
    Asus actually manufactures their own laptops, and my experience with them has been spectacular.  The Sager is a rebranded Clevo, which is one of the brands alienware, falcon northwest, and other high end companies use. 

  • Choosing the best sequence setting

    Hi everybody. I'm planning a two camera shoot -- a canon XH A1 and a Canon MK2. Canon MK2 has only one codec - 30p. The XH A1 can shoot in either 30i or 24P.
    Assuming the video will trade off evenly between both cameras -- is it better to edit in 24P (and convert the Mk2 footage) or 30P (and convert the XH A1 footage). The other option would be 30i.
    I'm leaning towards 24p, since I like the film look. But I thought I would put the question out there in case anyone has any experience either way.
    Also -- I'd be glad to hear what experience in general people have had working with MK2 footate. This will be my first time.

    #50 - Quality difference between Viewer and Canvas
    Shane's Stock Answer #50 - Why is the quality different between what I see in the Viewer and what I see in the Canvas?
    Well... the viewer is just that-- a viewer. It will display anything that fcp will recognize as usable video or graphics. The canvas is a viewer too, but at the pixel dimension specified by the settings of your project and sequence.
    For example, if your graphic or footage is much higher resolution than your 720x480 DV sequence, FCP is interpolating down your file to fit the settings of the sequence. Usually this makes it look not so hot.  DV is a 5:1 compression working with a 4:1:1 color depth. Your pristine picture images and graphics are being crushed.
    Same with picture files.  HIgh res pics now adopt the sequence settings and will render to those specs, and most likely they are not as high quality.

  • Choosing the best migration strategy

    I'm migrating from on premises Exchange 2007 (part of SBS 2008).  My plan is to use a staged migration.  One of the first things I need to decide is if I want to use password sync or single sign on.  I've read the docs on each, but I'm unclear
    on the specific advantages of each.
    If I use single sign on, is it dependent on the connection between Exchange online and on prem?  If my DC is offline, can users still authenticate online for email?

    Why you want to migrate though Staged process? It is a very time consuming process. As per my own experience, I would advise you to make use of any EDB to Converter like PcVita Converter, Stellar EDB to PSt Converter, Kernel EDB to PST Converter and many
    more are there. With these tools, you can directly export EDB to PST and then you can easily import that PST into your Exchange using powershell cmdlets. You can find page URLs of the converters below:
    www.stellarphoenixrecovery.com/edb-extractor.php
    http://www.nucleustechnologies.com/edb-to-pst.html
    www.pcvita.com/edb-converter.html

  • Need a recommendation on using the book module ...having trouble with choosing the best template and adjusting text etc.

    Having trouble working with photo text box and normal page text boxes.  Cannot seem to consistently grab the handles of either and re-size.  Is there a good tutorial out there? 

    Adobe TV is a good place to start. See if these video tutorials help:
    Book Creation
    http://tv.adobe.com/watch/getting-started-with-adobe-photoshop-lightroom-5/lightroom-5-cre ating-and-publishing-a-book/
    Modify Layouts of Images & Text
    http://tv.adobe.com/watch/whats-new-in-lightroom-4/modifying-book-layouts-/
    Backgrounds & Favorites
    http://tv.adobe.com/watch/whats-new-in-lightroom-4/advanced-book-module/

  • Need help in choosing the best design approch

    Dear helper,
    I have assigned enhancement project for old system.
    the old system divided into three pakages:
    1. listener : listen to a data feed from a gateway using socket
    2. analyser: connects to the listner and analyse the feed using some basic string processing like substring() method.
    3.datamanger: connect to the analyser and write the analysed feed to a database server.
    as you notice this design depends on client- server Architecture, each package composed of two components : client and server( reader and writer)
    the proplem is the feed come from the gateway is two fast than the reading and writing process of the system. who can i make compremised solution so that i can balance the process of reading and writing with the feed speed
    thanks

    Use queues buddy.
    Put data that you read into a queue....
    let another process process it and write it into another queue
    and yet another process to write the processed data into its destination.
    ie a process that does reading only
    and a process that does writing only.
    this will help you solve the speed problems.
    Kenney

Maybe you are looking for

  • Family Sharing / Delete child apple ID

    On this page http://support.apple.com/kb/HT201081 It is mentioned that : "Children under 13 can't be removed from a family. If you need to, you can transfer the child to another family or delete their Apple ID." How can I delete their apple ID ?

  • How can I download my copy of photoshop from a new computer?

    Hi, I'm trying to download my copy of photoshop and I'm entangled by menu options. It was once downloaded on an old computer, but I have no access to that computer anymore--long story, the program isn't in use. Is it even possible? Thanks in advance,

  • Custom bios request

    MSIHQ: Information detected by MSIHQ Tool ver: 1.25g MSIHQ: Report generated in 2013-06-22 at  7:31:46,53 Mainboard:  MS-16F1 PCB Version:  To be filled by O.E.M. BIOS Version: E16F1IMS VER1.0L BIOS Date:  2011-10-04 EC-FW Version:  *****************

  • Installing Wireless Mouse on MacBook 13"

    I am planning to install Windows Vista on my MacBook 13". I am wondering how do I install Wireless Mighty Mouse after installation is done; because I know that I will have to use wired mouse (correct?) during the installation process. Thanks for help

  • JDBC Sender -Not selecting records

    Hi all I have set up a JDBC sender. The communication channel monitor shows that "Polling interval started" but It is not retrieving data from the JDBC table using a select statement. This is a sql select statement. SELECT * FROM table there is also