Query too slow

Hi All,
I am firing the following query in a view to fetch data.
But the query is taking too much time to execute.
Iam using oracle8i. Please let me know if there are any suggestions on this query.
select MWN_VIEW.* from
select distinct pre.MERCHANT_NAME,pre.SIC_CODE as MCC_CODE,pre.MERCHANT_STATE,exp.AMTTAXUSD,exp.EXPDATE, decode(nvl(exp.AMTTAXUSD,0),0,'N','Y') ReportedTax
from ERSTMP.pre,ERSTMP.CLM,ERSTMP.exp
where
clm.RPTKEY=exp.RPTKEY AND
clm.RPTKEY=pre.RPTKEY AND
exp.PARIND <> 'Y' AND
clm.RPTTYPE = 'PCD'
and pre.PREFILLKEY=exp.PREFILLKEY
) MWN_view,
select min(exp.EXPDATE) Exp_date,pre.MERCHANT_NAME,Merchant_state from ERSTMP.pre,
ERSTMP.exp,ERSTMP.CLM
where
clm.RPTKEY=exp.RPTKEY AND
clm.RPTKEY=pre.RPTKEY AND
exp.PARIND <> 'Y' AND
clm.RPTTYPE = 'PCD'
and pre.PREFILLKEY=exp.PREFILLKEY
group by pre.MERCHANT_NAME,Merchant_state
) MWN_SD_View
where
MWN_View.MERCHANT_NAME=MWN_SD_View.MERCHANT_NAME
and MWN_View.EXPDATE=MWN_SD_View.Exp_date
and MWN_View.MERCHANT_STATE=MWN_SD_View.MERCHANT_STATE
and
MWN_view.MERCHANT_NAME not in
select A1.merchant_name from
select erstmp.pre.merchant_name from erstmp.pre,ERSTMP.CLM,ERSTMP.exp
where clm.RPTKEY=exp.RPTKEY AND
clm.RPTKEY=pre.RPTKEY AND
exp.PARIND <> 'Y' AND
clm.RPTTYPE = 'PCD'
and pre.PREFILLKEY=exp.PREFILLKEY
) A1,
(Select
decode(instr(NVL(Merchantswhochargetax.MERCHANTNAME,' '),'~'),
0, Merchantswhochargetax.MERCHANTNAME,
SUBSTR(Merchantswhochargetax.MERCHANTNAME,1,instr(NVL(Merchantswhochargetax.MERCHANTNAME,' '),'~')-1)) as MERCHANTNAME
from Merchantswhochargetax) A2
where
instr(A1.merchant_name,A2.MERCHANTNAME)>0

Also: how long is it taking to run and how long would you like it to take?
Also: what version of the database are you running?
Also: post some stats. I would guess it's doing some heavy sorts.
Also: it's pretty ugly, lots of the same tables in the sub-queries - is there really no better way of sharing the data? If you're using 9i you really ought to investigate the WITH clause of the SELECT statement.
Finally, why so many in-line views? It makes your query harder to read.
Good luck, APC
SELECT DISTINCT pre.merchant_name
       , pre.sic_code as mcc_code
       , pre.merchant_state
       , exp.amttaxusd
       , exp.expdate
       , decode(nvl(exp.amttaxusd,0),0,'N','Y') reportedtax
FROM   erstmp.pre
       , erstmp.clm
       , erstmp.exp
WHERE  clm.rptkey=exp.rptkey
AND    clm.rptkey=pre.rptkey
AND    exp.parind <> 'Y'
AND    clm.rpttype = 'PCD'
AND    pre.prefillkey=exp.prefillkey
AND    exp.expdate = ( SELECT min(exp1.expdate)
                       FROM   erstmp.pre pre1
                              , erstmp.clm clm1
                              , erstmp.exp exp1
                       WHERE  clm1.rptkey=exp1.rptkey
                       AND    clm1.rptkey=pre1.rptkey
                       AND    exp1.parind <> 'Y'
                       AND    clm1.rpttype = 'PCD'
                       AND    pre1.prefillkey=exp1.prefillkey )
AND    pre.merchant_name NOT IN ( SELECT pre2.merchant_name
                                  FROM   erstmp.pre2
                                         , merchantswhochargetax A2
                                         , erstmp.exp2
                                         , erstmp.clm2
                                  WHERE  clm2.rptkey=exp2.rptkey
                                  AND    clm2.rptkey=pre2.rptkey
                                  AND    exp2.parind <> 'Y'
                                  AND    clm22.rpttype = 'PCD'
                                  AND    pre.prefillkey=exp2.prefillkey
                                  AND    instr(erstmp2.pre.merchant_name, substr(a2.merchantname, 1 , decode(instr(a2.merchantname, '~'), 0, length(a2.merchantname), instr(a2.merchantname, '~'))))>0

Similar Messages

  • Query too slow on dictionary objects

    We need to optimize a query for a view running on 10.2.0.4 that is used when application code checks database privileges.
    This query takes about 4 or 5 seconds and we would like to have about 1 second.
    Thanks.
    Here is the view definition and some queries to check related objects statistics:
    SQL> set linesize 132
    SQL> DROP VIEW RA;
    View dropped.
    SQL>
    SQL> whenever sqlerror exit failure;
    SQL>
    SQL> select * from v$version;
    BANNER                                                                                                                             
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi                                                                   
    PL/SQL Release 10.2.0.4.0 - Production                                                                                             
    CORE     10.2.0.4.0     Production                                                                                                         
    TNS for HPUX: Version 10.2.0.4.0 - Production                                                                                      
    NLSRTL Version 10.2.0.4.0 - Production                                                                                             
    SQL>
    SQL>
    SQL> CREATE OR REPLACE FORCE VIEW RA
      2  (
      3       MAT,
      4       APP,
      5       RAPP,
      6       OBJET,
      7       TYPE_OBJET,
      8       SELECT_PRIV,
      9       UPDATE_PRIV,
    10       INSERT_PRIV,
    11       DELETE_PRIV,
    12       EXECUTE_PRIV
    13  )
    14  AS
    15         SELECT   USER,
    16               SUBSTR (rtp.role, INSTR (rtp.role,
    17                               '_',
    18                               1,
    19                               1)
    20                           + 1,   INSTR (rtp.role,
    21                                   '_',
    22                                   1,
    23                                   2)
    24                             - INSTR (rtp.role,
    25                                   '_',
    26                                   1,
    27                                   1)
    28                             - 1),
    29               SUBSTR (rtp.role, INSTR (rtp.role,
    30                               '_',
    31                               1,
    32                               2)
    33                           + 1),
    34               rtp.table_name,
    35               ao.object_type,
    36               DECODE (SUM (DECODE (rtp.privilege, 'SELECT', 1, 0)),
    37                    0, 'N',
    38                    'O'),
    39               DECODE (SUM (DECODE (rtp.privilege, 'UPDATE', 1, 0)),
    40                    0, 'N',
    41                    'O'),
    42               DECODE (SUM (DECODE (rtp.privilege, 'INSERT', 1, 0)),
    43                    0, 'N',
    44                    'O'),
    45               DECODE (SUM (DECODE (rtp.privilege, 'DELETE', 1, 0)),
    46                    0, 'N',
    47                    'O'),
    48               DECODE (SUM (DECODE (rtp.privilege, 'EXECUTE', 1, 0)),
    49                    0, 'N',
    50                    'O')
    51           FROM   session_roles sr,
    52               role_role_privs rrp,
    53               role_tab_privs rtp,
    54               all_objects ao
    55          WHERE       sr.role = rrp.granted_role
    56               AND rrp.granted_role = rtp.role
    57               AND rtp.owner = ao.owner
    58               AND rtp.table_name = ao.object_name
    59       GROUP BY   USER,
    60               SUBSTR (rtp.role, INSTR (rtp.role,
    61                               '_',
    62                               1,
    63                               1)
    64                           + 1,   INSTR (rtp.role,
    65                                   '_',
    66                                   1,
    67                                   2)
    68                             - INSTR (rtp.role,
    69                                   '_',
    70                                   1,
    71                                   1)
    72                             - 1),
    73               SUBSTR (rtp.role, INSTR (rtp.role,
    74                               '_',
    75                               1,
    76                               2)
    77                           + 1),
    78               rtp.table_name,
    79               ao.object_type;
    View created.
    SQL> set timing on
    SQL> select count(*) from ra;
      COUNT(*)                                                                                                                         
          1911                                                                                                                         
    Elapsed: 00:00:04.43
    SQL> set timing off
    SQL>
    SQL> select count(*) from all_objects;
      COUNT(*)                                                                                                                         
        100135                                                                                                                         
    SQL> select count(*) from dba_users;
      COUNT(*)                                                                                                                         
           430                                                                                                                         
    SQL> select count(*) from role_tab_privs;
      COUNT(*)                                                                                                                         
         23048                                                                                                                         
    SQL> select count(*) from role_role_privs;
      COUNT(*)                                                                                                                         
           103                                                                                                                         
    SQL>
    SQL> select count(*) from sys.obj$;
      COUNT(*)                                                                                                                         
        100909                                                                                                                         
    SQL> select count(*) from sys.objauth$;
      COUNT(*)                                                                                                                         
         55547                                                                                                                         
    SQL> select count(*) from sys.user$;
      COUNT(*)                                                                                                                         
           626                                                                                                                         
    SQL> select count(*) from session_roles;
      COUNT(*)                                                                                                                         
            11                                                                                                                         
    SQL>
    SQL> column table_name format a20
    SQL> column owner format a10
    SQL> select owner, table_name, last_analyzed, num_rows
      2  from dba_tables where table_name in ('OBJ$', 'OBJAUTH$', 'USER$');
    OWNER      TABLE_NAME           LAST_ANAL   NUM_ROWS                                                                               
    SYS        OBJAUTH$             15-JAN-09      59292                                                                               
    SYS        USER$                20-JAN-09        622                                                                               
    SYS        OBJ$                 26-JAN-09     101319                                                                               
    SQL>
    SQL> exec dbms_monitor.session_trace_enable();
    PL/SQL procedure successfully completed.
    SQL> select count(*) from ra;
      COUNT(*)                                                                                                                         
          1911                                                                                                                         
    SQL>
    SQL> exitand here is the trace file output processed by TKPROF:
    TKPROF: Release 10.2.0.4.0 - Production on Thu Jan 29 12:26:45 2009
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Trace file: tdivers6_ora_3289.trc
    Sort options: prsela  exeela  fchela 
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    select count(*)
    from
    ra
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.30       0.28          0          0          0           0
    Execute      2      0.00       0.00          0          0          0           0
    Fetch        2      5.97       6.14       8873     215796          2           1
    total        5      6.27       6.42       8873     215796          2           1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 29 
    Rows     Row Source Operation
          1  SORT AGGREGATE (cr=215796 pr=8873 pw=1492 time=6141145 us)
       1911   VIEW  (cr=215796 pr=8873 pw=1492 time=6143024 us)
       1911    HASH GROUP BY (cr=215796 pr=8873 pw=1492 time=6141111 us)
       5642     HASH JOIN  (cr=215796 pr=8873 pw=1492 time=3550103 us)
      23048      VIEW  ROLE_TAB_PRIVS (cr=97752 pr=973 pw=720 time=1663608 us)
      23048       HASH GROUP BY (cr=97752 pr=973 pw=720 time=1640558 us)
      48358        HASH JOIN  (cr=97752 pr=973 pw=720 time=1485959 us)
      48358         NESTED LOOPS  (cr=97718 pr=568 pw=315 time=1285418 us)
      48358          HASH JOIN  (cr=1000 pr=543 pw=315 time=705104 us)
      48358           HASH JOIN  (cr=966 pr=228 pw=0 time=650471 us)
         24            INDEX FULL SCAN I_TABLE_PRIVILEGE_MAP (cr=1 pr=0 pw=0 time=44 us)(object id 315)
      48358            FILTER  (cr=965 pr=228 pw=0 time=553263 us)
      48358             NESTED LOOPS OUTER (cr=965 pr=228 pw=0 time=504902 us)
      48358              HASH JOIN  (cr=965 pr=228 pw=0 time=69670 us)
        281               VIEW  VW_NSO_1 (cr=724 pr=0 pw=0 time=18432 us)
        281                FILTER  (cr=724 pr=0 pw=0 time=18430 us)
        884                 CONNECT BY WITH FILTERING (cr=724 pr=0 pw=0 time=18870 us)
        175                  TABLE ACCESS BY INDEX ROWID SYSAUTH$ (cr=13 pr=0 pw=0 time=1542 us)
        175                   FILTER  (cr=9 pr=0 pw=0 time=1008 us)
       1334                    INDEX FAST FULL SCAN I_SYSAUTH1 (cr=9 pr=0 pw=0 time=1388 us)(object id 105)
          0                    FIXED TABLE FULL X$KZDOS (cr=0 pr=0 pw=0 time=3700 us)
        709                  NESTED LOOPS  (cr=711 pr=0 pw=0 time=4927 us)
        702                   CONNECT BY PUMP  (cr=0 pr=0 pw=0 time=712 us)
        709                   INDEX RANGE SCAN I_SYSAUTH1 (cr=711 pr=0 pw=0 time=5016 us)(object id 105)
      55547               TABLE ACCESS FULL OBJAUTH$ (cr=241 pr=228 pw=0 time=55725 us)
          0              TABLE ACCESS BY INDEX ROWID COL$ (cr=0 pr=0 pw=0 time=341993 us)
          0               INDEX RANGE SCAN I_COL2 (cr=0 pr=0 pw=0 time=82258 us)(object id 46)
        626           TABLE ACCESS FULL USER$ (cr=34 pr=0 pw=0 time=666 us)
      48358          TABLE ACCESS BY INDEX ROWID OBJ$ (cr=96718 pr=25 pw=0 time=488644 us)
      48358           INDEX UNIQUE SCAN I_OBJ1 (cr=48360 pr=9 pw=0 time=244641 us)(object id 36)
        626         TABLE ACCESS FULL USER$ (cr=34 pr=0 pw=0 time=675 us)
    1301755      MERGE JOIN CARTESIAN (cr=118044 pr=7600 pw=472 time=4379450 us)
         13       HASH JOIN  (cr=3701 pr=0 pw=0 time=40049 us)
         11        NESTED LOOPS  (cr=24 pr=0 pw=0 time=270 us)
         11         FIXED TABLE FULL X$KZSRO (cr=0 pr=0 pw=0 time=44 us)
         11         TABLE ACCESS CLUSTER USER$ (cr=24 pr=0 pw=0 time=165 us)
         11          INDEX UNIQUE SCAN I_USER# (cr=13 pr=0 pw=0 time=71 us)(object id 11)
        103        VIEW  ROLE_ROLE_PRIVS (cr=3677 pr=0 pw=0 time=38669 us)
        103         HASH GROUP BY (cr=3677 pr=0 pw=0 time=38664 us)
        107          NESTED LOOPS  (cr=3677 pr=0 pw=0 time=26928 us)
        709           NESTED LOOPS  (cr=2859 pr=0 pw=0 time=32914 us)
        709            HASH JOIN  (cr=730 pr=0 pw=0 time=20857 us)
        281             VIEW  VW_NSO_2 (cr=724 pr=0 pw=0 time=18016 us)
        281              FILTER  (cr=724 pr=0 pw=0 time=17734 us)
        884               CONNECT BY WITH FILTERING (cr=724 pr=0 pw=0 time=18735 us)
        175                TABLE ACCESS BY INDEX ROWID SYSAUTH$ (cr=13 pr=0 pw=0 time=1290 us)
        175                 FILTER  (cr=9 pr=0 pw=0 time=1107 us)
       1334                  INDEX FAST FULL SCAN I_SYSAUTH1 (cr=9 pr=0 pw=0 time=1372 us)(object id 105)
          0                  FIXED TABLE FULL X$KZDOS (cr=0 pr=0 pw=0 time=3734 us)
        709                NESTED LOOPS  (cr=711 pr=0 pw=0 time=4908 us)
        702                 CONNECT BY PUMP  (cr=0 pr=0 pw=0 time=8 us)
        709                 INDEX RANGE SCAN I_SYSAUTH1 (cr=711 pr=0 pw=0 time=4970 us)(object id 105)
       1334             TABLE ACCESS FULL SYSAUTH$ (cr=6 pr=0 pw=0 time=1377 us)
        709            TABLE ACCESS CLUSTER USER$ (cr=2129 pr=0 pw=0 time=10226 us)
        709             INDEX UNIQUE SCAN I_USER# (cr=711 pr=0 pw=0 time=3340 us)(object id 11)
        107           TABLE ACCESS CLUSTER USER$ (cr=818 pr=0 pw=0 time=4748 us)
        107            INDEX UNIQUE SCAN I_USER# (cr=711 pr=0 pw=0 time=2658 us)(object id 11)
    1301755       BUFFER SORT (cr=114343 pr=7600 pw=472 time=3038891 us)
    100135        VIEW  ALL_OBJECTS (cr=114343 pr=1464 pw=0 time=1703751 us)
    100135         FILTER  (cr=114341 pr=1462 pw=0 time=1603615 us)
    100891          HASH JOIN  (cr=1162 pr=885 pw=0 time=404937 us)
        626           TABLE ACCESS FULL USER$ (cr=34 pr=0 pw=0 time=653 us)
    100893           TABLE ACCESS FULL OBJ$ (cr=1128 pr=885 pw=0 time=202344 us)
       6467          TABLE ACCESS BY INDEX ROWID IND$ (cr=13316 pr=325 pw=0 time=100349 us)
       6653           INDEX UNIQUE SCAN I_IND1 (cr=6655 pr=6 pw=0 time=33710 us)(object id 39)
          1          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=84 us)
        295          NESTED LOOPS  (cr=9014 pr=7 pw=0 time=86130 us)
       8013           FIXED TABLE FULL X$KZSRO (cr=0 pr=0 pw=0 time=13120 us)
        295           INDEX RANGE SCAN I_OBJAUTH1 (cr=9014 pr=7 pw=0 time=67890 us)(object id 103)
       1261          NESTED LOOPS  (cr=9710 pr=18 pw=0 time=73685 us)
       2116           INDEX RANGE SCAN I_OBJAUTH1 (cr=9710 pr=18 pw=0 time=43916 us)(object id 103)
       1261           FIXED TABLE FULL X$KZSRO (cr=0 pr=0 pw=0 time=18578 us)
          1          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=134 us)
        113          NESTED LOOPS  (cr=63960 pr=164 pw=0 time=459981 us)
       7740           MERGE JOIN CARTESIAN (cr=55444 pr=164 pw=0 time=260673 us)
        692            NESTED LOOPS  (cr=55444 pr=164 pw=0 time=349021 us)
      19314             TABLE ACCESS BY INDEX ROWID DEPENDENCY$ (cr=13988 pr=161 pw=0 time=124307 us)
      19314              INDEX RANGE SCAN I_DEPENDENCY1 (cr=10866 pr=78 pw=0 time=56695 us)(object id 122)
        692             TABLE ACCESS BY INDEX ROWID OBJ$ (cr=41456 pr=3 pw=0 time=196875 us)
      19104              INDEX UNIQUE SCAN I_OBJ1 (cr=22352 pr=1 pw=0 time=104614 us)(object id 36)
       7740            BUFFER SORT (cr=0 pr=0 pw=0 time=16767 us)
       8996             FIXED TABLE FULL X$KZSRO (cr=0 pr=0 pw=0 time=4729 us)
        113           INDEX RANGE SCAN I_OBJAUTH1 (cr=8516 pr=0 pw=0 time=62018 us)(object id 103)
          1          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=91 us)
        557          NESTED LOOPS  (cr=8885 pr=63 pw=0 time=61541 us)
        557           NESTED LOOPS  (cr=8885 pr=63 pw=0 time=51669 us)
       1033            TABLE ACCESS BY INDEX ROWID TRIGGER$ (cr=6808 pr=22 pw=0 time=29043 us)
       1034             INDEX UNIQUE SCAN I_TRIGGER2 (cr=5774 pr=0 pw=0 time=16231 us)(object id 126)
        557            INDEX RANGE SCAN I_OBJAUTH1 (cr=2077 pr=41 pw=0 time=16683 us)(object id 103)
        557           FIXED TABLE FULL X$KZSRO (cr=0 pr=0 pw=0 time=4121 us)
          1          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=98 us)
        718          NESTED LOOPS  (cr=3722 pr=0 pw=0 time=37122 us)
       1573           INDEX RANGE SCAN I_OBJAUTH1 (cr=3722 pr=0 pw=0 time=17269 us)(object id 103)
        718           FIXED TABLE FULL X$KZSRO (cr=0 pr=0 pw=0 time=14844 us)
          1          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=103 us)
          1          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=66 us)
          0          NESTED LOOPS  (cr=4572 pr=0 pw=0 time=36383 us)
       1235           MERGE JOIN CARTESIAN (cr=3241 pr=0 pw=0 time=16756 us)
         95            NESTED LOOPS  (cr=3241 pr=0 pw=0 time=19566 us)
        768             TABLE ACCESS BY INDEX ROWID DEPENDENCY$ (cr=1562 pr=0 pw=0 time=9821 us)
        768              INDEX RANGE SCAN I_DEPENDENCY1 (cr=1412 pr=0 pw=0 time=5531 us)(object id 122)
         95             TABLE ACCESS BY INDEX ROWID OBJ$ (cr=1679 pr=0 pw=0 time=7912 us)
        767              INDEX UNIQUE SCAN I_OBJ1 (cr=912 pr=0 pw=0 time=4147 us)(object id 36)
       1235            BUFFER SORT (cr=0 pr=0 pw=0 time=2343 us)
       1235             FIXED TABLE FULL X$KZSRO (cr=0 pr=0 pw=0 time=653 us)
          0           INDEX RANGE SCAN I_OBJAUTH1 (cr=1331 pr=0 pw=0 time=9933 us)(object id 103)
          1          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=116 us)
          1          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=163 us)
          0          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=0 us)
          0          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=154 us)
          1          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=236 us)
          1          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=217 us)
          1          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=120 us)
          0          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=0 us)
          0          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=0 us)
          1          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=151 us)
          1          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=219 us)
          1          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=139 us)
          1          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=186 us)
          1          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=184 us)
          0          FIXED TABLE FULL X$KZSPR (cr=0 pr=0 pw=0 time=0 us)
          0          VIEW  (cr=0 pr=0 pw=0 time=0 us)
          0           FAST DUAL  (cr=0 pr=0 pw=0 time=0 us)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       2        0.00          0.00
      db file sequential read                       627        0.00          0.01
      db file scattered read                        103        0.00          0.01
      direct path write temp                         68        0.00          0.00
      direct path read temp                        6198        0.00          0.01
      SQL*Net message from client                     2        0.00          0.00
    BEGIN dbms_monitor.session_trace_enable(); END;
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          3         57          0           1
    Fetch        0      0.00       0.00          0          0          0           0
    total        1      0.00       0.00          3         57          0           1
    Misses in library cache during parse: 0
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 29 
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       1        0.00          0.00
      SQL*Net message from client                     1        0.00          0.00
    select dummy
    from
    dual where   USER not in ('OPS$EXPORA','SYSTEM','SYS','FOG','QUEST')
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        1      0.00       0.00          0          0          0           0
    total        3      0.00       0.00          0          0          0           0
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 29     (recursive depth: 1)
    Rows     Row Source Operation
          0  FILTER  (cr=0 pr=0 pw=0 time=6 us)
          0   TABLE ACCESS FULL DUAL (cr=0 pr=0 pw=0 time=0 us)
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.30       0.28          0          0          0           0
    Execute      3      0.00       0.00          3         57          0           1
    Fetch        2      5.97       6.14       8873     215796          2           1
    total        6      6.27       6.42       8876     215853          2           2
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       3        0.00          0.00
      SQL*Net message from client                     3        0.00          0.00
      db file sequential read                       628        0.00          0.01
      db file scattered read                        103        0.00          0.01
      direct path write temp                         68        0.00          0.00
      direct path read temp                        6198        0.00          0.01
      log file sync                                   2        0.00          0.00
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse       17      0.02       0.01          1          0          2           0
    Execute     29      0.02       0.01          0          0          0           0
    Fetch       47      0.00       0.00         23        224          0          37
    total       93      0.04       0.04         24        224          2          37
    Misses in library cache during parse: 7
    Misses in library cache during execute: 4
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file sequential read                        15        0.00          0.00
      db file scattered read                          4        0.00          0.00
        3  user  SQL statements in session.
       28  internal SQL statements in session.
       31  SQL statements in session.
    Trace file: tdivers6_ora_3289.trc
    Trace file compatibility: 10.01.00
    Sort options: prsela  exeela  fchela 
           1  session in tracefile.
           3  user  SQL statements in trace file.
          28  internal SQL statements in trace file.
          31  SQL statements in trace file.
          14  unique SQL statements in trace file.
        7473  lines in trace file.
           6  elapsed seconds in trace file.

    Here is the output of DBMS_XPLAN.DISPLAY (I need to split the message because forum says "Your message exceeds the maximum length of 30000 characters"):
    SQL> explain plan for select count(*) from ra;
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 3431051537
    | Id  | Operation                                                 | Name                  | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                                          |                       |     1 |       |   830  (50)| 00:00:05 |
    |   1 |  SORT AGGREGATE                                           |                       |     1 |       |            |          |
    |   2 |   VIEW                                                    |                       |     1 |       |   830  (50)| 00:00:05 |
    |   3 |    HASH GROUP BY                                          |                       |     1 |   108 |   830  (50)| 00:00:05 |
    |*  4 |     HASH JOIN                                             |                       |     1 |   108 |   829  (50)| 00:00:05 |
    |   5 |      VIEW                                                 | ROLE_TAB_PRIVS        |   192 |  7488 |   281  (14)| 00:00:02 |
    PLAN_TABLE_OUTPUT
    |   6 |       HASH GROUP BY                                       |                       |   192 | 22272 |   281  (14)| 00:00:02 |
    |*  7 |        HASH JOIN                                          |                       |   192 | 22272 |   280  (14)| 00:00:02 |
    |*  8 |         HASH JOIN                                         |                       |   192 | 19200 |   272  (14)| 00:00:02 |
    |*  9 |          HASH JOIN                                        |                       |   192 | 16128 |   265  (14)| 00:00:02 |
    |  10 |           INDEX FULL SCAN                                 | I_TABLE_PRIVILEGE_MAP |    24 |   240 |     1   (0)| 00:00:01 |
    |  11 |           NESTED LOOPS                                    |                       |   192 | 14208 |   264  (14)| 00:00:02 |
    |* 12 |            FILTER                                         |                       |       |       |            |          |
    |  13 |             NESTED LOOPS OUTER                            |                       |   191 |  9550 |    71  (47)| 00:00:01 |
    |* 14 |              HASH JOIN                                    |                       |   193 |  5211 |    69  (48)| 00:00:01 |
    |  15 |               VIEW                                        | VW_NSO_1              |     2 |    10 |     2   (0)| 00:00:01 |
    |* 16 |                FILTER                                     |                       |       |       |            |          |
    PLAN_TABLE_OUTPUT
    |* 17 |                 CONNECT BY WITH FILTERING                 |                       |       |       |            |          |
    |  18 |                  TABLE ACCESS BY INDEX ROWID              | SYSAUTH$              |       |       |            |          |
    |* 19 |                   FILTER                                  |                       |       |       |            |          |
    |  20 |                    INDEX FAST FULL SCAN                   | I_SYSAUTH1            |  1325 |  5300 |     3  (34)| 00:00:01 |
    |* 21 |                    FIXED TABLE FULL                       | X$KZDOS               |     1 |    13 |            |          |
    |  22 |                  NESTED LOOPS                             |                       |       |       |            |          |
    |  23 |                   CONNECT BY PUMP                         |                       |       |       |            |          |
    |* 24 |                   INDEX RANGE SCAN                        | I_SYSAUTH1            |     2 |    18 |     2   (0)| 00:00:01 |
    |  25 |               TABLE ACCESS FULL                           | OBJAUTH$              | 59508 |  1278K|    58  (42)| 00:00:01 |
    |  26 |              TABLE ACCESS BY INDEX ROWID                  | COL$                  |     1 |    23 |     2   (0)| 00:00:01 |
    |* 27 |               INDEX RANGE SCAN                            | I_COL2                |     1 |       |     1   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |  28 |            TABLE ACCESS BY INDEX ROWID                    | OBJ$                  |     1 |    24 |     1   (0)| 00:00:01 |
    |* 29 |             INDEX UNIQUE SCAN                             | I_OBJ1                |     1 |       |     0   (0)| 00:00:01 |
    |  30 |          TABLE ACCESS FULL                                | USER$                 |   622 |  9952 |     6   (0)| 00:00:01 |
    |  31 |         TABLE ACCESS FULL                                 | USER$                 |   622 |  9952 |     6   (0)| 00:00:01 |
    |  32 |      MERGE JOIN CARTESIAN                                 |                       |  5679 |   382K|   548  (68)| 00:00:03 |
    |* 33 |       HASH JOIN                                           |                       |     1 |    31 |    20  (15)| 00:00:01 |
    |  34 |        NESTED LOOPS                                       |                       |     1 |    19 |     1   (0)| 00:00:01 |
    |* 35 |         FIXED TABLE FULL                                  | X$KZSRO               |     1 |     3 |     0   (0)| 00:00:01 |
    |  36 |         TABLE ACCESS CLUSTER                              | USER$                 |     1 |    16 |     1   (0)| 00:00:01 |
    |* 37 |          INDEX UNIQUE SCAN                                | I_USER#               |     1 |       |     0   (0)| 00:00:01 |
    |  38 |        VIEW                                               | ROLE_ROLE_PRIVS       |     6 |    72 |    18  (12)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |  39 |         HASH GROUP BY                                     |                       |     6 |   288 |    18  (12)| 00:00:01 |
    |  40 |          NESTED LOOPS                                     |                       |     6 |   288 |    17   (6)| 00:00:01 |
    |  41 |           NESTED LOOPS                                    |                       |     6 |   192 |    11  (10)| 00:00:01 |
    |* 42 |            HASH JOIN                                      |                       |     6 |    96 |     5  (20)| 00:00:01 |
    |  43 |             VIEW                                          | VW_NSO_2              |     2 |    10 |     2   (0)| 00:00:01 |
    |* 44 |              FILTER                                       |                       |       |       |            |          |
    |* 45 |               CONNECT BY WITH FILTERING                   |                       |       |       |            |          |
    |  46 |                TABLE ACCESS BY INDEX ROWID                | SYSAUTH$              |       |       |            |          |
    |* 47 |                 FILTER                                    |                       |       |       |            |          |
    |  48 |                  INDEX FAST FULL SCAN                     | I_SYSAUTH1            |  1325 |  5300 |     3  (34)| 00:00:01 |
    |* 49 |                  FIXED TABLE FULL                         | X$KZDOS               |     1 |    13 |            |          |
    PLAN_TABLE_OUTPUT
    |  50 |                NESTED LOOPS                               |                       |       |       |            |          |
    |  51 |                 CONNECT BY PUMP                           |                       |       |       |            |          |
    |* 52 |                 INDEX RANGE SCAN                          | I_SYSAUTH1            |     2 |    18 |     2   (0)| 00:00:01 |
    |  53 |             TABLE ACCESS FULL                             | SYSAUTH$              |  1325 | 14575 |     2   (0)| 00:00:01 |
    |  54 |            TABLE ACCESS CLUSTER                           | USER$                 |     1 |    16 |     1   (0)| 00:00:01 |
    |* 55 |             INDEX UNIQUE SCAN                             | I_USER#               |     1 |       |     0   (0)| 00:00:01 |
    |  56 |           TABLE ACCESS CLUSTER                            | USER$                 |     1 |    16 |     1   (0)| 00:00:01 |
    |* 57 |            INDEX UNIQUE SCAN                              | I_USER#               |     1 |       |     0   (0)| 00:00:01 |
    |  58 |       BUFFER SORT                                         |                       | 11357 |   421K|   548  (68)| 00:00:03 |
    |  59 |        VIEW                                               | ALL_OBJECTS           | 11357 |   421K|   528  (70)| 00:00:03 |
    |* 60 |         FILTER                                            |                       |       |       |            |          |
    PLAN_TABLE_OUTPUT
    |* 61 |          HASH JOIN                                        |                       |   100K|  8460K|   528  (70)| 00:00:03 |
    |  62 |           TABLE ACCESS FULL                               | USER$                 |   622 |  9952 |     6   (0)| 00:00:01 |
    |* 63 |           TABLE ACCESS FULL                               | OBJ$                  |   100K|  6886K|   508  (70)| 00:00:03 |
    |* 64 |          TABLE ACCESS BY INDEX ROWID                      | IND$                  |     1 |     8 |     2   (0)| 00:00:01 |
    |* 65 |           INDEX UNIQUE SCAN                               | I_IND1                |     1 |       |     1   (0)| 00:00:01 |
    |* 66 |           FIXED TABLE FULL                                | X$KZSPR               |    14 |    98 |     1 (100)| 00:00:01 |
    |  67 |            NESTED LOOPS                                   |                       |     2 |    30 |     2   (0)| 00:00:01 |
    |  68 |             FIXED TABLE FULL                              | X$KZSRO               |     2 |     6 |     0   (0)| 00:00:01 |
    |* 69 |             INDEX RANGE SCAN                              | I_OBJAUTH1            |     1 |    12 |     1   (0)| 00:00:01 |
    |  70 |              NESTED LOOPS                                 |                       |     1 |    15 |     2   (0)| 00:00:01 |
    |* 71 |               INDEX RANGE SCAN                            | I_OBJAUTH1            |     1 |    12 |     2   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |* 72 |               FIXED TABLE FULL                            | X$KZSRO               |     1 |     3 |     0   (0)| 00:00:01 |
    |* 73 |                FIXED TABLE FULL                           | X$KZSPR               |     8 |    56 |     1 (100)| 00:00:01 |
    |  74 |                 NESTED LOOPS                              |                       |     1 |    29 |     3   (0)| 00:00:01 |
    |  75 |                  NESTED LOOPS                             |                       |     1 |    26 |     3   (0)| 00:00:01 |
    |* 76 |                   TABLE ACCESS BY INDEX ROWID             | TRIGGER$              |     1 |    14 |     2   (0)| 00:00:01 |
    |* 77 |                    INDEX UNIQUE SCAN                      | I_TRIGGER2            |     1 |       |     1   (0)| 00:00:01 |
    |* 78 |                   INDEX RANGE SCAN                        | I_OBJAUTH1            |     1 |    12 |     1   (0)| 00:00:01 |
    |* 79 |                  FIXED TABLE FULL                         | X$KZSRO               |     1 |     3 |     0   (0)| 00:00:01 |
    |* 80 |                   FIXED TABLE FULL                        | X$KZSPR               |     6 |    42 |     1 (100)| 00:00:01 |
    |  81 |                    NESTED LOOPS                           |                       |     1 |    52 |     6   (0)| 00:00:01 |
    |  82 |                     MERGE JOIN CARTESIAN                  |                       |     1 |    40 |     5   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |  83 |                      NESTED LOOPS                         |                       |     1 |    37 |     5   (0)| 00:00:01 |
    |  84 |                       TABLE ACCESS BY INDEX ROWID         | DEPENDENCY$           |     1 |    10 |     4   (0)| 00:00:01 |
    |* 85 |                        INDEX RANGE SCAN                   | I_DEPENDENCY1         |     1 |       |     3   (0)| 00:00:01 |
    |* 86 |                       TABLE ACCESS BY INDEX ROWID         | OBJ$                  |     1 |    27 |     1   (0)| 00:00:01 |
    |* 87 |                        INDEX UNIQUE SCAN                  | I_OBJ1                |     1 |       |     0   (0)| 00:00:01 |
    |  88 |                      BUFFER SORT                          |                       |     2 |     6 |     4   (0)| 00:00:01 |
    |  89 |                       FIXED TABLE FULL                    | X$KZSRO               |     2 |     6 |     0   (0)| 00:00:01 |
    |* 90 |                     INDEX RANGE SCAN                      | I_OBJAUTH1            |     1 |    12 |     1   (0)| 00:00:01 |
    |* 91 |                      FIXED TABLE FULL                     | X$KZSPR               |     6 |    42 |     1 (100)| 00:00:01 |
    |  92 |                       NESTED LOOPS                        |                       |     1 |    15 |     2   (0)| 00:00:01 |
    |* 93 |                        INDEX RANGE SCAN                   | I_OBJAUTH1            |     1 |    12 |     2   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |* 94 |                        FIXED TABLE FULL                   | X$KZSRO               |     1 |     3 |     0   (0)| 00:00:01 |
    |* 95 |                         FIXED TABLE FULL                  | X$KZSPR               |     8 |    56 |     1 (100)| 00:00:01 |
    |* 96 |                          FIXED TABLE FULL                 | X$KZSPR               |     3 |    21 |     1 (100)| 00:00:01 |
    |* 97 |                           FIXED TABLE FULL                | X$KZSPR               |    11 |    77 |     1 (100)| 00:00:01 |
    |  98 |                            NESTED LOOPS                   |                       |     1 |    52 |     6   (0)| 00:00:01 |
    |  99 |                             MERGE JOIN CARTESIAN          |                       |     1 |    40 |     5   (0)| 00:00:01 |
    | 100 |                              NESTED LOOPS                 |                       |     1 |    37 |     5   (0)| 00:00:01 |
    | 101 |                               TABLE ACCESS BY INDEX ROWID | DEPENDENCY$           |     1 |    10 |     4   (0)| 00:00:01 |
    |*102 |                                INDEX RANGE SCAN           | I_DEPENDENCY1         |     1 |       |     3   (0)| 00:00:01 |
    |*103 |                               TABLE ACCESS BY INDEX ROWID | OBJ$                  |     1 |    27 |     1   (0)| 00:00:01 |
    |*104 |                                INDEX UNIQUE SCAN          | I_OBJ1                |     1 |       |     0   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    | 105 |                              BUFFER SORT                  |                       |     2 |     6 |     4   (0)| 00:00:01 |
    | 106 |                               FIXED TABLE FULL            | X$KZSRO               |     2 |     6 |     0   (0)| 00:00:01 |
    |*107 |                             INDEX RANGE SCAN              | I_OBJAUTH1            |     1 |    12 |     1   (0)| 00:00:01 |
    |*108 |                              FIXED TABLE FULL             | X$KZSPR               |     6 |    42 |     1 (100)| 00:00:01 |
    |*109 |                               FIXED TABLE FULL            | X$KZSPR               |    11 |    77 |     1 (100)| 00:00:01 |
    |*110 |                                FIXED TABLE FULL           | X$KZSPR               |     6 |    42 |     1 (100)| 00:00:01 |
    |*111 |                                 FIXED TABLE FULL          | X$KZSPR               |     3 |    21 |     1 (100)| 00:00:01 |
    |*112 |                                  FIXED TABLE FULL         | X$KZSPR               |     6 |    42 |     1 (100)| 00:00:01 |
    |*113 |                                   FIXED TABLE FULL        | X$KZSPR               |    14 |    98 |     1 (100)| 00:00:01 |
    |*114 |                                    FIXED TABLE FULL       | X$KZSPR               |    11 |    77 |     1 (100)| 00:00:01 |
    |*115 |                                     FIXED TABLE FULL      | X$KZSPR               |    14 |    98 |     1 (100)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |*116 |                                      FIXED TABLE FULL     | X$KZSPR               |     6 |    42 |     1 (100)| 00:00:01 |
    |*117 |                                       FIXED TABLE FULL    | X$KZSPR               |    11 |    77 |     1 (100)| 00:00:01 |
    |*118 |                                        FIXED TABLE FULL   | X$KZSPR               |    11 |    77 |     1 (100)| 00:00:01 |
    |*119 |                                         FIXED TABLE FULL  | X$KZSPR               |     3 |    21 |     1 (100)| 00:00:01 |
    |*120 |                                          FIXED TABLE FULL | X$KZSPR               |     6 |    42 |     1 (100)| 00:00:01 |
    |*121 |                                           FIXED TABLE FULL| X$KZSPR               |     6 |    42 |     1 (100)| 00:00:01 |
    | 122 |                                            VIEW           |                       |     1 |    13 |     2   (0)| 00:00:01 |
    | 123 |                                             FAST DUAL     |                       |     1 |       |     2   (0)| 00:00:01 |
    -----------------------------------------------------------------------------------------------------------------------------------

  • Query is too slow from bseg selection

    SELECT BELNR BLDAT BUDAT XBLNR GJAHR tcode WAERS AWKEY FROM BKPF INTO
      TABLE
      ITBKPF WHERE BUKRS EQ P_BUKRS AND BELNR IN S_BELNR AND BUDAT IN
        P_BUDAT
        AND STBLG = ''
        AND ( TCODE = 'MIRO' OR
                             TCODE = 'MR8M' OR
                             TCODE = 'MB11' OR
                             TCODE = 'MB1B' OR
                            TCODE = 'MIGO_GI' OR
                            TCODE = 'MIGO_TR' OR
                             TCODE = 'MB1A' ).
       IF SY-SUBRC EQ 0.
              SORT itBKPF.
            ELSE.
              MESSAGE 'No data for the relevant date' TYPE 'A'.
             LEAVE LIST-PROCESSING.
            ENDIF.
    SELECT A1LIFNR A1NAME1 A1ORT01 A1STRAS B1~j_1icstno
      INTO TABLE it_werks
      FROM ( LFA1 AS A1 INNER JOIN j_1imocomp AS B1 ON A1werks = B1werks )
    **********************************************this is too slow*************
    SELECT BUKRS BELNR GJAHR BUZEI BUZID BSCHL SHKZG GSBER MWSKZ
            DMBTR HKONT LIFNR LANDL Matnr werks MENGE EBELP xref3
            INTO CORRESPONDING FIELDS OF TABLE ITABBSEG
            FROM BSEG
            FOR ALL ENTRIES IN ITBKPF
            WHERE BELNR = ITBKPF-BELNR
            AND GJAHR = ITBKPF-GJAHR
            AND ( BSCHL = '86' OR BSCHL = '96' or BSCHL = '89' OR BSCHL = '99'  )
            AND WERKS IN S_WERKS
            AND BUZID <> 'F' .
    ****************************************this is too slow
    Moderator message: Please Read before Posting in the Performance and Tuning Forum
    locked by: Thomas Zloch on Aug 5, 2010 2:08 PM

    You should have provided the full key of the cluster file behind BSEG (RFBLG), every key is in BKPF, so add BUKRS
    SELECT bukrs belnr gjahr buzei buzid bschl shkzg gsber mwskz
           dmbtr hkont lifnr landl matnr werks menge ebelp xref3
      INTO CORRESPONDING FIELDS OF TABLE itabbseg
      FROM bseg
      FOR ALL ENTRIES IN itbkpf
      WHERE bukrs = itbkpf-bukrs
        AND belnr = itbkpf-belnr
        AND gjahr = itbkpf-gjahr
        AND ( bschl EQ '86' OR bschl EQ '96' OR bschl EQ '89' OR bschl EQ '99' )
        AND werks IN s_werks
        AND buzid EQ 'F' .
    You could also extract the whole accounting document in the internal table, and then delete record using the not-database-key selections.
    SELECT bukrs belnr gjahr buzei buzid bschl shkzg gsber mwskz
           dmbtr hkont lifnr landl matnr werks menge ebelp xref3
      INTO CORRESPONDING FIELDS OF TABLE itabbseg
      FROM bseg
      FOR ALL ENTRIES IN itbkpf
      WHERE bukrs = itbkpf-bukrs
        AND belnr = itbkpf-belnr
        AND gjahr = itbkpf-gjahr.
    DELETE itabbseg WHERE
      ( bschl NE '86' AND bschl NE '96' AND bschl NE '89' AND bschl NE '99' )
      OR NOT ( werks IN s_werks )
      OR BUZID NE 'F' .
    In both case, perform some tests with tools like SE30 or ST05.
    Regards,
    Raymond

  • Select Data from aufm too slow

    Hi experts,
    I have a query in my report but its performance too slow.
    is there any proper way or any way to improve the performance of below query.
    SELECT  * FROM  aufm     into table i_aufm          " collecting input material document numbers
             WHERE mblnr GE '4900000000'
               AND mjahr GE '2008'
               AND zeile GT '0'
               AND matnr EQ matnr_101-matnr
               AND werks IN p_werks
               AND charg EQ matnr_101-charg
               AND bwart = '101'.

    Hi,
    1 .Dont use * from any table.
    2. Create  a internal table  that u want to retrieve the data from that table. (Structure).
    Eg:
    types : begin of str_ekko,
               ebeln type ekko-ebeln,
               bsart type ekko-bsart,
               aedat type ekko-aedat,
               endof str_ekko.
    data : itab type table of str_ekko,
            wa_itab type str_ekko.
    In the above u want to take care that while creating the structure u want to look the sequence of fields in the table. in the same sequence u want to create the structure.
    3 . The Select-options fields also wants be in the same field sequence of the table.
    eg : select ebeln bsart aedat from ekko into table itab where ebeln in so_ebeln and                                                                               
    bsart in so_bsart and
                                                                                    aedat in so_aedat.
    4.  If the above things are not working just look the indexes of that table. Just create a secondary index with ur requirement.

  • Performance is too slow on SQL Azure box

    Hi,
    Performance is too slow on SQL Azure box (Located in Europe)
    Below query returns 500,000 rows in 18 Min. on SQL Azure box (connected via SSMS, located in India)
    SELECT * FROM TABLE_1
    Whereas, on local server it returns 500,000 rows in (30 sec.)
    SQL Azure configuration:
    Service Tier/Performance Level : Premium/P1
    DTU       : 100
    MAX DB Size : 500GB     
    Max Worker Threads : 200          
    Max Sessions     : 2400
    Benchmark Transaction Rate      : 105 transactions per second
    Predictability : Best
    Any suggestion would be highly appreciated.
    Thanks,

    Hello,
    Can you please explain in a little more detail the scenario you testing? Are you comparing a SQL Database in Europe against a SQL Database in India? Or a SQL Database with a local, on-premise SQL Server installation?
    In case of the first scenario, the roundtrip latency for the connection to the datacenter might play a role. 
    If you are comparing to a local installation, please note that you might be running against completely different hardware specifications and without network delay, resulting in very different results.
    In both cases you can use the below blog post to assess the resource utilization of the SQL Database during the operation:
    http://azure.microsoft.com/blog/2014/09/11/azure-sql-database-introduces-new-near-real-time-performance-metrics/
    If the DB utilizes up to 100% you might have to consider to upgrade to a higher performance level to achieve the throughput you are looking for.
    Thanks,
    Jan 

  • Flashback and transaction query very slow

    Hello. I was wondering if anyone else has seen transaction queries be really slow and if there is anything I can do to speed it up? Here is my situation:
    I have a database with about 50 tables. We need to allow the user to go back to a point in time and "undo" what they have done. I can't use flashback table because multiple users can be making changes to the same table (different records) and I can't undo what the other users have done. So I must use the finer granularity of undoing each transaction.
    I have not had a problem with the queries, etc. I basically get a cursor to all the transactions in each of the tables and order them backwards (since all the business rules must be observed). However, getting this cursor takes forever. From that cursor, I can execute the undo_sql. In fact, I once had a cursor that did "union all" on each table and even if the user only modified 1 table, it took way too long. So now I do a quick count based on the ROWSCN (running 10g and tables have ROWDEPENDANCIES) being in the time needed to find out if this table has been touched. Based on that, I can create a cursor only for the tables that have been touched. This helps. But it is still slow especially compared to any other query I have. And if the user did touch a lot of tables, it is still way too slow.
    Here is an example of part of a query that is used on each table:
    select xid, commit_scn, logon_user, undo_change#, operation, table_name, undo_sql
    from flashback_transaction_query
    where operation IN ('INSERT', 'UPDATE', 'DELETE')
      and xid IN (select versions_xid
                  from TABLE1
                  versions between SCN p_scn and current_scn
                  where system_id = p_system_id)
      and table_name = UPPER('TABLE1')Any help is greatly appreciated.
    -Carmine

    Anyone?
    Thanks,
    -Carmine

  • Why is the query so slow?

    Hi,
    I've got a query running fast (3 sec.)
    If I try to execute it on test enviroment, it takes about 2 minutes (!)
    I see in both enviroments the explain plan is the same and so are the indexes used. I've also tried to rebuild the indexes and the tables that looked quite fragmented in test, but the result is always the same. Could it be that our test enviroment is slower and with lower performances? What else could I check? (Oracle Vers. is 8.1.7)
    Thanks!

    812809 wrote:
    steps to follow:
    1.whether the candidate columns has index or notSometimes and index can cause a query to slow down rather than speed up, especially if a person has created too many indexes on a table and the optimiser can't figure out the best one to use.
    2.go for explain plan and look the query not to fall under the category of Full Table ScanFull table scans are not always a bad thing. Sometimes they are faster than using the index. It depends.

  • Execution of SQL Query to slow

    Hey all!!!
    I'm using 10g express edition with apex 3.1, when I run this query:
    select asig.idasig IDASIG, asig.idAsig "C&oacute;digo Asignatura", asig.idasig ID,substr(asig.codigoasig||' '||asig.nombre,0,40) "Asignatura", p.nombre||' '||p.apellidos "Responsable", t.usuario "T&eacute;cnico", substr(ea.estado,0,22) "Estado Asignatura", ec.estado "Estado Certificado", cert.idestado
    from certificado cert, asignatura asig, histasig ha, profesor p, tecnico t, estado ea, estado ec
    where cert.idasig = asig.idasig and
    p.idprof = asig.idprof and
    t.idtecnico = asig.idtecnico and
    *(cert.idasig, cert.fecha) in (select idasig, max(fecha) from certificado group by idasig) and*
    ec.idestado = cert.idestado and
    ha.idasig = asig.idasig and
    *(ha.idasig, ha.fecha) in (select idasig, max(fecha) from histasig group by idasig) and*
    ea.idestado = ha.idestado
    It gets too slow, making the query gets results in approximately 149s.
    Someone can give me an idea...
    PD:The case is that we have another query that make almost the same but with this one I get the results in less than 1s.

    These are the results:
    TKPROF: Release 10.2.0.1.0 - Production on Mar Feb 10 10:35:58 2009
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Trace file: C:\oraclexe\app\oracle\admin\XE\udump\xe_ora_4724.trc
    Sort options: prsela  exeela  fchela 
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    select asig.idasig ID1, asig.idAsig ID2, asig.idasig ID3,asig.codigoasig, asig.nombre, p.nombre,p.apellidos,t.usuario,ea.estado,ec.estado,cert.idestado
    from certificado cert, asignatura asig, histasig ha,  profesor p, tecnico t, estado ea, estado ec
    where cert.idasig = asig.idasig and
    p.idprof = asig.idprof and
    t.idtecnico = asig.idtecnico and
    (cert.idasig, cert.fecha) in (select idasig, max(fecha) from certificado group by idasig) and
    ec.idestado = cert.idestado and
    ha.idasig = asig.idasig and
    (ha.idasig, ha.fecha) in (select idasig, max(fecha) from histasig group by idasig) and
    ea.idestado = ha.idestado
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.15       0.14          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch       64    102.17     102.43          0     369673          0         937
    total       66    102.32     102.57          0     369673          0         937
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 36 
    Rows     Row Source Operation
        937  NESTED LOOPS  (cr=369673 pr=0 pw=0 time=102241172 us)
        937   NESTED LOOPS  (cr=368672 pr=0 pw=0 time=103609539 us)
        937    NESTED LOOPS  (cr=5030 pr=0 pw=0 time=97377 us)
        937     NESTED LOOPS  (cr=3082 pr=0 pw=0 time=72064 us)
        937      NESTED LOOPS  (cr=2081 pr=0 pw=0 time=55194 us)
        947       HASH JOIN RIGHT SEMI (cr=44 pr=0 pw=0 time=22573 us)
        947        VIEW  VW_NSO_1 (cr=17 pr=0 pw=0 time=4100 us)
        947         HASH GROUP BY (cr=17 pr=0 pw=0 time=3151 us)
       1659          INDEX FAST FULL SCAN PK_CERTIFICADO (cr=17 pr=0 pw=0 time=1728 us)(object id 15811)
       1659        MERGE JOIN  (cr=27 pr=0 pw=0 time=11173 us)
         39         TABLE ACCESS BY INDEX ROWID ESTADO (cr=10 pr=0 pw=0 time=286 us)
         39          INDEX FULL SCAN PK_ESTADO (cr=5 pr=0 pw=0 time=95 us)(object id 15790)
       1659         SORT JOIN (cr=17 pr=0 pw=0 time=7693 us)
       1659          INDEX FAST FULL SCAN PK_CERTIFICADO (cr=17 pr=0 pw=0 time=42 us)(object id 15811)
        937       TABLE ACCESS BY INDEX ROWID ASIGNATURA (cr=2037 pr=0 pw=0 time=31871 us)
        947        INDEX UNIQUE SCAN PK_ASIGNATURA (cr=1011 pr=0 pw=0 time=16230 us)(object id 15797)
        937      TABLE ACCESS BY INDEX ROWID TECNICO (cr=1001 pr=0 pw=0 time=14632 us)
        937       INDEX UNIQUE SCAN PK_TECNICO (cr=64 pr=0 pw=0 time=6532 us)(object id 15777)
        937     TABLE ACCESS BY INDEX ROWID PROFESOR (cr=1948 pr=0 pw=0 time=20712 us)
        937      INDEX UNIQUE SCAN PK_PROFESOR (cr=1001 pr=0 pw=0 time=11554 us)(object id 15795)
        937    INDEX RANGE SCAN PK_HISTASIG (cr=363642 pr=0 pw=0 time=102276685 us)(object id 15809)
        937     FILTER  (cr=361692 pr=0 pw=0 time=101967826 us)
    64914543      HASH GROUP BY (cr=361692 pr=0 pw=0 time=139395915 us)
    94619691       INDEX FAST FULL SCAN PK_HISTASIG (cr=361692 pr=0 pw=0 time=94752646 us)(object id 15809)
        937   TABLE ACCESS BY INDEX ROWID ESTADO (cr=1001 pr=0 pw=0 time=39308 us)
        937    INDEX UNIQUE SCAN PK_ESTADO (cr=64 pr=0 pw=0 time=15348 us)(object id 15790)
    alter session set sql_trace true
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        1      0.00       0.00          0          0          0           0
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 36 
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.15       0.14          0          0          0           0
    Execute      2      0.00       0.00          0          0          0           0
    Fetch       64    102.17     102.43          0     369673          0         937
    total       67    102.32     102.57          0     369673          0         937
    Misses in library cache during parse: 1
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute      0      0.00       0.00          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        0      0.00       0.00          0          0          0           0
    Misses in library cache during parse: 0
        2  user  SQL statements in session.
        0  internal SQL statements in session.
        2  SQL statements in session.
    Trace file: C:\oraclexe\app\oracle\admin\XE\udump\xe_ora_4724.trc
    Trace file compatibility: 10.01.00
    Sort options: prsela  exeela  fchela 
           1  session in tracefile.
           2  user  SQL statements in trace file.
           0  internal SQL statements in trace file.
           2  SQL statements in trace file.
           2  unique SQL statements in trace file.
         147  lines in trace file.
         134  elapsed seconds in trace file.We had seen that the possible problems are here:
    937               INDEX RANGE SCAN PK_HISTASIG (cr=363642 pr=0 pw=0 time=102276685 us)(object id 15809)
    64914543       HASH GROUP BY (cr=361692 pr=0 pw=0 time=139395915 us)
    94619691       INDEX FAST FULL SCAN PK_HISTASIG (cr=361692 pr=0 pw=0 time=94752646 us)(object id 15809)The time spent is too much, but we don't see how can we solve this problem, any idea?

  • 4 to 4.1 - too slow to use.

    Since upgrading to 4.1 LR has become too slow to use.
    The problem lies primarily, but not restricted to, the noise reduction sliders.  The luminance slider specifically.
    Unless I can fix something I will have to return to an older version, Im actually thinking of going back to 3.6 which worked fine on my machine - AMD E2, Dual Core graphics, 4gm RAM.
    Please help.

    The queries are the same across all three database platforms and have been examined by our dba's and run through SQL Server optimizer to get the access path. All queries are very simple...the system was originally written in Btrieve. It is "record at a time" in nature. The program that does the screen refresh does three seperate queries...all something like, select * from tablename where key = 'abc'. The program then combines the data into a single record and returns the results. Like I said...SQL Server 1 second. Each of the three tables has 30,000 records, all with unique keys. The data returned to the application is probably 50 records, each 200 bytes...all character data. All tests were done with the same workstation on the same LAN....I don't think LAN latency is the problem here. Using other query tools, the response back is good, as expected.
    Another example...at application startup, we load all of the metadata (columns, primary key segments and index segments) into memory using the standard odbc api calls...SQLColumns, SQLPrimaryKeys and SQLStatistics. SQL Server loads this in maybe 8-10 seconds while Oracle loads in 15 minutes at best. These queries we don't control and it is still unbelievably slow. Again, using the ODBCTEST utility, the results for these api's come back pretty quick.
    If it is our application causing the problem in some way then it should be equally slow across all platforms, right?
    By the way, we had one of your Oracle Consultants in house trying to solve the metadata problem and he was unable to find any problem in our application and had no answers for us.
    Thanks for the quick response.
    Lon Diehl

  • BI Server performance too slow

    Hi experts,
    I am facing an issue, my OBIEE sits on a Unix Platform. And many time the server performance is too slow, when I check the processes, Java under Orabi user is using more than 50% of the CPU utilization. I need to find the root cause behind it, as it is the production system and is affecting many users.
    Thanks in advance.
    MT

    Thanks Prassu,
    Yes the Server is performing too much calculations, but they are required as need to cache reports at daily level also,
    I have an observation that the MAX_CACHE_ENTRY_SIZE [MAX_CACHE_ENTRY_SIZE = 1 MB;] parameter is set only for 1 MB, I can understand that if any query fetching more data than 1 MB will not be cached. But is there any chance that this will affect the server as well.
    Thanks
    MT

  • MySQL Connection too slow

    Please anyone with expirience in applets accessing MySQL Server!
    I made a test with a loop code executing queries and got the following conclusion:
    In media a query takes more than 2 seconds. I used PrepareStatement for better performance but it doesn�t make it better. I�ve heart about persistent connection. It�s realy faster? You know anything I could do for better performance? Obs.: When I ping my server the time answer is 200 ms. I�m from Brazil. But I think it sholdn�t make the mysql too slow as it is. Please help me.....
    I�m very thank for ur help..
    My java code:
         public void ConectaBD()
              try
                   Class.forName("com.mysql.jdbc.Driver").newInstance();
                   //Class.forName("org.gjt.mm.mysql.Driver").newInstance();
              catch(Exception e)
                   System.out.println("Error: " + e);
              try
                   con = DriverManager.getConnection("jdbc:mysql://labinfor.com.br/labinfor_codvirtual?user=labinfor_cliente&password=800091");
              catch(SQLException e)
                   System.out.println("Error: " + e );
                   e.printStackTrace();
    public void Logon()
                   java.util.Date start = new java.util.Date();
                   long startTime = start.getTime();
    if (ValidaCPF(TFCPF.getText()))
    queryLogon = "SELECT Nome FROM clientes WHERE CPF='" + TFCPF.getText().trim() + "' AND senha='" + TFSenha.getText() + "'";
    int indCon=0;
    Timer t = new Timer(1000, this);
    t.start();
    while(indCon<100)
         Conecta();
         try
                   stmt[indStmt] = con.createStatement();
         rsLogon = stmt[indStmt].executeQuery(queryLogon);
         Achou = "false";
         while (rsLogon.next())     
         Achou = "true";
         StrNome = rsLogon.getString(1);
         LValidaCPF.setText("Bem-vindo " + StrNome);
         TFCPF.disable();
         TFSenha.disable();
         BLogon.setLabel("Logoff");
                                       System.out.println("delay["+indCon+"]= "+System.currentTimeMillis());
         if (Achou == "false")
         LValidaCPF.setText("CPF ou senha incorreto");
         Desconecta();
         catch(Exception e)
         System.out.println("Error: " + e);
         indCon+=1;
    }

    Connection times of 1 to 5 seconds are normal. Pool your connections.
    To understand why:
    First, setting up a TCP/IP connection takes roughly 50% longer than a ping; a ping is one packet to the server and one packet back, a TCP/IP handshake to create a connection is one packet to the server, one back, and another to the server. Then you have a required brief wait before the connection is considered complete; we'll ignore the wait and call it .3 seconds for the TCP/IP handshake.
    Second, the database has to go through the login process. Just sending the login request and response is yet another packet round trip; in your case, that's another .2 seconds in just network time alone. With MySQL, the login involves checking the security of the connection and the user; it often requires a reverse DNS lookup on the IP address of the client. Probably 4 or 5 tables have to be queried and a user environment is created within the server. The server work for the login might take .75 seconds, at a guess. Adding the network time makes this step .95 seconds or so.
    Third, there's the time it takes to do the query itself; another network round trip; .2 second network round trip, plus maybe .1 second to run the query on the database, for a total of .3 seconds.
    Fourth, there's the time it takes to tear down the TCP/IP connection on connection close. That involves 4 packets, 2 round-trips, so add another .4 seconds.
    Adding it all up, you get .3 + .95 + .3 + .4 = 1.95 seconds, of which .3 is your SQL query (network and DB time), .9 is network time for TCP/IP connection and login request, and .75 is DB time for the login.

  • Performance too Slow on SQL Azure box

    Hi,
    Performance is too slow on SQL Azure box:
    Below query returns 500,000 rows in 18 Min. on SQL Azure box (connected via SSMS)
    SELECT * FROM TABLE_1
    Whereas, on local server it returns 500,000 rows in (30 sec.)
    SQL Azure configuration:
    Service Tier/Performance Level : Premium/P1
    DTU       : 100
    MAX DB Size : 500GB     
    Max Worker Threads : 200          
    Max Sessions     : 2400
    Benchmark Transaction Rate      : 105 transactions per second
    Predictability : Best
    Thanks,

    Hello,
    Please refer to the following document too:
    http://download.microsoft.com/download/D/2/0/D20E1C5F-72EA-4505-9F26-FEF9550EFD44/Performance%20Guidance%20for%20SQL%20Server%20in%20Windows%20Azure%20Virtual%20Machines.docx
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Application running too slow on sun T5440 but run normal on sun M3000

    Hi all,
    I have application running on sun server T5440 4x8x1.4 GHz, 64 GB RAM, application running very slow though load average too low. when I install my application on another server SUN M3000 (One CPU 1x8x2.5GHz, 8GB RAM), application run smoothly.
    Here is my server T5440 info:
    Code:
    bash-3.00# uname -a
    SunOS 5.10 Generic_142909-17 sun4v sparc SUNW,T5440
    Psrinfo -pv
    Code:
    bash-3.00# psrinfo -pv
    The physical processor has 64 virtual processors (0-63)
    UltraSPARC-T2+ (chipid 0, clock 1414 MHz)
    The physical processor has 64 virtual processors (64-127)
    UltraSPARC-T2+ (chipid 1, clock 1414 MHz)
    The physical processor has 64 virtual processors (128-191)
    UltraSPARC-T2+ (chipid 2, clock 1414 MHz)
    The physical processor has 64 virtual processors (192-255)
    UltraSPARC-T2+ (chipid 3, clock 1414 MHz)
    /etc/system
    Code:
    set semsys:seminfo_semopm=10000
    set semsys:seminfo_semmsl=10000
    set semsys:seminfo_semmni=1024
    set max_nprocs=50000
    set msgsys:msginfo_msgmnb=2097152
    set msgsys:msginfo_msgmni=2560
    set msgsys:msginfo_msgtql=2560
    set shmsys:shminfo_shmmax=1073741824
    set shmsys:shminfo_shmmni=1000
    set rlim_fd_cur=10000
    Ipcs
    Code:
    bash-3.00# ipcs -a
    IPC status from as of Wed Jun 13 12:31:01 ICT 2012
    T ID KEY MODE OWNER GROUP CREATOR CGROUP CBYTES QNUM QBYTES LSPID LRPID STIME RTIME CTIME
    Message Queues:
    q 62 0x1388 --rw-rw-rw- topx topx topx topx 0 0 2097152 0 0 no-entry no-entry 8:36:22
    q 61 0x1387 --rw-rw-rw- topx topx topx topx 0 0 2097152 0 0 no-entry no-entry 8:36:22
    q 60 0x1318 --rw-rw-rw- topx topx topx topx 0 0 2097152 0 0 no-entry no-entry 8:36:22
    q 59 0x12a9 --rw-rw-rw- topx topx topx topx 0 0 2097152 9069 9071 10:25:38 10:25:38 8:36:22
    q 58 0x100f --rw-rw-rw- topx topx topx topx 0 0 2097152 9069 9070 10:06:16 10:06:16 8:36:22
    q 57 0xfa0 -Rrw-rw-rw- topx topx topx topx 0 0 2097152 9071 9069 10:25:38 10:25:38 8:36:22
    q 56 0xf30 --rw-rw-rw- topx topx topx topx 0 0 2097152 0 0 no-entry no-entry 8:36:20
    q 55 0xc27 -Rrw-rw-rw- topx topx topx topx 0 0 2097152 0 0 no-entry no-entry 8:28:14
    q 54 0xbb8 -Rrw-rw-rw- topx topx topx topx 0 0 2097152 172 9066 10:47:08 10:47:08 8:28:14
    T ID KEY MODE OWNER GROUP CREATOR CGROUP NATTCH SEGSZ CPID LPID ATIME DTIME CTIME
    Shared Memory:
    T ID KEY MODE OWNER GROUP CREATOR CGROUP NSEMS OTIME CTIME
    Semaphores:
    s 104 0x9c4 --ra-ra-ra- topx topx topx topx 3 12:31:00 8:36:20
    s 103 0xa8c --ra-ra-ra- topx topx topx topx 1 8:36:20 8:36:20
    s 102 0xd48 --ra-ra-ra- topx topx topx topx 1 8:36:20 8:36:20
    s 101 0xce4 --ra-ra-ra- topx topx topx topx 1 8:36:20 8:36:20
    s 100 0x26de --ra-ra-ra- topx topx topx topx 8 10:19:34 8:28:14
    s 99 0xc1c --ra-ra-ra- topx topx topx topx 1 8:36:20 8:28:14
    s 98 0xbb8 --ra-ra-ra- topx topx topx topx 1 8:43:50 8:28:14
    s 97 0xaf0 --ra-ra-ra- topx topx topx topx 500 8:36:20 8:28:14
    s 96 0xa28 --ra-ra-ra- topx topx topx topx 500 8:36:20 8:28:14
    s 95 0x7ee --ra-ra-ra- topx topx topx topx 1 8:36:20 8:28:14
    s 94 0x7e4 --ra-ra-ra- topx topx topx topx 1001 8:36:20 8:28:14
    s 93 0x7da --ra-ra-ra- topx topx topx topx 220 8:36:20 8:28:14
    s 92 0x7d5 --ra-ra-ra- topx topx topx topx 200 12:05:15 8:28:14
    s 91 0x7d0 --ra-ra-ra- topx topx topx topx 200 8:56:42 8:28:14
    s 90 0xc80 --ra-ra-ra- topx topx topx topx 2 12:31:01 8:27:52 –a
    Prstat
    Code:
    PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
    9202 topx 1460M 893M sleep 59 0 0:16:37 0.2% integrity_check/1
    12455 root 3880K 3600K cpu65 59 0 0:00:00 0.0% prstat/1
    9080 topx 142M 130M sleep 59 0 0:00:52 0.0% intf_resp_low/1
    9125 topx 102M 78M sleep 59 0 0:00:36 0.0% interface_vsc/1
    9121 topx 88M 80M sleep 59 0 0:00:32 0.0% interface_tcu/1
    9120 topx 89M 80M sleep 59 0 0:00:29 0.0% interface_rcm/1
    9124 topx 87M 78M sleep 59 0 0:00:29 0.0% baplie_merge_v2/1
    9122 topx 86M 78M sleep 59 0 0:00:28 0.0% interface_eih/1
    9115 topx 88M 77M sleep 59 0 0:00:33 0.0% intf_batch_even/1
    9114 topx 88M 77M sleep 59 0 0:00:39 0.0% intf_event/1
    9117 topx 87M 78M sleep 59 0 0:00:32 0.0% interface_bxy/1
    9118 topx 86M 78M sleep 59 0 0:00:29 0.0% interface_ppm/1
    NPROC USERNAME SWAP RSS MEMORY TIME CPU
    41 topx 334M 2237M 3.4% 0:30:17 0.3%
    43 root 186M 195M 0.3% 0:14:45 0.0%
    1 noaccess 152M 136M 0.2% 0:04:00 0.0%
    1 smmsp 3688K 11M 0.0% 0:00:04 0.0%
    1 lp 1208K 3880K 0.0% 0:00:00 0.0%
    6 daemon 7264K 9944K 0.0% 0:00:26 0.0%
    Total: 93 processes, 259 lwps, load averages: 0.40, 0.39, 0.39
    Prstat –mL
    Code:
    bash-3.00# prstat -mL
    PID USERNAME USR SYS TRP TFL DFL LCK SLP LAT VCX ICX SCL SIG PROCESS/LWPID
    9202 topx 0.9 0.0 0.0 0.0 0.0 0.0 99 0.0 2 0 5 0 integrity_ch/1
    9080 topx 0.4 0.0 0.0 0.0 0.0 0.0 100 0.0 5 0 20 0 intf_resp_lo/1
    9114 topx 0.2 0.0 0.0 0.0 0.0 0.0 100 0.0 13 0 66 0 intf_event/1
    17282 root 0.1 0.2 0.0 0.0 0.0 0.0 100 0.0 20 1 324 0 prstat/1
    9117 topx 0.2 0.0 0.0 0.0 0.0 0.0 100 0.0 10 1 70 0 interface_bx/1
    9118 topx 0.2 0.0 0.0 0.0 0.0 0.0 100 0.0 10 1 70 0 interface_pp/1
    9115 topx 0.2 0.0 0.0 0.0 0.0 0.0 100 0.0 15 0 80 0 intf_batch_e/1
    9121 topx 0.2 0.0 0.0 0.0 0.0 0.0 100 0.0 10 0 70 0 interface_tc/1
    9125 topx 0.2 0.0 0.0 0.0 0.0 0.0 100 0.0 10 0 70 0 interface_vs/1
    9120 topx 0.2 0.0 0.0 0.0 0.0 0.0 100 0.0 10 0 70 0 interface_rc/1
    9123 topx 0.2 0.0 0.0 0.0 0.0 0.0 100 0.0 10 0 70 0 interface_vs/1
    9124 topx 0.2 0.0 0.0 0.0 0.0 0.0 100 0.0 10 1 70 0 baplie_merge/1
    9122 topx 0.1 0.0 0.0 0.0 0.0 0.0 100 0.0 8 0 56 0 interface_ei/1
    9119 topx 0.1 0.0 0.0 0.0 0.0 0.0 100 0.0 8 0 56 0 interface_cp/1
    9204 topx 0.1 0.0 0.0 0.0 0.0 0.0 100 0.0 15 1 1K 0 sys_check/1
    259 root 0.0 0.0 0.0 0.0 0.0 0.0 100 0.0 13 2 98 7 in.mpathd/1
    1 root 0.0 0.0 0.0 0.0 0.0 0.0 100 0.0 3 0 99 3 init/1
    1337 noaccess 0.0 0.0 0.0 0.0 0.0 0.0 100 0.0 100 0 100 0 java/14
    140 root 0.0 0.0 0.0 0.0 0.0 0.0 100 0.0 19 0 114 0 nscd/851
    Total: 90 processes, 256 lwps, load averages: 0.40, 0.40, 0.39
    Vmstat
    Code:
    bash-3.00# vmstat 1 10
    kthr memory page disk faults cpu
    r b w swap free re mf pi po fr de sr m0 m1 m2 m3 in sy cs us sy id
    0 0 0 87720712 60562856 173 645 199 44 44 0 0 0 0 0 0 886 2819 525 0 1 99
    1 0 0 87563976 59743040 73 327 0 15 15 0 0 0 0 0 0 747 2831 439 0 1 99
    0 0 0 87563656 59742808 61 306 0 15 15 0 0 0 0 0 0 770 2684 427 0 1 99
    1 0 0 87563656 59742824 0 0 0 0 0 0 0 0 0 0 0 886 1302 525 0 1 99
    1 0 0 87563656 59742816 62 305 0 15 15 0 0 0 0 0 0 722 2652 420 3 1 96
    1 0 0 87563656 59742840 554 2777 0 139 139 0 0 0 0 0 0 959 9736 749 1 1 97
    0 0 0 87563456 59742672 1155 5735 0 292 292 0 0 0 0 0 0 1113 17489 1145 1 3 96
    1 0 0 87563656 59742840 0 0 0 0 0 0 0 0 0 0 0 845 1613 654 0 1 99
    0 0 0 87563656 59742856 62 305 0 15 15 0 0 0 0 0 0 900 2647 526 0 1 99
    0 0 0 87563656 59742856 62 304 0 15 15 0 0 0 0 0 0 683 2661 396 0 1 99
    Mpstat
    Code:
    CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
    0 0 0 130 261 1 121 0 13 1 0 0 0 1 0 99
    1 0 0 35 133 2 143 0 9 6 0 64 0 0 0 100
    2 0 0 5 20 2 17 0 3 0 0 29 1 0 0 99
    3 0 0 0 3 0 2 0 0 0 0 0 0 0 0 100
    4 0 0 3 14 0 15 0 2 2 0 13 0 0 0 100
    73 0 0 474330 77 3 0 7 0 2 0 2596 67 33 0 0
    73 0 0 487701 37 0 0 7 0 8 0 2670 66 34 0 0
    73 0 0 476377 14 0 0 8 0 1 0 2610 66 34 0 0
    78 0 0 473950 11 1 0 7 0 13 0 2593 67 33 0 0
    78 0 0 480562 9 0 0 7 0 4 0 2630 66 34 0 0
    79 0 0 320989 14 1 0 8 0 0 0 1766 77 23 0 0
    79 0 0 479148 9 0 0 7 0 8 0 2622 66 34 0 0
    79 0 0 479426 13 0 0 7 0 2 0 2622 67 33 0 0
    79 0 0 488949 9 0 0 8 0 13 0 2678 66 34 0 0
    64 0 0 482229 15 2 0 8 0 7 0 2638 65 35 0 0
    77 0 0 475571 14 1 0 7 0 8 0 2602 67 33 0 0
    69 0 0 467795 22 1 0 7 0 40 0 2563 66 34 0 0
    69 0 0 318623 9 1 0 7 0 8 0 1751 77 23 0 0
    66 0 0 465179 92 1 2 8 0 62 0 2545 66 34 0 0
    When my application running, some of CPU have IDLE state = 0 and hold the CPU while another CPU have IDLE state 100. I think this is my bottleneck but I cannot find any solution for solve that.
    Netstat
    Code:
    bash-3.00# netstat -i
    Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue
    lo0 8232 loopback localhost 244022 0 244022 0 0 0
    nxge0 1500 TOPX-01-DUMMY1 TOPX-01-DUMMY1 3594863 0 5801650 0 0 0
    nxge1 1500 TOPX-01-DUMMY2 TOPX-01-DUMMY2 160954 0 151230 0 0 0
    iostat
    Code:
    bash-3.00# iostat -xn
    extended device statistics
    r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device
    0.1 0.1 1.5 30.8 0.0 0.0 1.8 9.0 0 0 md/d0
    0.0 0.1 0.8 30.8 0.0 0.0 0.0 9.9 0 0 md/d1
    0.0 0.1 0.8 30.8 0.0 0.0 0.0 9.8 0 0 md/d2
    0.0 0.0 0.0 0.0 0.0 0.0 0.0 15.2 0 0 md/d3
    0.0 0.0 0.0 0.0 0.0 0.0 0.0 10.9 0 0 md/d4
    0.0 0.0 0.0 0.0 0.0 0.0 0.0 19.4 0 0 md/d5
    0.0 0.0 2.2 1.5 0.0 0.0 0.8 7.4 0 0 md/d6
    0.0 0.0 1.1 0.7 0.0 0.0 0.0 8.5 0 0 md/d7
    0.0 0.0 1.1 0.8 0.0 0.0 0.0 8.2 0 0 md/d8
    0.0 0.1 0.4 0.6 0.0 0.0 7.6 10.0 0 0 md/d9
    0.0 0.1 0.2 0.6 0.0 0.0 0.0 9.1 0 0 md/d10
    0.0 0.1 0.2 0.6 0.0 0.0 0.0 7.8 0 0 md/d11
    0.0 0.0 0.0 0.0 0.0 0.0 0.1 10.4 0 0 md/d12
    0.0 0.0 0.0 0.0 0.0 0.0 0.0 8.5 0 0 md/d13
    0.0 0.0 0.0 0.0 0.0 0.0 0.0 8.4 0 0 md/d14
    0.1 0.5 2.1 32.3 0.0 0.0 0.0 9.9 0 0 c0t0d0
    0.1 0.5 2.1 32.3 0.0 0.0 0.0 9.8 0 0 c0t1d0
    0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 c1t0d0
    0.9 0.9 125.3 123.1 0.0 0.1 0.0 34.2 0 2 c4t600144F0CC00C29A00004D1E456F0003d0
    0.3 0.7 20.7 53.9 0.0 0.0 0.2 8.2 0 0 c4t600144F0CC00C29A00004D1E43880001d0
    0.1 0.2 50.7 111.5 0.0 0.0 0.0 59.1 0 1 c4t600144F0CC00C29A00004D1E453E0002d0
    Please help me find the bottleneck of my T5440 server?Thanks so much for all your help.

    Moderator Comment and Action:
    @ O.P.,
    You cross-posted this to at least two other forum web sites:
    http://www.linuxquestions.org/questions/solaris-opensolaris-20/application-running-too-slow-on-sun-sparc-t5440-but-run-normal-on-sun-m3000-4175411155/
    http://www.unix.com/solaris/189945-application-running-too-slow-sun-sparc-t5440-but-run-normal-sun-m3000.html
    ... and didn't think that was important enough to simply mention the fact.
    Timestamps suggest that OTN was the last place you posted to.
    Poor forum etiquette.
    Why would anyone spend the time to try to give help that you have already received elsewhere? That's a waste of their time.
    (Yes, you already received the suggestion to use Dtrace in one of those other sites.)
    This thread is locked as irrelevant.

  • Java web start application runs too slow...

    Hello,
    I am new to Java Web Start. I have created a java web start application and when i enable web start from local Execution, then it works perfectly well. But when i upload it on server and then download the application, then it is too too slow...i mean it takes minutes to get the output on clicking some button....my jnlp file is as under:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <jnlp codebase="http://(web server code base)" href="launch.jnlp" spec="1.0+">
    <information>
    <title>ERD</title>
    <vendor>Deepika Gohil</vendor>
    <homepage href="http://appframework.dev.java.net"/>
    <description>A simple java desktop application based on Swing Application Framework</description>
    <description kind="short">ER Deign Tools</description>
    </information>
    <update check="always"/>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.5+"/>
    <jar href="ERD_1_2.jar" main="true"/>
    <jar href="lib/appframework-1.0.3.jar"/>
    <jar href="lib/swing-worker-1.1.jar"/>
    <jar href="lib/jaxb-impl.jar"/>
    <jar href="lib/jaxb-xjc.jar"/>
    <jar href="lib/jaxb1-impl.jar"/>
    <jar href="lib/activation.jar"/>
    <jar href="lib/jaxb-api.jar"/>
    <jar href="lib/jsr173_api.jar"/>
    <jar href="lib/ant-contrib-1.0b3.jar"/>
    <jar href="lib/jaxb-impl.jar"/>
    <jar href="lib/jaxb-xjc.jar"/>
    <jar href="lib/FastInfoset.jar"/>
    <jar href="lib/gmbal-api-only.jar"/>
    <jar href="lib/http.jar"/>
    <jar href="lib/jaxws-rt.jar"/>
    <jar href="lib/jaxws-tools.jar"/>
    <jar href="lib/management-api.jar"/>
    <jar href="lib/mimepull.jar"/>
    <jar href="lib/policy.jar"/>
    <jar href="lib/saaj-impl.jar"/>
    <jar href="lib/stax-ex.jar"/>
    <jar href="lib/streambuffer.jar"/>
    <jar href="lib/woodstox.jar"/>
    <jar href="lib/jaxws-api.jar"/>
    <jar href="lib/jsr181-api.jar"/>
    <jar href="lib/jsr250-api.jar"/>
    <jar href="lib/saaj-api.jar"/>
    <jar href="lib/activation.jar"/>
    <jar href="lib/jaxb-api.jar"/>
    <jar href="lib/jsr173_api.jar"/>
    </resources>
    <application-desc main-class="erd.screen1">
    </application-desc>
    </jnlp>
    I dont understand the reason. Could you please help me out.
    Thank you,
    Deepika Gohil.

    Check your web server's access logs to see how many requests web start is sending for each jar. After you've loaded the application the first time, for each subsequent launch, if you've got everything configured right, you should only see requests for the JNLP file and maybe some gifs because web start should load everything else out of the cache (if you're using the version-based download protocol). Or if you're using the basic download protocol, then you might see requests for each jar file, but even in this case, if your web server is prepared to evaluate the last-updated attribute for each jar request and for jars that have not changed, respond with no actual payload and a header value of Not-Modified, then that should run almost as fast.
    You might also want to consider changing the "check" attribute of the "update" element from "always" to "background" for a couple of reasons. It should allow your app to start sooner (but this means that you might have to launch once or twice after an update is applied to the web server before the update shows up on the workstation). Also, my impression is that "always" is broken and prevents web start from ever checking to see if your jnlp file has been updated if you launch your app from a web start shortcut - launching from a browser is less likely to have this problem, depending on how often your browser is configured to check for updated resources.

  • Please Help! All Sounds in Classic are too slow now!

    Something dreadful happened (wish I knew what) and now every sound that is played back by any Classic application is about 70% too slow.
    No matter if it is a Classic game like Unreal (I), Deus Ex, AvP for OS9 (the OSX version works fine), or Quicktime 6, or any other given Classic application. The only sounds that appear normal are the Platinum system sounds.
    I don't know which files affect Classic sound playback or where they are located. Can't imagine what could cause that particular problem.
    Hope someone could help...
    Many thanks in advance
    M:A:
    PowerMac G5 2x2 GHz Mac OS X (10.4.6) 1.5 GB RAM, standard sound card (TI-TAS3004)
    PowerMac G5 2x2

    Sorry, didnt get an email notification, so I just checked the thread.
    Starting and quitting Garage Band actually helped!
    (Imagine listening to the meaningful dialogues in "Deus Ex" spoken with Sesame Street's Cookie Monster voice. Aaaaannnd reeealllly sllloowwww. Doesn't quite capture the mood...)
    Do you have an explanation why Garage Band should affect Classic sound output?
    Thanks a lot,
    Martin

Maybe you are looking for

  • Need help with buttons

    stupid question maybe but i'm a beginner, and hey..there are no stupid questions, right? well, i may prove that wrong...anyway... I can't relocate a button, or any other component for that matter. When I try to make a simple applet with just one butt

  • Errors in client when calling web service:

    Here is my code: public static void main(String[] argv) throws Exception // Setup the global JAXM message factory System.setProperty("javax.xml.soap.MessageFactory", "weblogic.webservice.core.soap.MessageFactoryImpl"); // Setup the global JAX-RPC ser

  • I bought my iphone 20 days ago it was good at first but i cant turn my iphone on ,i cant restore it too!!!why???!?!?!?!?

    i bought my iphone 20 days ago it was good at first but i cant turn my iphone on  for 3 days ,i cant restore it too!!!why???!?!?!?!? i am very disappointe from apple

  • No SIM card installed, No SIM, Invalid SIM card

    Hello, I'm getting No SIM card installed on my iPhone 4. I got a new SIM card and 15 minutes later same error. I've reset network settings and also tried a restore with no luck. Genius Bar recommended wiping and starting over without restoring from B

  • MediaUnsupportedException running Big Buck Bunny demo

    I am trying to run the video demo in the JavaFX samples on javafx.com but I get the following exception in the console: playing http://sun.edgeboss.net/download/sun/media/1460825906/1460825906_2956241001_big-buck-bunny-640x360.flv Error with Media: M