Which clause will yield better performance?

I've always been wondering from a performance standpoint if it was better to use a WITH clause withing a cursor or if it was better to use a sub query? So, if say, I could either place my sub query in the FROM clause of my cursor (for this example that would be the case) or use a WITH clause, which would yield better performance? (I'm using Oracle 11g)

Check this link.
http://jonathanlewis.wordpress.com/2010/09/13/subquery-factoring-4/
Regards
Raj

Similar Messages

  • Which one will get better performance when traversing an ArrayList,  iterat

    hi, everyone,
    Which one will get better performance when traversing an ArrayList, iterators, or index(get(i))?
    Any reply would be valuable.
    Thank you in advance.

    Use the iterator, or a foreach loop, which is just syntactic sugar over an iterator. The cases where there is a noticeable difference will be extremely rare. You would only use get() if you actually measured a bottleneck, changed it, re-tested, and found significant improvement. An iterator will give O(n) time for iterating over any collection. Using get() only works on Lists, and for a LinkedList, gives O(n^2).

  • File Adapter or File  Transport which one will give more performance

    Hi all,
    File Adapter or File Transport which one will give more performance ? in OSB?
    Which one to select any one did performance analysis?
    Thanks
    Phani

    Why don't you just go read some benchmarks?
    http://www.barefeats.com/mbpp18.html

  • Which approach is having better performance in terms of time

    For large no of data from more then two diffrent tables which are having relations ,
    In Oracle in following two approaches which is having better performance in terms of time( i.e which is having less time) ?
    1. A single compex query
    2. Bunch of simple queries

    Because their is a relationship between each of the tables in the simple queries then if you adopt this approach you will have to JOIN in some way, probably via a FOR LOOP in PL/SQL.
    In my experience, a single complex SQL statement is the best way to go, join in the database and return the set of data required.
    SQL rules!

  • I have a macbook pro 13" early 2011 version and what to install windows 7 on it via bootcamp but not sure that whether to install x64 or x86 version? which one will work better

    i have a macbook pro 13" early 2011 version and what to install windows 7 on it via bootcamp but not sure that whether to install x64 or x86 version? which one will work better

    There is no need for anyone to use 32-bit version anymore.
    Retail comes with both. Or you can save on just buying 64-bit System Builder disc.
    Better support for today's hardware with larger video graphic memory and systems.
    Better memory management.

  • Which one will have better career (BW+BODS) or (BO+BODS).

    Hi All,
    I want to know which career path will have better roadmap for next 10 years, (BW+BODS) or (BO+BODS). I have started my career with BW, and now I am planning to to learn some other SAP Module,i.e addon to BW, which will progress my career.
    Can anyone suggest me that is my Idea of learning BODS will help me or not? If not please suggest me some other path..
    Regards,
    G S Ramanjaneyulu.

    Hi Rama,
    Why do you want to restrict yourself on learning on this combination.  My colleagues all are BW, BODS and BO Consultants.  If any project require specific, they split depends on the project or whichever they want learn more.
    Nowadays, it is very common for consultants that they know two or three modules or systems.
    You already know SAP BW... so learn BO next and then BODS or whichever you like.
    BO is very good in Market currently on Dashboard and Analytical.
    Regards
    GGOPII

  • Which method has a better performance ?

    Hello !
    I'm using entity framework , and I have several cases where I should run a query than return some parent items , and after I display these parents and the related children  in one report.
    I want to know which of these methods have the better performance : ( or is there any other better method ??? )
    Method1: (the childs collection are loaded later , using lazy loading)
    Dim lista as IQueryable(Of MyObj) = (From t In context.MyObjs Where(..condition..) select t).Tolist
    Method2:
    Dim lista as IQueryable(Of MyObj) = (From t In context.MyObjs Where(..condition..) _
    .Include(Function(t2) t2.Childs1) _
    .Include(Function(t2) t2.Childs2) _
    .Include(Function(t2) t2.Childs2.Child22) _
    .Include(Function(t2) t2.Childs1.Childs11) _
    .Include(Function(t2) t2.Childs1.Childs12) _
    Select t).ToList
    Method3:
    Dim lista as IQueryable(Of MyObj)
    Dim lst= (From t2 In context.MyObjs Where(..condition..) Select New with _
    { .Parent=t2
    .ch1=t2.Childs1 _
    .ch2=t2.Childs2 _
    .ch21=t2.Childs2.Child21) _
    .ch11=t2.Childs1.Childs11) _
    .ch12= t2.Childs1.Childs12 _
    ).ToList
    lista=lst.Select(Function(t2) t2.parent)
    I noticed that the first method cause the report to open very slow. Also I read somewhere that Include() cause repeat of parent items?
    But anyway I want a professional opinion in general for the three methods.
    Thank you !

    Hello,
    As far as I know, the Entity Framework offers two ways to load related data after the fact. The first is called lazy loading and, with the appropriate settings, it happens automatically. In your case, your first method uses the last loading, while the second
    and third are the same actually, both of them are Eager Loading. (In VB, if you could check use code as “DbContext.Database.Log = Sub(val) Diagnostics.Trace.WriteLine(val)” to see the actually generated sql statement, you could see the third and second query
    would generate a join syntax). Since you mentions, the lazy loading way is low performance, you could use either the second or third one.
    >>Also I read somewhere that Include() cause repeat of parent items?
    For this, nor sure if you worry it would firstly use lazy loading and then use eager loading, however, in my test, I do not see this behavior, the Entity Framework seems to be smart enough to use one mode to load data at the same time. Or you could disable
    its lazy loading when using eager loading:
    context.ContextOptions.LazyLoadingEnabled = false
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Which computer will yield visibly better performance?

    I'm making a start in video production and film editing, and given my fondness of Macs going with Final Cut Pro is an obvious choice.
    My question is, will I feel a large performance boost going all out with a Mac Pro given that Final Cut Pro is still a 32 bit program? Right now I am leaning in to getting a high end iMac given how good their hardware has gotten.
    What things should I consider in buying a new computer knowing that I will be doing HD video editing, rendering, and production?

    The 32 bit vs 64 bit question is focusing on the wrong issue. Since we have no clue about your level of experience or competence in the world of video, don't take offense if when I ask - have you ever worked with professional tools before?
    There are eleventy billion HD formats. Which ones are you planning to work with?
    Are you really planning on working with film or do you simply mean video?
    Is this a business or a hobby?
    If it's a business, what does your +pro forma+ business plan tell you regarding level of investment and ROI?
    If it's a hobby, how much money can you afford to throw at it?
    In addition to the computer and hard drives, you'll need a broadcast monitoring solution, flexible i/o device(s), good speakers and a reasonable space, desk and good chair. Oh, and much of the equipment will last just 3-5 years and you'll likely need to invest in all that stuff again.
    This question gets asked often enough that a search of the forum will turn up all sorts of treads with a great deal of detail. Of course, going down to your local public access channel and volunteering to help on some productions will also give you a more solid grounding.
    Good luck.
    x

  • Which gives better performance in webi using display attr or nav attr -

    Hello all,
    We are using the Bex query as the datasource for our universes and the end user is using the Web Intelligence as the reporting tool (rich client and infoview) we have employee as one of the infoobject in the cube.
    Now employee has a lot of attributes which the user wants to use for reporting (delivered employee infoobject has quite a few attr), we are making some of them as Nav attr like Org unit since they are time dependent and the end user will need to put in the key date to bring the employees from right org unit.
    We have enhanced the employee attr to have the all address information of the employee (Z fileds) and we have made those nav attr in RSd1.
    So my question is should we make the address Z fields as nav attr in cube as well and use those objects in webi or can we use the objects in webi which fall under employee like details (green icons) rather than separate object.
    Please let me know what will keep better performance and what is the best practice.
    Thanks you in advance and appreciate everyone's help
    Edited by: Cathy on Jun 16, 2011 7:35 AM

    Hi,
    BEx Query Design Recommendations:
    "Reduce Usage of Navigational Attributes as much as possible Also, if simply displaying a Characteristicu2019s Attribute, DO NOT use the Navigational Attribute u2013 rather utilize the Characteristic Attribute for display in the report  This avoids unneeded JOINS, and also reduces total number of rows transferred to WebI"
    Source : SAP Document
    Thanks,
    Amit

  • Which one will give more power C2D 2.93 vs i5 2.4

    Any one can inform me which one will give more performance MBP C2D 2.93 with NVIDIA GeForce 9400M + 9600M GT with 512MB or MBP i5 2.4 with 330M 256MB
    I want it for photos and movies editing ?

    Why don't you just go read some benchmarks?
    http://www.barefeats.com/mbpp18.html

  • Difference between Temp table and Variable table and which one is better performance wise?

    Hello,
    Anyone could you explain What is difference between Temp Table (#, ##) and Variable table (DECLARE @V TABLE (EMP_ID INT)) ?
    Which one is recommended to use for better performance?
    also Is it possible to create CLUSTER and NONCLUSTER Index on Variable table?
    In my case: 1-2 days transactional data are more than 3-4 Millions. I tried using both # and table variable and found table variable is faster.
    Is that Table variable using Memory or Disk space?
    Thanks Shiven:) If Answer is Helpful, Please Vote

    Check following link to see differences b/w TempTable & TableVariable: http://sqlwithmanoj.com/2010/05/15/temporary-tables-vs-table-variables/
    TempTables & TableVariables both use memory & tempDB in similar manner, check this blog post: http://sqlwithmanoj.com/2010/07/20/table-variables-are-not-stored-in-memory-but-in-tempdb/
    Performance wise if you are dealing with millions of records then TempTable is ideal, as you can create explicit indexes on top of them. But if there are less records then TableVariables are good suited.
    On Tables Variable explicit index are not allowed, if you define a PK column, then a Clustered Index will be created automatically.
    But it also depends upon specific scenarios you are dealing with , can you share it?
    ~manoj | email: http://scr.im/m22g
    http://sqlwithmanoj.wordpress.com
    MCCA 2011 | My FB Page

  • Same algorithm in function and procedure then which one will better?

    Why pl sql function is better to computes a value instead of procedure?
    If I apply same algorithm in function and procedure then which one will perform better?

    It's not a matter of performance, it is more a matter of how it is going to be used.
    A function can be used as an expression in an assignment or in a query.
    my_var := my_func(my_param);
    select my_var(my_col) from my_table;But it can just return a single value (which can be a complex value like a nested table or object or ref cursor, but still a single value.)
    The procedure often is more used to perform an action that does not return anything.
    execute_invoicing(my_invoice_id);Or procedures can be used if you need multiple return values.
    my_proc(my_input, my_output_1, my_output_2, my_output_3);But the procedure cannot be used in an assignment expression or a select query.
    Performance wise procedures and functions are completely identical. It is only a matter of what action they perform and how you are going to use them.

  • Will insert (ignore duplicates) have a better performance than merge?

    Will insert (ignore duplicates) have a better performance than merge (insert if not duplicate)?

    Ok. Here is exactly what is happenning -
    We had a table with no unique index on it. We used 'insert all' statement to insert record.
    But later when we found duplicates in there we started removing them manually.
    Now, to resolve the issue we added unique index and added exception handling to ignore DUP_VAL_ON_INDEX exception.
    But with this all records being inserted by 'INSERT ALL' statement gets ignored even if only one record is duplicate.
    Hence we have finally replaced 'insert all' with merge statement. Which inserts only if a corresponding record is not found (match based on column in unique index) in the table.
    But I am wondering how much performance will get impacted.

  • Which provides better performance?

    I have a ATI HD3200 video built-in to my motherboard.  I also have an old Nvidia 6600 GT 128 MB videocard.  Which will give me better performance? 
    I have the desktop effects enabled in KDE 4.2 and I also like to play the occasional 3D game.

    For desktop use with compositing i'd agree with Draje.  For games, you can easily enough benchmark each card and see which is best.  If you go this route I strongly recommend using a lighter weight wm just when you play games.  I know my own comp went up 40fps or so when playing nexuiz under fluxbox as opposed to KDE 3.5.x.

  • In the below queries which gives better performance

    Hi All,
    In the below two queries which gives better performance.
    Requirement is I need to find if all the 3 score columns are null then I need to assign -ve value -9999 else some +ve value 2
    1)
    select case when count(CUST_score1)+count(CUST_score2)+count(CUST_score3)=0 then -111111'
    else 11 end
    from
    customer
    where subscriber_id=1050
    and cust_system_code='1882484'
    2)
    select case whenCUST_score1 is null and CUST_score2 is null and CUST_score3 is null then '-9999'
    else '11' end
    from
    customer
    where subscriber_id=1050
    and cust_system_code='1882484'
    Please help, because we have more data in table customer so I need to confirm which is better.
    Regards,
    Chanda

    user546757 wrote:
    Hi All,
    In the below two queries which gives better performance.
    Requirement is I need to find if all the 3 score columns are null then I need to assign -ve value -9999 else some +ve value 2
    1)
    select case when count(CUST_score1)+count(CUST_score2)+count(CUST_score3)=0 then -111111'
    else 11 end
    from
    customer
    where subscriber_id=1050
    and cust_system_code='1882484'
    2)
    select case whenCUST_score1 is null and CUST_score2 is null and CUST_score3 is null then '-9999'
    else '11' end
    from
    customer
    where subscriber_id=1050
    and cust_system_code='1882484'
    Please help, because we have more data in table customer so I need to confirm which is better.
    Regards,
    ChandaThe two statements aren't equivalent. If you know that your where condition is restricting to a single row then there is no point in doing a count as that will introduce an additional aggregate function that isn't required for a single row. If you are dealing with multiple rows from the where condition then the second query will return multiple rows whereas the first query returns 1 row, so they don't do the same thing anyway.

Maybe you are looking for

  • Issue related to Payment Terms.

    Dear Gurus, The requirement is: We use payment terms as 3% discount if the customer pays the due in 7 days. How can system calculates the 3% discount If the customer pays the due within 7 days.  Because in the conditions the price is credit price.  S

  • Error in application onStart

    Hi, I am getting this error while running Jboss server. I am getting error in starting my application. Why is it so? Please help me. 12:45:45,307 INFO [STDOUT] Error in application onStart. Could not dereference object 12:45:45,307 INFO [STDOUT] java

  • Changes in Sales order materail availabilty date.

    What is impact if we change Sales order materail availabilty date in sales order user exit using some program.

  • HT1349 ios 6.1.3 problem in my IPHONE 4s,

    i have problem in my iphone 4s . using ios 6.1.3 iphone take too much time to loading photos in cameraroll after taking image.. can i downgrade my iphone 4s into ios 6.1.2 or 6.1.1 or 6.0.1...plz tell me

  • Learning Linux kernel

    Hi, I am a user of Linux and BSD UNIX system. I know C and the basics of Assembly. I'm trying to learn and program the kernel layer. Can you suggest me books, documentation or examples to do that? Thanks and sorry for my poor English,    --mghis PS: