Performance tuning -- Recent Shipments

I need help tuning this query. User input is customer_id(1351) and location('San Antonio - PO Box 795054').
SELECT DISTINCT po_num, shipping_date, bol
FROM (SELECT DISTINCT FIRST_VALUE (po_number) OVER (PARTITION BY bol ORDER BY ship_date DESC)
po_num,
FIRST_VALUE (ship_date) OVER (PARTITION BY bol, po_number ORDER BY ship_date DESC)
shipping_date,
FIRST_VALUE (bol) OVER (PARTITION BY bol, po_number ORDER BY ship_date DESC)
bol
FROM (SELECT /*+ INDEX_JOIN(BILL_SU) */
ool.cust_po_number po_number,
TRUNC
(ool.actual_shipment_date
) ship_date,
wbrv.bill_of_lading_number bol
FROM apps.oe_order_headers_all ooh,
apps.oe_order_lines_all ool,
apps.wsh_delivery_details dd,
apps.wsh_delivery_assignments da,
apps.hz_cust_site_uses_all bill_su,
apps.wsh_bols_rd_v wbrv
WHERE wbrv.delivery_id = da.delivery_id
AND dd.delivery_detail_id = da.delivery_detail_id
AND dd.source_line_id = ool.line_id
AND dd.source_header_id = ool.header_id
AND ool.header_id = ooh.header_id
AND ool.flow_status_code = ('CLOSED')
AND ooh.sold_to_org_id = 1351
AND ool.actual_shipment_date IS NOT NULL
AND ooh.ordered_date >= SYSDATE - 180
AND bill_su.LOCATION IN
('San Antonio - PO Box 795054')
AND ooh.invoice_to_org_id =
bill_su.site_use_id
UNION
SELECT ool.cust_po_number po_number,
TRUNC
(ool.actual_shipment_date
) ship_date,
nd.attribute3 bol
FROM apps.oe_order_headers_all ooh,
apps.oe_order_lines_all ool,
apps.wsh_delivery_details dd,
apps.wsh_delivery_assignments da,
apps.wsh_new_deliveries nd,
apps.hz_cust_site_uses_all bill_su
WHERE nd.delivery_id = da.delivery_id
AND dd.delivery_detail_id = da.delivery_detail_id
AND dd.source_line_id = ool.line_id
AND dd.source_header_id = ool.header_id
AND ool.header_id = ooh.header_id
AND ool.flow_status_code = ('CLOSED')
AND ooh.sold_to_org_id = 1351
AND ool.actual_shipment_date IS NOT NULL
AND nd.attribute3 IS NOT NULL
AND ooh.ordered_date >= SYSDATE - 365
AND bill_su.LOCATION IN
('San Antonio - PO Box 795054')
AND ooh.invoice_to_org_id =
bill_su.site_use_id
ORDER BY ship_date DESC)
ORDER BY shipping_date DESC)
WHERE ROWNUM < 11
ORDER BY shipping_date DESC;

In the future, please format your code using the { code } tags (no spaces in between) so that your code retains formatting and is easier for us to read.
I looked at your query and it seems like you should be able to remove the entire UNION portion of the query (the only difference i could detect was in the ordered date logic).
AND
    AND ooh.ordered_date >= SYSDATE - 180
OR
    AND nd.attribute3 IS NOT NULL
    AND ooh.ordered_date >= SYSDATE - 365
)So no UNION required, should save you a lot of processing time.
***I'd also remove the INDEX HINT, unless you're certain you're smarter than the cost based optimizer (which does quite a good job assuming your statistics are up to date).
Edited by: Tubby on Nov 12, 2009 9:45 AM

Similar Messages

  • Performance tuning in oracle 10g

    Hi Guys
    i hope all are well,Have a nice day Today
    i have discuss with some performance tuning issue
    recently , i joined the new project that project improve the efficiency of the applicaton. in this environment oracle plsql langauage are used , so if i need to improve effiency of application what are the step are taken
    and what are the way to go through the process improvement
    kindly help me

    generate statspack/AWR reports
    HOW To Make TUNING request
    https://forums.oracle.com/forums/thread.jspa?threadID=2174552#9360003

  • Oracle Performance Tuning

    Hi,
    Our organization recently also encounter Oracle DB performance issue, whereby I am searching for information for us to going into diagnostic the problem and finding the root cause of this performance problem.
    I had read through this old article where I found a number of points being highlighted was a good start for us, and just about this port, we would like to understand what in details of AIX 5.3 and asynch I/O turned-on had to do with Oracle DB performance, unfortunately the URL given in the article (possible due to the twas back in 2006), is no longer valid (http://www.oracle.com/technology/pub/articles/lewis_cbo.html), I tried that but the pages being redirected to (http://www.oracle.com/technetwork/articles/index.html).
    May I know, would you able to provide me the new URL path for the mentiened AIX 5.3 asynch I/O turned-on related information?
    Our environment:
    1) OS AIX 5.3
    2) Oracle DB 10g
    (If I have the AWR Report, would it be better possition for you to help us?)
    Thank you in advanced.
    Best Regards,
    KaiLoon Kok
    Edited by: 991132 on Feb 28, 2013 11:19 PM

    Hi,
    performance tuning is a very large argument and the causes of degradation may be many.
    There are several consideration that You have to do like:
    - which kind of application is running on the DB
    - which kind of optimizer is used
    - the striping of the data files across the disks
    - the dimension of the DB block
    - the waits that DB encounters
    - many other things like SORT_AREA_SIZE, HASH_AREA_SIZE, etc.
    To begin Yr analysis use the utlbstat.sql and utlestat.sql scripts provided in the $ORACLE_HOM/rdbms/admin directory and check the conditions of the DB.
    Increasing the SGA, like You've done, may not be the solution, somtimes it may instead decrease the overall performances.
    Also check in wich case the DB is slow, ex. executing some particular procedure, excuting a particular query, ....
    Try to identify the better the DB and then try to resubmit Yr problem.
    Bye Max
    null

  • SAP Performance tuning

    What measures shall we take if it is needed to performance tune the SAP Server. It is getting too slow. It will be helpful if someone can send me some link about SAP Performance tuning, not ABAP performance tuning.
    Regards,
    Subhasish

    The SAP Servers can be slow because of many reasons:
    1. The Table Consistency: The tables should be consistent. A consistency check should be done regulalrly.Better would be using DB13 so that it can be scheduled in appropriate days.
    2. One major reason that I have found in recent times is the amount of authorizations that might be available to the users of the sytem. If all the users have a high volume of authorization objects in their user master buffer, then the response time becomes sluggish.This is true for most of the dev boxes that allow almost any amount of authorization for users and have a low RAM size.
    3. Also you might be intrested to check your network consistency. If you are accessing your servers from home with a wireless connection of 16kbps, you might want to configure your logon pad for such a crappy connection.
    Most of the BASIS performance tuning tasks such as ST04, STAT, ST02 and DB12 should be carried out too just to investigate furthur.
    Hope these were a few helpful tips.
    Peace be with everybody
    -Saurav

  • MySQL InnoDB performance tuning

    Hi,
    We recently updated our Solaris 10 (Sparc) patch level. It is from:
    Solaris 10 8/07 s10s_u4wos_12b SPARC
    Patch level 137111-05
    to
    Solaris 10 10/09 s10s_u8wos_08a SPARC
    Patch level 144488-14
    We have two functions in MySQL uses InnoDB. In the old version of Solaris 10 (8/07), one function takes less than 1 sec to finish execute.
    However in the newer version of Solaris 10 (10/09). It takes about 40 secs to finish execute.
    So, we found one solution in google that said to change the innodb_flush_log_at_trx_commit to 0 instead of default 1, then the function take only about 0.41 sec to finish execute.
    So does anyone know what did the newer version of Solaris (update 8) has changed that I need to change this innodb_flush_log_at_commit to make better performance b/c the older version of Solaris the mysql innodb_flush_log_at_trx_commit still 1 and peformance is less than 1 secs.
    Thanks!

    No one can tell you how to tune your database because there are too many variables that are specific to your installation.
    Some of the major factors hinge on the size of your database tables, both in terms of number of rows and the type of data within them. Then there's questions of whether you're using InnoDB or MyISAM, the cacheability of the data, the ratio of reads to writes, the size of each record, etc., etc., etc.
    Tuning paramaters for a 4 TB database with 20,000,000 rows are going to be radically different than those for a 100MB database with 10,000 rows.
    Then, of course, there are factors that aren't in my.cnf anyway - things like table indexes, data formats, query structure, etc.
    The same query can take radically different amounts of time depending on the indexes on the table. Conversely, much (most?) performance tuning comes down to query optimization rather than database configuration - reordering the parameters in a query can have dramatic effects on performance, depending on the database structure.
    So, you see, you're not likely to find a magic bullet that says 'make sure you add the gofaster=1 parameter to your my.cnf'. Database Administrators make a living with this stuff and every situation is different.

  • Oracle Memory Issue/ performance tuning

    I have Oracle 9i running on Window 2003 server. 2 GB memory is allocated to Oralce DB( even though server has 14GB memory)
    Recently, the oracle process has been slow.. running query
    I ran the window task manager. Here is the numbers that I see
    Mem usage: 556660k
    page Faults: 1075029451
    VM size: 1174544 K
    I am not sure how to analyze this data. why the page fault is so huge. and Mem usage is half of VM size?
    How can I do the performance tuning on this box?

    I'm having a similar issue with Oracle 10g R2 64-bit on Windows 2003 x64. Performance on complicated queries is abysmal because [I think] most of the SGA is sitting in a page file, even though there is plenty of physical RAM to be had. Performance on simple queries is probably bad also, but it's not really noticable. Anyway, page faults skyrocket when I hit the "go" button on big queries. Our legacy system runs our test queries in about 5 minutes, but the new system takes at least 30 if not 60. The new system has 24 gigs of RAM, but at this point, I'm only allocating 1 gig to the SGA and 1/2 gig to the PGA. Windows reports oracle.exe has 418,000K in RAM and 1,282,000K in the page file (I rounded a bit). When I had the PGA set to 10 gigs, the page usage jumped to over 8 gigs.
    I tried adding ORA_LPENABLE=1 to the registry, but this issue seems to be independent. Interestingly, the amount of RAM taken by oracle.exe goes down a bit (to around 150,000K) when I do this. I also added "everyone" to the security area "lock pages in memory", but again, this is probably unrelated.
    I did an OS datafile copy and cloned the database to a 32-bit windows machine (I had to invalidate and recompile all objects to get this to work), and this 32-bit test machine now has the same problem.
    Any ideas?

  • FDQM performance tuning

    Hi,
    I've recently installed a FDQM application (EPM 11.1.2.2) on a windows environment 64 bit 2008 R2. It takes me 10 mins to create a application (creating app +connecting to database).
    FDQM is configured to run on IIS. Just wondering if anyone has done any performance tuning on FDQM?
    Any tips or pointers to any documents will be helpful..
    Thanks in Advance!!

    It can take a while to create an application, it has never been the fastest at creating them.
    If you are looking for tuning then you can look at the DBA guide - http://docs.oracle.com/cd/E17236_01/epm.1112/fdm_dba.pdf
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Report running for long time & performance tuning

    Hi All,
    (1). WebI report is running for long time.so what are the steps i need to check for it ?
    (2). Can you tell me about performance tuning in BO ?
    please help me.....
    Thanks
    Kumar

    (1). WebI report is running for long time.so what are the steps i need to check for it ?
    The first step is to see if the problem lies in the query on the data source or in webi itself. Depending on the data source there are different ways to extract the query and try to run it against the database. Which source does your report uses?
    (2). Can you tell me about performance tuning in BO ?
    I would recommend to start by reading the administrator's guide. There is a section about how to improve performance.
    Regards,
    Stratos

  • Oracle  11g Performance tuning approach ?

    Hello Experts,
    Is it the right forum to follow oracle performance tuning discussions ? If not, let me know what will be the forum to pick up some thread on this subject.
    I am looking for performance tuning approach for oracle 11g. I learned there are some new items in 11g in this regard. For persons, who did tuning in earlier versions of Oracle,
    what will be the best way adopt to 11 g?
    I reviewed the 11g performance tuning guide, but I am looking for some white papers/blogs with case studies and practical approaches. I hope that you have used them.
    What are the other sources to pick up some discussions?
    Do you mind, share your thoughts?
    Thanks in advance.
    RI

    The best sources of information on performance tuning are:
    1. Jonathan Lewis: http://jonathanlewis.wordpress.com/all-postings/
    2. Christian Antognini: http://www.antognini.ch/
    3. Tanel Poder: http://blog.tanelpoder.com/
    4. Richard Foote: http://richardfoote.wordpress.com/
    5. Cary Millsap: http://carymillsap.blogspot.com/
    and a few dozen others whose blogs you will find cross-referenced in those above.

  • Performance tuning of BPEL processes in SOA Suite 11g

    Hi,
      We are working with a customer for performance tuning of SOA Suite 11g, one of the areas is to tune the BPEL processes. I am new to this and started out with stress testing Hello World process using SOAPUI tool. I would like help with the below topics -
    1. How do I interpret the statistics collected during stress testing? Do we have any benchmark set that can indicate that the performance is ok.
    2. Do we need to run stress tests for every BPEL process deployed?
    2. Is there any performance tuning strategy documentation available? Or can anybody share his/her experiences to guide me?
    Thanks in advance!
    Sritama

    1. How do I interpret the statistics collected during stress testing? Do we have any benchmark set that can indicate that the performance is ok.
    You need
    pay attention to:
    java heap usage vs java heap capacity
    java eden usage vs java eden capacity
    JDBC pool initial connections vs JDBC pool capacity connections
    if you are using linux: top
    if you are using aix: topas
    2. Do we need to run stress tests for every BPEL process deployed?
    yes, you need test each BPEL. You can use "Jmeter" tool.
    Download Jmeter from here: Apache JMeter - Apache JMeter&amp;trade;
    Other tools:
    jstat
    jstack
    jps -v
    Enterprise Manager
    WebLogic Console
    VisualVM
    JRockit Mission Control
    3. Is there any performance tuning strategy documentation available? Or can anybody share his/her experiences to guide me?
    I recommend "Oracle SOA Suite 11g Performance Tuning Cookbook" http://www.amazon.com/Oracle-Suite-Performance-Tuning-Cookbook/dp/1849688842/ref=sr_1_1?ie=UTF8&qid=1378482031&sr=8-1&keywords=oracle+soa+suite+11g+performance+tuning+cookbook

  • Performance tuning related issues

    hi experts
      i am new to performance tuning application. can any one share some stuff(bw3.5& bi7)related to the concern area.send any relavent docs to my id: [email protected] .
      thanks in advance
    regards
    gavaskar
    [email protected]

    hi Gavaskar,
    check this, you can download lot of performance materials
    Business Intelligence Performance Tuning [original link is broken]
    and e-learning -> intermediate course and advance course
    https://www.sdn.sap.com/irj/sdn/developerareas/bi?rid=/webcontent/uuid/fe5b0b5e-0501-0010-cd88-c871915ec3bf [original link is broken]
    e.g
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/10b589ad-0701-0010-0299-e5c282b7aaad
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/d9fd84ad-0701-0010-d9a5-ba726caa585d
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/8e6183ad-0701-0010-e083-9ab1c6afe6f2
    performance tools in bw 3.5
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/07a4f070-0701-0010-3b91-a6bf7644c98f
    (here also you can download the presentation by righ click the disk drive icon)
    hope this helps.

  • [ADF-11.1.2] Proof of view performance tuning in oracle adf

    Hello,
    Take an example of : http://www.gebs.ro/blog/oracle/adf-view-object-performance-tuning-analysis/
    It tells me perfectly how to tune VO to achieve performance, but how to see it working ?
    For example: I Set Fetch size of 25, 'in Batch of' set to 1 or 26 I see following SQL Statement in Log
    [1028] SELECT Company.COMPANY_ID,         Company.CREATED_DATE,         Company.CREATED_BY,         Company.LAST_MODIFY_DATE,         Company.LAST_MODIFY_BY,         Company.NAME FROM COMPANY Companyas if it is fetching all the records from table at a time no matter what's the size of Batch. If I am seeing 50 records on UI at a time, then I would expect at least 2 SELECT statement fetching 26 records by each statement if I set Batch Size to 26... OR at least 50 SELECT statement for Batch size set to '1'.
    Please tell me how to see view performance tuning working ? How one can say that setting batch size = '1' is bad for performance?

    Anandsagar,
    why don't you just read up on http://download.oracle.com/docs/cd/E21764_01/core.1111/e10108/adf.htm#CIHHGADG
    there are more factors influencing performance than just query. Btw, indexing your queries also helps to tune performance
    Frank

  • Performance tuning in PL/SQL code

    Hi,
    I am working on already existing PL/SQL code which is written by someone else on validation and conversion of data from a temporary table to base table. It usually has 3.5 million rows. and the procedure takes arount 2.5 - 3 hrs to complete.
    Can I enhance the PL/SQL code for better performance ? or, is this OK to take so long to process these many rows?
    Thanks!
    Yogini

    Can I enhance the PL/SQL code for better performance ? Probably you can enhance it.
    or, is this OK to take so long to process these many rows? It should take a few minutes, not several hours.
    But please provide some more details like your database version etc.
    I suggest to TRACE the session that executes the PL/SQL code, with WAIT events, so you'll see where and on what time is spent, you'll identify your 'problem statements very quickly' (after you or your DBA have TKPROF'ed the trace file).
    SQL> alter session set events '10046 trace name context forever, level 12';
    SQL> execute your PL/SQL code here
    SQL> exitWill give you a .trc file in your udump directory on the server.
    http://www.oracle-base.com/articles/10g/SQLTrace10046TrcsessAndTkprof10g.php
    Also this informative thread can give you more ideas:
    HOW TO: Post a SQL statement tuning request - template posting
    as well as doing a search on 10046 at AskTom, http://asktom.oracle.com will give you more examples.
    and reading Oracle's Performance Tuning Guide: http://www.oracle.com/pls/db102/to_toc?pathname=server.102%2Fb14211%2Ftoc.htm&remark=portal+%28Getting+Started%29

  • Performance tuning in t

    hi,
    I have to do perofrmance for one program, it is taking 67000 secs in back ground for execution and 1000 secs for some varints .It is an  ALV report.
    please suggest me how to proced to change the code.

    Performance tuning for Data Selection Statement
    <b>http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm</b>Debugger
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
    http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
    Run Time Analyser
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/content.htm
    SQL trace
    http://help.sap.com/saphelp_47x200/helpdata/en/d1/801f7c454211d189710000e8322d00/content.htm
    CATT - Computer Aided Testing Too
    http://help.sap.com/saphelp_47x200/helpdata/en/b3/410b37233f7c6fe10000009b38f936/frameset.htm
    Test Workbench
    http://help.sap.com/saphelp_47x200/helpdata/en/a8/157235d0fa8742e10000009b38f889/frameset.htm
    Coverage Analyser
    http://help.sap.com/saphelp_47x200/helpdata/en/c7/af9a79061a11d4b3d4080009b43351/content.htm
    Runtime Monitor
    http://help.sap.com/saphelp_47x200/helpdata/en/b5/fa121cc15911d5993d00508b6b8b11/content.htm
    Memory Inspector
    http://help.sap.com/saphelp_47x200/helpdata/en/a2/e5fc84cc87964cb2c29f584152d74e/content.htm
    ECATT - Extended Computer Aided testing tool.
    http://help.sap.com/saphelp_47x200/helpdata/en/20/e81c3b84e65e7be10000000a11402f/frameset.htm
    Just refer to these links...
    performance
    Performance
    Performance Guide
    performance issues...
    Performance Tuning
    Performance issues
    performance tuning
    performance tuning
    You can go to the transaction SE30 to have the runtime analysis of your program.Also try the transaction SCI , which is SAP Code Inspector.

  • Performance tuning in CRM server

    Hi everyone,
       My CRM server working very slow. Idont know the exact reason. My server configuration IBM Xeon processor 3 Ghz 3GB RAM.There are about 25 users. Is this problem with SAP or Hardware.If any one have performance tuning document plz post it.
    Thanks,
    Murali

    Chech the following:-
    Processor usage
    Ram usage
    background jobs
    how many user at a time
    what kind of job they do
    Any Network Problem
    Increse Work Processor
    increase Virtual Ram
    And for 25 users, You need System with 2 CPU and 4 Gb Ram
    Regards

Maybe you are looking for