Improve query speed

Hi there,
I'm relatively new to Pl/SQL and to APEX and i'm developing a application on APEX. So i have a report on a page which pulls out the orders according to the type of user. If the type is not LOG_FARM,'MANAGER','MNG_FARM' the code runs fine in acceptable time but when the user is one of those three it takes almost 3 minutes to finish the query. What i wanted to know is if within the code you see any clear change that i could do to improve the speed or if i can for example bring only the newest results (although this last option is not good because i have a search engine above and like this i wont have acess to older registers).
Declare
v_restricao varchar2(100);
v_restricao_dim varchar2(4000);
Begin
if :G_APP_USER_EMP_TYPE = 'LOG_FARM' then
v_restricao := 'and FO.ORDER_LOGISTICS = ''Y''';
else
v_restricao := null;
end if;
if :G_APP_USER_EMP_TYPE IN('MNG_FARM','DIM_FARM') then
v_restricao_dim := '
WHERE pharmacyid in (SELECT pharm_id
FROM dim_user
WHERE UPPER (emp_login) = UPPER ('''||:app_user||''')) ';
end if;
if :G_APP_USER_EMP_TYPE = 'CALL_FARM' then
v_restricao_dim := '
WHERE pharmacyid IN (SELECT DISTINCT pharmid
FROM dimuser
WHERE SEL_PHARM = ''Y'' ) ';
end if;
if :G_APP_USER_EMP_TYPE IN('LOG_FARM','MANAGER','MNG_FARM') then
return 'SELECT fo.pharm_id, fo.order_id, dp.pharmacy_dsc, ds.whs_dsc, to_CHAR(fo.order_dt,''DD/MM/YYYY'') AS ORDER_DT,
fo.order_obs, acronyms (fo.order_stat, ''ORDER.STATUS'') as STATUS,
fo.order_stat
FROM fact_order fo,
dim_pharm dp,
dim_whs ds
WHERE upper(order_id) LIKE NVL(upper('''||:p501_order_id||'''),''%'')
AND fo.pharm_id = dp.pharmacy_id
AND fo.whs_id = ds.whs_id ' || v_restricao || '
order by fo.order_id desc ';
ELSE
return 'SELECT fo.pharm_id, fo.order_id, dp.pharmacy_dsc, ds.whs_dsc, to_CHAR(fo.order_dt,''DD/MM/YYYY'') AS ORDER_DT,
fo.order_obs, acronyms (fo.order_stat, ''ORDER.STATUS'') as STATUS,
fo.order_stat,(select dkap.emp_name from dim_kap dkap where DKAP.PHARM_ID = FO.PHARM_ID AND DKAP.sel_pharm = ''Y'') AS KAP
FROM fact_order fo,
dim_pharm dp,
dim_whs ds ,
(SELECT pharmacyid
FROM dim_pharm ' || v_restricao_dim ||' ) dim_phar
WHERE upper(order_id) LIKE NVL(upper('''||:p501_order_id||'''),''%'')
AND fo.pharm_id = dp.pharmacy_id
AND fo.whs_id = ds.whs_id
and FO.ORDER_LOGISTICS = ''N''
AND dim_phar.pharmacy_id = fo.pharm_id
order by fo.order_id desc';
END IF;
END;
The two are quite similar only the second has a condition to show only the pharmacys associated with the current user and the first one shows all the pharmacys.
Thanks in advance.
Bruno

Hi there,
I'm relatively new to Pl/SQL and to APEX and i'm developing a application on APEX. So i have a report on a page which pulls out the orders according to the type of user. If the type is not LOG_FARM,'MANAGER','MNG_FARM' the code runs fine in acceptable time but when the user is one of those three it takes almost 3 minutes to finish the query. What i wanted to know is if within the code you see any clear change that i could do to improve the speed or if i can for example bring only the newest results (although this last option is not good because i have a search engine above and like this i wont have acess to older registers).
Declare
v_restricao varchar2(100);
v_restricao_dim varchar2(4000);
Begin
if :G_APP_USER_EMP_TYPE = 'LOG_FARM' then
v_restricao := 'and FO.ORDER_LOGISTICS = ''Y''';
else
v_restricao := null;
end if;
if :G_APP_USER_EMP_TYPE IN('MNG_FARM','DIM_FARM') then
v_restricao_dim := '
WHERE pharmacyid in (SELECT pharm_id
FROM dim_user
WHERE UPPER (emp_login) = UPPER ('''||:app_user||''')) ';
end if;
if :G_APP_USER_EMP_TYPE = 'CALL_FARM' then
v_restricao_dim := '
WHERE pharmacyid IN (SELECT DISTINCT pharmid
FROM dimuser
WHERE SEL_PHARM = ''Y'' ) ';
end if;
if :G_APP_USER_EMP_TYPE IN('LOG_FARM','MANAGER','MNG_FARM') then
return 'SELECT fo.pharm_id, fo.order_id, dp.pharmacy_dsc, ds.whs_dsc, to_CHAR(fo.order_dt,''DD/MM/YYYY'') AS ORDER_DT,
fo.order_obs, acronyms (fo.order_stat, ''ORDER.STATUS'') as STATUS,
fo.order_stat
FROM fact_order fo,
dim_pharm dp,
dim_whs ds
WHERE upper(order_id) LIKE NVL(upper('''||:p501_order_id||'''),''%'')
AND fo.pharm_id = dp.pharmacy_id
AND fo.whs_id = ds.whs_id ' || v_restricao || '
order by fo.order_id desc ';
ELSE
return 'SELECT fo.pharm_id, fo.order_id, dp.pharmacy_dsc, ds.whs_dsc, to_CHAR(fo.order_dt,''DD/MM/YYYY'') AS ORDER_DT,
fo.order_obs, acronyms (fo.order_stat, ''ORDER.STATUS'') as STATUS,
fo.order_stat,(select dkap.emp_name from dim_kap dkap where DKAP.PHARM_ID = FO.PHARM_ID AND DKAP.sel_pharm = ''Y'') AS KAP
FROM fact_order fo,
dim_pharm dp,
dim_whs ds ,
(SELECT pharmacyid
FROM dim_pharm ' || v_restricao_dim ||' ) dim_phar
WHERE upper(order_id) LIKE NVL(upper('''||:p501_order_id||'''),''%'')
AND fo.pharm_id = dp.pharmacy_id
AND fo.whs_id = ds.whs_id
and FO.ORDER_LOGISTICS = ''N''
AND dim_phar.pharmacy_id = fo.pharm_id
order by fo.order_id desc';
END IF;
END;
The two are quite similar only the second has a condition to show only the pharmacys associated with the current user and the first one shows all the pharmacys.
Thanks in advance.
Bruno

Similar Messages

  • How to improve this query speed ?....help me

    How to improve the query speed. Any hints can u suggest in the query or any correction. Here i am using sample tables for checking purpose, When i am trying with my original values, this type of query taking longer time to run
    select ename,sal,comm from emp where(comm is null and &status='ok') or (comm is not null and &status='failed');
    Thanx in advance
    prasanth a.s.

    What about
    select ename,sal,comm from emp where comm is null and &status='ok'
    union all
    select ename,sal,comm from emp where comm is not null and &status='failed';
    Regards
    Vaishnavi

  • How to improve query performance using infoset

    I create one infoset that including 4 char.and 3 DSO which all are time-dependent.When query run, system show very poor perfomance, sometimes no data show in BEX anayzer. In this case I have to close BEX analyzer at first and then open it again, after that it show real results. It seems very strange. Does anybody has experience on infoset performance improvement. pls info, thanks!

    Hi
    As info set itself doesn't have any data so it improves Performance
    also go through the below tips.
    Find the query Run-time
    where to find the query Run-time ?
    557870 'FAQ BW Query Performance'
    130696 - Performance trace in BW
    This info may be helpful.
    General tips
    Using aggregates and compression.
    Using less and complex cell definitions if possible.
    1. Avoid using too many nav. attr
    2. Avoid RKF and CKF
    3. Many chars in row.
    By using T-codes ST03 or ST03N
    Go to transaction ST03 > switch to expert mode > from left side menu > and there in system load history and distribution for a particular day > check query execution time.
    Statistical Records Part 4: How to read ST03N datasets from DB in NW2004
    How to read ST03N datasets from DB
    Try table rsddstats to get the statistics
    Using cache memory will decrease the loading time of the report.
    Run reporting agent at night and sending results to email. This will ensure use of OLAP cache. So later report execution will retrieve the result faster from the OLAP cache.
    Also try
    1. Use different parameters in ST03 to see the two important parameters aggregation ratio and records transferred to F/E to DB selected.
    2. Use the program SAP_INFOCUBE_DESIGNS (Performance of BW infocubes) to see the aggregation ratio for the cube. If the cube does not appear in the list of this report, try to run RSRV checks on the cube and aggregates.
    Go to SE38 > Run the program SAP_INFOCUBE_DESIGNS
    It will shown dimension Vs Fact tables Size in percent.If you mean speed of queries on a cube as performance metric of cube,measure query runtime.
    3. To check the performance of the aggregates,see the columns valuation and usage in aggregates.
    Open the Aggregates...and observe VALUATION and USAGE columns.
    "---" sign is the valuation of the aggregate. You can say -3 is the valuation of the aggregate design and usage. ++ means that its compression is good and access is also more (in effect, performance is good). If you check its compression ratio, it must be good. -- means the compression ratio is not so good and access is also not so good (performance is not so good).The more is the positives...more is useful the aggregate and more it satisfies the number of queries. The greater the number of minus signs, the worse the evaluation of the aggregate. The larger the number of plus signs, the better the evaluation of the aggregate.
    if "-----" then it means it just an overhead. Aggregate can potentially be deleted and "+++++" means Aggregate is potentially very useful.
    In valuation column,if there are more positive sign it means that the aggregate performance is good and it is useful to have this aggregate.But if it has more negative sign it means we need not better use that aggregate.
    In usage column,we will come to know how far the aggregate has been used in query.
    Thus we can check the performance of the aggregate.
    Refer.
    http://help.sap.com/saphelp_nw70/helpdata/en/b8/23813b310c4a0ee10000000a114084/content.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/60/f0fb411e255f24e10000000a1550b0/frameset.htm
    performance ISSUE related to AGGREGATE
    Note 356732 - Performance Tuning for Queries with Aggregates
    Note 166433 - Options for finding aggregates (find optimal aggregates for an InfoCube)
    4. Run your query in RSRT and run the query in the debug mode. Select "Display Aggregates Found" and "Do not use cache" in the debug mode. This will tell you if it hit any aggregates while running. If it does not show any aggregates, you might want to redesign your aggregates for the query.
    Also your query performance can depend upon criteria and since you have given selection only on one infoprovider...just check if you are selecting huge amount of data in the report
    Check for the query read mode in RSRT.(whether its A,X or H)..advisable read mode is X.
    5. In BI 7 statistics need to be activated for ST03 and BI admin cockpit to work.
    By implementing BW Statistics Business Content - you need to install, feed data and through ready made reports which for analysis.
    http://help.sap.com/saphelp_nw70/helpdata/en/26/4bc0417951d117e10000000a155106/frameset.htm
    /people/vikash.agrawal/blog/2006/04/17/query-performance-150-is-aggregates-the-way-out-for-me
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1955ba90-0201-0010-d3aa-8b2a4ef6bbb2
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ce7fb368-0601-0010-64ba-fadc985a1f94
    http://help.sap.com/saphelp_nw04/helpdata/en/c1/0dbf65e04311d286d6006008b32e84/frameset.htm
    You can go to T-Code DB20 which gives you all the performance related information like
    Partitions
    Databases
    Schemas
    Buffer Pools
    Tablespaces etc
    use tool RSDDK_CHECK_AGGREGATE in se38 to check for the corrupt aggregates
    If aggregates contain incorrect data, you must regenerate them.
    202469 - Using aggregate check tool
    Note 646402 - Programs for checking aggregates (as of BW 3.0B SP15)
    You can find out whether an aggregate is usefull or useless you can find out through a proccess of checking the tables RSDDSTATAGGRDEF*
    Run the query in RSRT with statistics execute and come back you will get STATUID... copy this and check in the table...
    This gives you exactly which infoobjects it's hitting, if any one of the object is missing it's useless aggregate.
    6
    Check SE11 > table RSDDAGGRDIR . You can find the last callup in the table.
    Generate Report in RSRT
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cccad390-0201-0010-5093-fd9ec8157802
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4c0ab590-0201-0010-bd9a-8332d8b4f09c
    Business Intelligence Journal Improving Query Performance in Data Warehouses
    http://www.tdwi.org/Publications/BIJournal/display.aspx?ID=7891
    Achieving BI Query Performance Building Business Intelligence
    http://www.dmreview.com/issues/20051001/1038109-1.html
    Assign points if useful
    Cheers
    SM

  • How can I improve download speed

    How can I improve download speed of movies purchased from iTunes on my AppleTV? 10 hours+ minimum. I've already selected a lower video resolution from the settings in the iTunes store.   It used to be way faster. Any suggestions?  Thanks.

    Check the Internet speed to confirm it is what it is supposed to be by going to www.speedtest.net
    On the ATV, try Settings > General > Reset.
    Power cycle the router, modem, and the ATV

  • How to improve the speed for backing up files to time capsule via in hose wifi?

    How to improve the speed for backing up files to time capsule via in hose wifi?

    via in hose wifi?
    Use a bigger hose??
    House??
    Need to spell this out a bit more..
    But speed via 2.4ghz to the TC is restricted by Apple to max 130mbps link speed.. much slower actual transfer.. latest TC and laptops can do 450mbps on 5ghz but you need to be up close.. so place the TC near the device using it.. and force 5ghz connection by using a different name for 5ghz network.

  • How to improve Query performance on large table in MS SQL Server 2008 R2

    I have a table with 20 million records. What is the best option to improve query performance on this table. Is partitioning the table into filegroups  is a best option or splitting the table into multiple smaller tables? 

    Hi bala197164,
    First, I want to inform that both to partition the table into filegroups and split the table into multiple smaller tables can improve the table query performance, and they are fit for different situation. For example, our table have one hundred columns and
    some columns are not related to this table object directly (for example, there is a table named userinfo to store user information, it has columns address_street, address_zip,address_ province columns, at this time, we can create a new table named as Address,
    and add a foreign key in userinfo table references Address table), under this situation, by splitting a large table into smaller, individual tables, queries that access only a fraction of the data can run faster because there is less data to scan. Another
    situation is our table records can be grouped easily, for example, there is a column named year to store information about product release date, at this time, we can partition the table into filegroups to improve the query performance. Usually, we perform
    both of methods together. Additionally, we can add index to table to improve the query performance. For more detail information, please refer to the following document:
    Partitioning:
    http://msdn.microsoft.com/en-us/library/ms178148.aspx
    CREATE INDEX (Transact-SQL):
    http://msdn.microsoft.com/en-us/library/ms188783.aspx
    TechNet
    Subscriber Support 
    If you are
    TechNet Subscription user and have any feedback on our support quality, please send your feedback
    here.
    Allen Li
    TechNet Community Support

  • How to improve spreadsheet speed when single-threaded VBA is the bottleneck.

    My brother works with massive Excel spreadsheets and needs to speed them up. Gigabytes in size and often with a million rows and many sheets within the workbook. He's already refined the sheets to take advantage of Excel's multi-thread recalculation and
    seen significant improvements, but he's hit a stumbling block. He uses extensive VBA code to aid clarity, but the VB engine is single-threaded, and these relatively simple functions can be called millions of times. Some functions are trivial (e.g. conversion
    functions) and just for clarity and easily unwound (at the expense of clarity), some could be unwound but that would make the spreadsheets much more complex, and others could not be unwound. 
    He's aware of http://www.analystcave.com/excel-vba-multithreading-tool/ and similar tools but they don't help as the granularity is insufficiently fine. 
    So what can he do? A search shows requests for multi-threaded VBA going back over a decade.
    qts

    Hi,
    >> The VB engine is single-threaded, and these relatively simple functions can be called millions of times.
    The Office Object Model is
    Single-Threaded Apartments, if the performance bottleneck is the Excel Object Model operation, the multiple-thread will not improve the performance significantly.
    >> How to improve spreadsheet speed when single-threaded VBA is the bottleneck.
    The performance optimization should be based on the business. Since I’m not familiar with your business, so I can only give you some general suggestions from the technical perspective. According to your description, the size of the spreadsheet had reached
    Gigabytes and data volume is about 1 million rows. If so, I will suggest you storing the data to SQL Server and then use the analysis tools (e.g. Power Pivot).
    Create a memory-efficient Data Model using Excel 2013
    and the Power Pivot add-in
    As
    ryguy72 suggested, you can also leverage some other third party data processing tool
    according to your business requirement.
    Regards,
    Jeffrey
    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.

  • Slow.  iMac 10.5.8.  Verified Disk Permissions and then Repaired Disk Permissions.  Not much improvement in speed.  How do I empty internet files from safari?

    iMac 10.5.8 is slow.  Verified Disk Permissions and then repaired.  No big improvement in speed.
    What about internet files (safari and firefox) ; caches and cookies?
    Thank you.

    Applejack might help.
    Download:
    http://sourceforge.net/projects/applejack/
    Article on using:
    http://reviews.cnet.com/8301-13727_7-10334620-263.html?tag=mfiredir
    It runs in single user mode, where it runs more safely than other maintenance/cleaning programs because there is less chance of interference from the OS. After installing (you won't see it in the Applications Folder) hold CMD-S at startup. You will get a black screen with MS-DOS like text. Just follow the prompts: type in "applejack AUTO" and it will run through the following:
    Correct any Disk problems.
    Repair Permissions.
    Clear out Cache Files.
    Repair/check several plist files.
    Dump the VM files for a fresh start.
    Trash old Log files.
    You can also run tasks selectively and for specific users by typing in "applejack." After running in "AUTO,"  you can go back and run it again as "applejack," steps 3 & 4 only, for your user.
    The first reboot will take much longer than usual, as it rebuilds caches. It may take several restarts to see the benefits. Because of the deep cache cleaning in AUTO mode some applications may tell you they are being opened for the first time.
    NOT YET UPDATED FOR LION
    (Adapted from post by BDAqua)

  • Provide best methodology to improve the speed of the web page

    provide best methodology to improve the speed of the web page.

    Use smaller images.
    Here's an idea.. why don't you explain exactly what problem you are trying to solve... Gee how clever.
    Do you have a page that takes minutes to load? If yes... remove "stuff". That is how to make it faster. There is no other magic way (unless of course the problem is that it takes that length of time to process the page on your server but for the moment we will assume that is not the case)
    What stuff should you remove? Content. Images..... as described above. This isn't rocket science. If you are another one of these self described J2EE experts who has made a page that displays 20,000 database records at one time your page is going to be slow until you remedy your shoddy design.
    But whatever the real problem is the way to make a page "faster" is to remove "stuff" from it. What that stuff is and what you should remove are entirely known only to you... so really asking anyone else is pointless.

  • How many ways can i improve query performance?

    Hi All,
    can any body help me
    How many ways can i improve query performance in oracle ?
    Thanks,
    narasimha

    As many as you can think of them!!!

  • I have a new ipad with retina display and the orientation change from portrait to landscape is extremely slow? How can I improve the speed?

    Any ideas on how to improve the speed ?

    Hi rodtheprod,
    I apologize, I'm a bit unclear on the issue you are describing. If a movie from the iTunes Store supports multiple languages, they can usually be changed as outlined in the following article:
    iTunes: Language settings for video
    http://support.apple.com/kb/HT5562
    If this is not possible and no changes have been made to the country settings for the iTunes Store, you may want to try redownloading the movie (if it is still available):
    Download past purchases
    http://support.apple.com/kb/HT2519
    Regards,
    - Brenden

  • Improve query performance

    Hi,
    I am executing one query it takes 40-45 mins, can anybody tell me where is the issue because I have index on SUBSCRIPTION table.
    Query is taking time in Nested Loop. Can anyboduy please help to improve query performance.
    Select count(unique individual_id)
    from SUBSCRIPTION S ,SOURCE D WHERE S.ORDER_DOCUMENT_KEY_CD=D.FULFILLMENT_KEY_CD AND prod_abbr='TOH'
    and to_char(source_start_dt,'YYMM')>='1010' and mke_mag_source_type_cd='D';
    select count(*) from source; ----------3,425,131
    select count(*) from subscription;---------394,517,271
    Below is exlain Plan
    Plan
    SELECT STATEMENT CHOOSECost: 219 Bytes: 38 Cardinality: 1                                              
    13 SORT GROUP BY Bytes: 38 Cardinality: 1                                                   
    12 PX COORDINATOR                                              
         11 PX SEND QC (RANDOM) SYS.:TQ10001 Bytes: 38 Cardinality: 1                                         
         10 SORT GROUP BY Bytes: 38 Cardinality: 1                                    
         9 PX RECEIVE Bytes: 38 Cardinality: 1                               
              8 PX SEND HASH SYS.:TQ10000 Bytes: 38 Cardinality: 1                          
              7 SORT GROUP BY Bytes: 38 Cardinality: 1                     
              6 TABLE ACCESS BY LOCAL INDEX ROWID TABLE SUBSCRIPTION Cost: 21 Bytes: 3,976 Cardinality: 284                
                   5 NESTED LOOPS Cost: 219 Bytes: 604,276 Cardinality: 15,902           
              2 PX BLOCK ITERATOR      
                   1 TABLE ACCESS FULL TABLE SOURCE Cost: 72 Bytes: 1,344 Cardinality: 56
                   4 PARTITION HASH ALL Cost: 2 Cardinality: 284 Partition #: 12 Partitions accessed #1 - #16     
                   3 INDEX RANGE SCAN INDEX XAK1SUBSCRIPTION Cost: 2 Cardinality: 284 Partition #: 12 Partitions accessed #1 - #16
    Please suggest

    it eliminate hidden conversation from char to numberi dont know indexes/partition on TC table, and you?
    drop table test;
    create table test as select level id, sysdate + level/24/60/60 datum from dual connect by level < 10000;
    create index idx1 on test(datum);
    analyze table test compute statistics;
    explain plan for select count(*) from test where to_char(datum,'YYYYMMDD') > '20120516';   
    SELECT * FROM TABLE(dbms_xplan.display);
    PLAN_TABLE_OUTPUT                                                              
    Plan hash value: 3467505462                                                    
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |    
    |   0 | SELECT STATEMENT   |      |     1 |     7 |     7  (15)| 00:00:01 |    
    |   1 |  SORT AGGREGATE    |      |     1 |     7 |            |          |    
    |*  2 |   TABLE ACCESS FULL| TEST |   500 |  3500 |     7  (15)| 00:00:01 |    
    Predicate Information (identified by operation id):                            
       2 - filter(TO_CHAR(INTERNAL_FUNCTION("DATUM"),'YYYYMMDD')>'20120516')       
    explain plan for select count(*) from test where datum > trunc(sysdate);   
    SELECT * FROM TABLE(dbms_xplan.display);
    PLAN_TABLE_OUTPUT                                                              
    Plan hash value: 2330213601                                                    
    | Id  | Operation             | Name | Rows  | Bytes | Cost (%CPU)| Time     | 
    |   0 | SELECT STATEMENT      |      |     1 |     7 |     7  (15)| 00:00:01 | 
    |   1 |  SORT AGGREGATE       |      |     1 |     7 |            |          | 
    |*  2 |   INDEX FAST FULL SCAN| IDX1 |  9999 | 69993 |     7  (15)| 00:00:01 | 
    Predicate Information (identified by operation id):                            
       2 - filter("DATUM">TRUNC(SYSDATE@!))                                        
    drop index idx1;
    create index idx1 on test(to_number(to_char(datum,'YYYYMMDD')));
    analyze table test compute statistics;
    explain plan for select count(*) from test where to_number(to_char(datum,'YYYYMMDD')) > 20120516;   
    SELECT * FROM TABLE(dbms_xplan.display);
    PLAN_TABLE_OUTPUT                                                              
    Plan hash value: 227046122                                                     
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |     
    |   0 | SELECT STATEMENT  |      |     1 |     5 |     2   (0)| 00:00:01 |     
    |   1 |  SORT AGGREGATE   |      |     1 |     5 |            |          |     
    |*  2 |   INDEX RANGE SCAN| IDX1 |     1 |     5 |     2   (0)| 00:00:01 |     
    Predicate Information (identified by operation id):                            
       2 - access(TO_NUMBER(TO_CHAR(INTERNAL_FUNCTION("DATUM"),'YYYYMMDD'))>       
                  20120516)                                                        
    explain plan for select count(*) from test where datum > trunc(sysdate);   
    SELECT * FROM TABLE(dbms_xplan.display);
    PLAN_TABLE_OUTPUT                                                              
    Plan hash value: 3467505462                                                    
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |    
    |   0 | SELECT STATEMENT   |      |     1 |     7 |     7  (15)| 00:00:01 |    
    |   1 |  SORT AGGREGATE    |      |     1 |     7 |            |          |    
    |*  2 |   TABLE ACCESS FULL| TEST |  9999 | 69993 |     7  (15)| 00:00:01 |    
    Predicate Information (identified by operation id):                            
       2 - filter("DATUM">TRUNC(SYSDATE@!))                                        

  • How to improve Query Performance

    Hi Friends...
    I Want to improve query performance.I need following things.
    1.What is the process to findout the performance?. Any transaction code's and how to use?.
    2.How can I know whether the query is running good or bad ,ie. in performance praspect.
    3.I want to see the values i.e. how much time it is taking to run?. and where the defect is?.
    4.How to improve the query performance?. After I did the needfull things to improve performance, I want to see the query execution time. i.e. it is running fast or not?.
    Eg..
    Eg 1.   Need to create aggregates.
    Solution:  where can I create aggregates?. Now I'm in production system. So where I need to create? .i.e. indevelopment or in Quality or in Production system?.
    Any chenges I need to do in Development?.Because I'm in Production system.
    So please tell me solution for my questions.
    Thanks
    Ganga
    Message was edited by: Ganga N

    hi ganga
    please refer oss note :557870 : Frequently asked questions on query performance
    also refer to
    Prakash's weblog
    /people/prakash.darji/blog/2006/01/27/query-creation-checklist
    /people/prakash.darji/blog/2006/01/26/query-optimization
    performance docs on query
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3f66ba90-0201-0010-ac8d-b61d8fd9abe9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cccad390-0201-0010-5093-fd9ec8157802
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/ce7fb368-0601-0010-64ba-fadc985a1f94
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c8c4d794-0501-0010-a693-918a17e663cc
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/064fed90-0201-0010-13ae-b16fa4dab695
    This is the oss notes of FAQ on query performance
    1. What kind of tools are available to monitor the overall Query Performance?
    1.     BW Statistics
    2.     BW Workload Analysis in ST03N (Use Export Mode!)
    3.     Content of Table RSDDSTAT
    2. Do I have to do something to enable such tools?
    Yes, you need to turn on the BW Statistics:
      RSA1, choose Tools -> BW statistics for InfoCubes
      (Choose OLAP and WHM for your relevant Cubes)
    3. What kind of tools is available to analyze a specific query in    detail?
    1.     Transaction RSRT
    2.     Transaction RSRTRACE
    4.  Do I have an overall query performance problem?
    i. Use ST03N -> BW System load values to recognize the problem. Use the  number given in table 'Reporting - InfoCubes:Share of total time (s)'  to check if one of the columns %OLAP, %DB, %Frontend shows a high   number in all Info Cubes.
    ii. You need to run ST03N in expert mode to get these values
    5. What can I do if the database proportion is high for all queries?
    Check:
    1.     If the database statistic strategy is set up properly for your DB platform (above all for the BW specific tables)
    2.     If database parameter set up accords with SAP Notes and SAP Services   (EarlyWatch)
    3.     If Buffers, I/O, CPU, memory on the database server are exhausted?
    4.     If Cube compression is used regularly
    5.     If Database partitioning is used (not available on all DB platforms)
    6. What can I do if the OLAP proportion is high for all queries?
    Check:
    1.     If the CPUs on the application server are exhausted
    2.     If the SAP R/3 memory set up is done properly (use TX ST02 to find bottlenecks)
    3.     If the read mode of the queries is unfavourable (RSRREPDIR, RSDDSTAT,  Customizing default)
    7. What can I do if the client proportion is high for all queries?
    Check whether most of your clients are connected via a WAN  connection and the amount of data which is transferred   is rather high.
    8. Where can I get specific runtime information for one query?
    1.     Again you can use ST03N -> BW System Load
    2.     Depending on the time frame you select, you get historical data or current data.
    3.     To get to a specific query you need to drill down using the InfoCube  name
    4.      Use Aggregation Query to get more runtime information about a   single query. Use tab All data to get to the details.   (DB, OLAP, and Frontend time, plus Select/ Transferred records,  plus number of cells and formats)
    9. What kind of query performance problems can I recognize using ST03N
       values for a specific query?
    (Use Details to get the runtime segments)
    1.     High Database Runtime
    2.     High OLAP Runtime
    3.     High Frontend Runtime
    10. What can I do if a query has a high database runtime?
    1.     Check if an aggregate is suitable (use All data to get values "selected records to transferred records", a high number here would  be an indicator for query performance improvement using an aggregate)
    2.     o Check if database statistics are update to data for the   Cube/Aggregate, use TX RSRV output (use database check for statistics  and indexes)
    3.     Check if the read mode of the query is unfavourable - Recommended (H)
    11. What can I do if a query has a high OLAP runtime?
    1.     Check if a high number of Cells transferred to the OLAP (use  "All data" to get value "No. of Cells")
    2.     Use RSRT technical Information to check if any extra OLAP-processing is necessary (Stock Query, Exception Aggregation, Calc. before   Aggregation, Virtual Char. Key Figures, Attributes in Calculated   Key Figs, Time-dependent Currency Translation)  together with a high number of records transferred.
    3.     Check if a user exit Usage is involved in the OLAP runtime?
    4.     Check if large hierarchies are used and the entry hierarchy level is  as deep as possible. This limits the levels of the hierarchy that must be processed. Use SE16 on the inclusion tables and use the List of Value feature on the column successor and predecessor to see which entry level of the hierarchy is used.
    5.     Check if a proper index on the inclusion  table exist
    12. What can I do if a query has a high frontend runtime?
    1.     Check if a very high number of cells and formatting are transferred   to the Frontend (use "All data" to get value "No. of Cells") which   cause high network and frontend (processing) runtime.
    2.     Check if frontend PC are within the recommendation (RAM, CPU MHz)
    3.     Check if the bandwidth for WAN connection is sufficient
    REWARDING POINTS IS THE WAY OF SAYING THANKS IN SDN
    CHEERS
    RAVI

  • How can i improve the speed of my mac?

    my mac has 667 MHz, how can i improve the speed?

    Sorry if that sounded not very helpful, but basically it comes down to that. Not much can improve the performance of machine of that vintage, to stand up to a current model, unless you spend almost as much on upgrades (some of which to consider are listed below).
    Some thought should be given to the budget (money and time and effort) one is willing to spend. The G4 Digital Audio is possibly a good candidate for upgrading for someone who is interested in do-it-yourself computer stuff and bargain hunting for parts. It can even be a fun hobby. But even max-ing out all possible upgrades will still be lacking in performance compared to the current Mac models, I don't actually have any specific benchmarks, just my gut feel. And you may spend a good portion of the cost of a new machine on all those parts for the old machine.
    Is this the 667MHz machine (G4 Digital Audio) in question?
    http://www.lowendmac.com/ppc/digital-audio-power-mac-g4.html
    http://eshop.macsales.com/Descriptions/specs/Framework.cfm?page=g4da.html&title= Power%20Macintosh%20G4%20Digital%20Audio
    or is it some other model?
    Here are some CPU upgrades, for example:
    http://eshop.macsales.com/MyOWC/Upgrades.cfm?sort=pop&model=162&type=Processor&T I=2420&shoupgrds=Show+Upgrades
    you can even get a small rebate for your original CPU
    http://eshop.macsales.com/Service/rebate-program/
    Any of those CPUs should double your processing speed, but you may also need more RAM...or the CPU will just be waiting for data to be read from the virtual memory on the hard drive.
    http://eshop.macsales.com/item/Other%20World%20Computing/133SD512328/
    you could max it out with a whopping 1.5 GB, with 3 of these.
    and you may need a better video card...
    http://eshop.macsales.com/MyOWC/Upgrades.cfm?sort=pop&model=162&type=Video&TI=29 34&shoupgrds=Show+Upgrades
    To add larger and faster hard drives than the original Ultra ATA/66 can handle you would need a PCI ATA133 or PCI SATA card...
    http://eshop.macsales.com/item/ACARD/AEC6280MOB/
    http://eshop.macsales.com/item/Sonnet%20Technology/TSATA/
    And if you need to install OS X from a DVD, and want to burn your own DVD, you may need a new optical drive, if one hasn't been installed already, to replace the CD-RW:
    http://eshop.macsales.com/MyOWC/Upgrades.cfm?Model=162&Type=InternalOpticalDrives&sort=pop
    Also, check out the Power Macintosh G4 forums if you have any questions about that particular model, (if I guessed correctly)
    http://discussions.apple.com/category.jspa?categoryID=113
    Even while I am trying to build a case to convince someone not to waste their money on this project, I am thinking to myself, where can I pick up one of these G4 towers to take on this project myself. Maybe a Quicksilver, no a FW400 MDD dual-boot for sure, I still have some OS 9 software. I did about all I can with my G3 Desktop, and spent more than my MacBook cost.

  • HT1338 how can I improve the speed of my Macbook?  It's become incredibly slow...

    how can I improve the speed of my Macbook?  It's become incredibly slow...

    Hi,
    Troubleshooting Steps are... Restart...  Reset...  Restore from Backup...  Restore as New...
    Try a Reset of the Phone... You will Not Lose Any Data...
    Turn the Phone Off...
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    The Apple logo will Appear and then Disappear...
    Usually takes about 10 - 15 Seconds...
    Turn the Phone On...
    If that does not help... See Here:
    http://support.apple.com/kb/HT1414
    iPhone User Guide
    http://manuals.info.apple.com/en_US/iphone_user_guide.pdf
    iPhone Syncing
    http://www.apple.com/support/iphone/syncing/

Maybe you are looking for

  • Profit center reporting - need help

    hello ,     how do we assing b/s accoutn to profit cneters ( profit center = plant ) and how can we capture plant wise positng to b/s acc, like bank or tax accounts to profit centers in order to generae complete plant b/s and p/l statmens. i am reall

  • Ipad wifi connection problem

    When I first started my ipad a few weeks ago, I set up the wifi I have at home, no problem. But yesterday and today I have had intermittent problems with the wifi not working on my ipad. It gives me the message, no connection and then asks for my pas

  • Creating ringtone for iphone

    Hello, I created a ringtone for an iphone and cannot get it to the ringtones on the phone. IF this is a Garageband issue can someone please help? I created the file and saved to my desktop. (The phone I want the ringtone on is not my phone so I could

  • [SOLVED] dwm config

    [SOLVED] Hi, I am asking for help with my dwm config. What I want it to do is, instead of snapping directly to the edge of the screen, I want it to snap a certain distance away from it (and maybe other windows). Can someone point me in the right dire

  • What do I do now about opening files

    I get this message most often - except for recently created files: Adobe Reader could not open 'golf flyer.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and w