Query Tune - Expensive Window sort.

I want some advise to tune this query.
My database version:
SQL> SELECT * FROM v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
CORE    10.2.0.5.0      Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.5.0 - Productio
NLSRTL Version 10.2.0.5.0 - Production
SQL> The query
SQL> EXPLAIN PLAN FOR
  2   WITH INN AS
  3    (
  4           SELECT /*+ PARALLEL(log,8)  */
  5                  item_no,
  6                  item_type,
  7                  bu_code_send,
  8                  bu_type_send,
  9                  bu_code_rcv,
10                  bu_type_rcv,
11                  from_date_rcv,
12                  to_date_rcv,
13                  lt_val,
14                  lt_val_uom_code,
15                  upd_dtime,
16                  delete_dtime,
17                  ROW_NUMBER() OVER(PARTITION BY item_no,     item_type,   bu_code_send, bu_type_send,
18                                                 bu_code_rcv, bu_type_rcv, from_date_rcv
19                                        ORDER BY upd_dtime DESC) AS nr
20             FROM log.CEM_TOTAL_LEADTIME_T_LOG log
21            WHERE UPD_DTIME      <  TO_DATE ('13-11-2012','DD-MM-YYYY')
22                   )
23   SELECT
24         item_no,
25         item_type,
26         bu_code_send,
27         bu_type_send,
28         bu_code_rcv,
29         bu_type_rcv,
30         from_date_rcv,
31         to_date_rcv,
32         lt_val,
33         lt_val_uom_code,
34         SYSDATE
35    FROM  inn
36   WHERE DELETE_DTIME IS NULL
37     AND NR=1
38     AND to_DATE ('13-11-2012','DD-MM-YYYY') BETWEEN from_date_rcv AND NVL(to_date_rcv, '31-DEC-9999')
39     ;
Explained.The Plan
PLAN_TABLE_OUTPUT
Plan hash value: 3866412310
| Id  | Operation                      | Name                     | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     | Pstart| Pstop |    TQ  |IN-OUT| PQ Distrib |
|   0 | SELECT STATEMENT               |                          |   331M|    26G|       |   374K  (4)| 00:50:30 |       |       |        |      |            |
|   1 |  PX COORDINATOR                |                          |       |       |       |            |          |       |       |        |      |            |
|   2 |   PX SEND QC (RANDOM)          | :TQ10001                 |   331M|    26G|       |   374K  (4)| 00:50:30 |       |       |  Q1,01 | P->S | QC (RAND)  |
|*  3 |    VIEW                        |                          |   331M|    26G|       |   374K  (4)| 00:50:30 |       |       |  Q1,01 | PCWP |            |
|*  4 |     WINDOW SORT PUSHED RANK    |                          |   331M|    20G|    29G|   374K  (4)| 00:50:30 |       |       |  Q1,01 | PCWP |            |
|   5 |      PX RECEIVE                |                          |   331M|    20G|       |   374K  (4)| 00:50:30 |       |       |  Q1,01 | PCWP |            |
|   6 |       PX SEND HASH             | :TQ10000                 |   331M|    20G|       |   374K  (4)| 00:50:30 |       |       |  Q1,00 | P->P | HASH       |
|*  7 |        WINDOW CHILD PUSHED RANK|                          |   331M|    20G|       |   374K  (4)| 00:50:30 |       |       |  Q1,00 | PCWP |            |
|   8 |         PX BLOCK ITERATOR      |                          |   331M|    20G|       |  7123  (44)| 00:00:58 |     1 |   167 |  Q1,00 | PCWC |            |
|*  9 |          TABLE ACCESS FULL     | CEM_TOTAL_LEADTIME_T_LOG |   331M|    20G|       |  7123  (44)| 00:00:58 |     1 |   167 |  Q1,00 | PCWP |            |
Predicate Information (identified by operation id):
   3 - filter("DELETE_DTIME" IS NULL AND "NR"=1 AND NVL("TO_DATE_RCV",TO_DATE(' 9999-12-31 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))>=TO_DATE(' 2012-11-13
PLAN_TABLE_OUTPUT
              00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
   4 - filter(ROW_NUMBER() OVER ( PARTITION BY "ITEM_NO","ITEM_TYPE","BU_CODE_SEND","BU_TYPE_SEND","BU_CODE_RCV","BU_TYPE_RCV","FROM_DATE_RCV" ORDER BY
              INTERNAL_FUNCTION("UPD_DTIME") DESC )<=1)
   7 - filter(ROW_NUMBER() OVER ( PARTITION BY "ITEM_NO","ITEM_TYPE","BU_CODE_SEND","BU_TYPE_SEND","BU_CODE_RCV","BU_TYPE_RCV","FROM_DATE_RCV" ORDER BY
              INTERNAL_FUNCTION("UPD_DTIME") DESC )<=1)
   9 - filter("FROM_DATE_RCV"<=TO_DATE(' 2012-11-13 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND "UPD_DTIME"<TO_DATE(' 2012-11-13 00:00:00', 'syyyy-mm-dd
              hh24:mi:ss'))Some more thoughts/inputs:
1. The table CEM_TOTAL_LEADTIME_T_LOG has 333 million rows, It is a partition table but the range partition is on LOG_DATE column (not used in this query).
2. The window sort is taking huge temp space (wrong cardinality estimate ? How to correct ?)
3. Actually it is taking around 56 min to complete.

Not tested,
Just trying to eliminate the analytic function here. (I cannot check this --can do only syntax check)..
Firstly check if this is similar to your query and if yes, check if this improves the performance.
WITH t AS
        (SELECT item_no,
                item_type,
                bu_code_send,
                bu_type_send,
                bu_code_rcv,
                bu_type_rcv,
                from_date_rcv,
                to_date_rcv,
                lt_val,
                lt_val_uom_code,
                upd_dtime,
                delete_dtime
           FROM LOG.CEM_TOTAL_LEADTIME_T_LOG LOG
          WHERE UPD_DTIME < TO_DATE ('13-11-2012', 'DD-MM-YYYY')),
     t1 AS
        (  SELECT item_no,
                  item_type,
                  bu_code_send,
                  bu_type_send,
                  bu_code_rcv,
                  bu_type_rcv,
                  from_date_rcv,
                  to_date_rcv,
                  MAX (upd_dtime) upd_dtime
             FROM t
         GROUP BY item_no,
                  item_type,
                  bu_code_send,
                  bu_type_send,
                  bu_code_rcv,
                  bu_type_rcv,
                  from_date_rcv,
                  to_date_rcv)
SELECT a.item_no,
       a.item_type,
       a.bu_code_send,
       a.bu_type_send,
       a.bu_code_rcv,
       a.bu_type_rcv,
       a.from_date_rcv,
       a.to_date_rcv,
       a.lt_val,
       a.lt_val_uom_code,
       SYSDATE,
       a.upd_dtime
  FROM t1 a, t b
WHERE     a.item_no = b.item_no
       AND a.item_type = b.item_type
       AND a.bu_code_send = b.bu_code_send
       AND a.bu_type_send = b.bu_type_send
       AND a.bu_code_rcv = b.bu_code_rcv
       AND a.bu_type_rcv = b.bu_type_rcv
       AND a.from_date_rcv = b.from_date_rcv
       AND a.to_date_rcv = b.to_date_rcv
       AND a.upd_dtime = b.upd_dtime
       AND DELETE_DTIME IS NULL
       AND TO_DATE ('13-11-2012', 'DD-MM-YYYY') BETWEEN from_date_rcv
                                                    AND NVL (to_date_rcv,
                                                             '31-DEC-9999');Cheers,
Manik
Edited by: Manik on Nov 15, 2012 3:13 PM

Similar Messages

  • Help me query tunning

    Hi Guru's
    Can you please help me query tunning.
    Database Version : Oracle 11g - 11.2.0.3
    select  distinct  corporation_name custer_name,
            glog_util.remove_domain(SHIP_BUY.SERVPROV_GID ) SCAC,
            glog_util.remove_domain(ship_buy.shipment_gid) buy_shipment_gid,
            F_Get_SELL_ID_STRING(SHIP_BUY.SHIPMENT_GID) sell_shipment_gid,
            ship_buy.domain_name,    
            F_GET_ORDER_RELEASE_GID('B',SHIP_BUY.SHIPMENT_GID,0) ORDER_RELEASE_GID,
            f_get_refnum_string('SHIPMENT', ship_buy.shipment_gid, 'MBOL_NUMBER_CLEANSED')MBOL_NUMBER,
            F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID) POD_RECEIVED_DATE,
            f_get_exp_accrue_amt(ship_buy.shipment_gid,'SHIPMENT') Total_accrual_amount    
    from shipment ship_buy,
            invoice inv,
            invoice_shipment si,
            --voucher v,
            corporation corp
    where corp.domain_name=ship_buy.domain_name
            and corp.is_domain_master='Y'
          and 1=1
          AND ship_buy.domain_name like 'UPS/CP/DFP/%'
          and F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID)  <= to_char(to_date('31-JUL-2013', 'DD-MON-YYYY'), 'dd-mon-yyyy')
            --and V.INVOICE_GID(+) = inv.invoice_gid
            --and ship_buy.domain_name = 'UPS/CP/VZNB'
            and si.shipment_gid(+) = SHIP_BUY.SHIPMENT_GID
            AND SI.INVOICE_GID = INV.INVOICE_GID(+)
            and SHIP_BUY.INSERT_DATE > '1-JAN-2007'
            and SHIP_BUY.USER_DEFINED1_ICON_GID = 'ACCEPTED'
    UNION        
    select  distinct  corporation_name custer_name,
            glog_util.remove_domain(SHIP_BUY.SERVPROV_GID ) SCAC,
            glog_util.remove_domain(ship_buy.shipment_gid) buy_shipment_gid,
            F_GET_SELL_ID_STRING( SHIP_BUY.SHIPMENT_GID) sell_shipment_gid,
            ship_buy.domain_name,    
            F_GET_ORDER_RELEASE_GID('B',SHIP_BUY.SHIPMENT_GID,0) ORDER_RELEASE_GID,
            f_get_refnum_string('SHIPMENT', ship_buy.shipment_gid, 'MBOL_NUMBER_CLEANSED')MBOL_NUMBER,
            F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID) POD_RECEIVED_DATE,
            f_get_exp_accrue_amt(inv.invoice_gid,'INVOICE') Total_accrual_amount  
    from shipment ship_buy,
            invoice inv,
            invoice_shipment si,
          -- voucher v,
            corporation corp
    where corp.domain_name=ship_buy.domain_name
            and corp.is_domain_master='Y'
            and 1=1
            AND ship_buy.domain_name like 'UPS/CP/DFP/%'
            and F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID)  <= to_char(to_date('31-JUL-2013', 'DD-MON-YYYY'), 'dd-mon-yyyy')
          --AND INV.DOMAIN_NAME = 'UPS/CP/VZNB'
          --and V.INVOICE_GID(+) = inv.invoice_gid
            and si.shipment_gid(+) = SHIP_BUY.SHIPMENT_GID
            AND SI.INVOICE_GID = INV.INVOICE_GID(+)
            and SHIP_BUY.INSERT_DATE > '1-JAN-2007'
            and INV.USER_DEFINED1_ICON_GID = 'ACCEPTED'
    GROUP BY corporation_name,SHIP_BUY.SHIPMENT_GID,SHIP_BUY.SERVPROV_GID,ship_buy.domain_name,inv.invoice_gid
    ORDER BY CUSTER_NAME, BUY_SHIPMENT_GID;
    And I generated the execution plan :
    | Id  | Operation                          | Name                    | Rows  | Bytes | Cost (%CPU)| Time    |
    |  0 | SELECT STATEMENT                  |                        |    3 |  448 |  415  (2)| 00:00:05 |
    |  1 |  SORT UNIQUE                      |                        |    3 |  448 |  414  (87)| 00:00:05 |
    |  2 |  UNION-ALL                        |                        |      |      |            |          |
    |  3 |    NESTED LOOPS OUTER              |                        |    3 |  384 |    57  (0)| 00:00:01 |
    |*  4 |    HASH JOIN                      |                        |    3 |  294 |    54  (0)| 00:00:01 |
    |*  5 |      TABLE ACCESS BY INDEX ROWID  | SHIPMENT                |    3 |  195 |    40  (0)| 00:00:01 |
    |*  6 |      INDEX SKIP SCAN              | IND_SHIP_DOM_ICON      |    54 |      |    25  (0)| 00:00:01 |
    |*  7 |      TABLE ACCESS FULL            | CORPORATION            |    4 |  132 |    14  (0)| 00:00:01 |
    |*  8 |    INDEX RANGE SCAN              | IND_INVOICESHIP_SHP_GID |    1 |    30 |    1  (0)| 00:00:01 |
    |  9 |    HASH GROUP BY                  |                        |    1 |  192 |  356  (1)| 00:00:05 |
    |* 10 |    HASH JOIN                      |                        |    1 |  192 |  354  (1)| 00:00:05 |
    |  11 |      NESTED LOOPS                  |                        |      |      |            |          |
    |  12 |      NESTED LOOPS                |                        |    1 |  159 |  339  (0)| 00:00:05 |
    |  13 |        NESTED LOOPS                |                        |  145 | 13920 |  194  (0)| 00:00:03 |
    |  14 |        TABLE ACCESS BY INDEX ROWID| INVOICE                |  145 |  5220 |    49  (0)| 00:00:01 |
    |* 15 |          INDEX SKIP SCAN          | IDX_INV_TYP_ICON_NAM    |  145 |      |    17  (0)| 00:00:01 |
    |* 16 |        INDEX RANGE SCAN          | UK_INVOICE_SHIPMENT    |    1 |    60 |    1  (0)| 00:00:01 |
    |* 17 |        INDEX UNIQUE SCAN          | PK_SHIPMENT            |    1 |      |    1  (0)| 00:00:01 |
    |* 18 |      TABLE ACCESS BY INDEX ROWID  | SHIPMENT                |    1 |    63 |    1  (0)| 00:00:01 |
    |* 19 |      TABLE ACCESS FULL            | CORPORATION            |    4 |  132 |    14  (0)| 00:00:01 |
    Predicate Information (identified by operation id):
      4 - access("CORP"."DOMAIN_NAME"="SHIP_BUY"."DOMAIN_NAME")
      5 - filter("F_GET_POD_RECEIVED_DATE"("SHIP_BUY"."SHIPMENT_GID")<=TO_DATE(' 2013-07-31 00:00:00',
                  'syyyy-mm-dd hh24:mi:ss') AND "SHIP_BUY"."INSERT_DATE">TO_DATE(' 2007-01-01 00:00:00', 'syyyy-mm-dd
                  hh24:mi:ss'))
      6 - access("SHIP_BUY"."USER_DEFINED1_ICON_GID"='ACCEPTED' AND "SHIP_BUY"."DOMAIN_NAME" LIKE
                  'UPS/CP/DFP/%')
          filter("SHIP_BUY"."DOMAIN_NAME" LIKE 'UPS/CP/DFP/%' AND
                  "SHIP_BUY"."USER_DEFINED1_ICON_GID"='ACCEPTED')
      7 - filter("CORP"."IS_DOMAIN_MASTER"='Y' AND "CORP"."DOMAIN_NAME" LIKE 'UPS/CP/DFP/%')
      8 - access("SI"."SHIPMENT_GID"(+)="SHIP_BUY"."SHIPMENT_GID")
      10 - access("CORP"."DOMAIN_NAME"="SHIP_BUY"."DOMAIN_NAME")
      15 - access("INV"."USER_DEFINED1_ICON_GID"='ACCEPTED')
          filter("INV"."USER_DEFINED1_ICON_GID"='ACCEPTED')
      16 - access("SI"."INVOICE_GID"="INV"."INVOICE_GID")
      17 - access("SI"."SHIPMENT_GID"="SHIP_BUY"."SHIPMENT_GID")
          filter("F_GET_POD_RECEIVED_DATE"("SHIP_BUY"."SHIPMENT_GID")<=TO_DATE(' 2013-07-31 00:00:00',
                  'syyyy-mm-dd hh24:mi:ss'))
      18 - filter("SHIP_BUY"."DOMAIN_NAME" LIKE 'UPS/CP/DFP/%' AND "SHIP_BUY"."INSERT_DATE">TO_DATE('
                  2007-01-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
      19 - filter("CORP"."IS_DOMAIN_MASTER"='Y' AND "CORP"."DOMAIN_NAME" LIKE 'UPS/CP/DFP/%')
    Statistics
        246247  recursive calls
              2  db block gets
        1660067  consistent gets
          13839  physical reads
              0  redo size
        592054  bytes sent via SQL*Net to client
          6024  bytes received via SQL*Net from client
            502  SQL*Net roundtrips to/from client
          15296  sorts (memory)
              0  sorts (disk)
          7513  rows processed

    Hmmm...why does this look familiar?
    F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID)  <= to_char(to_date('31-JUL-2013', 'DD-MON-YYYY'), 'dd-mon-yyyy')
    SHIP_BUY.INSERT_DATE > '1-JAN-2007'
    Like I said in your other thread about this, these two lines need to be fixed and your function needs to be fixed so the return statement doesn't do an implicit date conversion.
    Can't you see what that first line is doing?  You're taking a character string, turning it into a date, then back to a character string.
    If nothing else, these lines should be...
    F_GET_POD_RECEIVED_DATE (ship_BUY.SHIPMENT_GID)  <= to_date('31-JUL-2013', 'DD-MON-YYYY')
    SHIP_BUY.INSERT_DATE > to_date('01-JAN-2007','DD-MON-YYYY')
    (assuming insert_date is a proper date format, fingers crossed)

  • Double WINDOW SORT Operation

    Please review following SQL and it's execution plan. Why am I seeing 2 WINDOW SORT operations even though in sql . analytic function "row_number" has been used only once?
    Also, In step 3 of the plan, why "bytes" goes from 35 GB(4th step) to 88GB when row count remains the same. In fact , since I'm selecting just 1st row , both row count as well as "bytes" should have gone down. Shouldn't it?
      SELECT orddtl.ord_dtl_key, orddtl.ld_nbr, orddtl.actv_flg,
             orddtl.ord_nbr
         FROM (SELECT /*+ parallel(od, 8) parallel(sc,8) */  od.ord_dtl_key, od.ld_nbr, od.actv_flg,
                      od.ord_nbr,
                      ROW_NUMBER () OVER (PARTITION BY od.ord_dtl_key, od.START_TS ORDER BY sc.START_TS DESC)
                                                                          rownbr
                 FROM edw.order_detail od LEFT OUTER JOIN edw.srvc_code sc
                      ON (    sc.srvc_cd_key = od.srvc_cd_key
                          AND od.part_nbr = sc.part_nbr
                          AND od.item_cre_dt >= sc.START_TS
                          AND od.item_cre_dt < sc.END_TS
                WHERE od.part_nbr = 11 ) orddtl
        WHERE orddtl.rownbr = 1;Execution Plan
    | Id  | Operation                      | Name              | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     | Pstart| Pstop |    TQ  |IN-OUT| PQ Distrib |
    |   0 | SELECT STATEMENT               |                   |    88M|   121G|       |  2353K (65)| 00:33:07 |       |       |        |      |            |
    |   1 |  PX COORDINATOR                |                   |       |       |       |            |          |       |       |        |      |            |
    |   2 |   PX SEND QC (RANDOM)          | :TQ10002          |    88M|   121G|       |  2353K (65)| 00:33:07 |       |       |  Q1,02 | P->S | QC (RAND)  |
    |*  3 |    VIEW                        |                   |    88M|   121G|       |  2353K (65)| 00:33:07 |       |       |  Q1,02 | PCWP |            |
    |*  4 |     WINDOW SORT PUSHED RANK    |                   |    88M|    35G|    75G|  2353K (65)| 00:33:07 |       |       |  Q1,02 | PCWP |            |
    |   5 |      PX RECEIVE                |                   |    88M|    35G|       |  2353K (65)| 00:33:07 |       |       |  Q1,02 | PCWP |            |
    |   6 |       PX SEND HASH             | :TQ10001          |    88M|    35G|       |  2353K (65)| 00:33:07 |       |       |  Q1,01 | P->P | HASH       |
    |*  7 |        WINDOW CHILD PUSHED RANK|                   |    88M|    35G|       |  2353K (65)| 00:33:07 |       |       |  Q1,01 | PCWP |            |
    |*  8 |         HASH JOIN RIGHT OUTER  |                   |    88M|    35G|       |  1610K (92)| 00:22:39 |       |       |  Q1,01 | PCWP |            |
    |   9 |          PX RECEIVE            |                   |  1133K|    32M|       |  1197  (20)| 00:00:02 |       |       |  Q1,01 | PCWP |            |
    |  10 |           PX SEND BROADCAST    | :TQ10000          |  1133K|    32M|       |  1197  (20)| 00:00:02 |       |       |  Q1,00 | P->P | BROADCAST  |
    |  11 |            PX BLOCK ITERATOR   |                   |  1133K|    32M|       |  1197  (20)| 00:00:02 |   KEY |   KEY |  Q1,00 | PCWC |            |
    |  12 |             TABLE ACCESS FULL  |  SRVC_CODE        |  1133K|    32M|       |  1197  (20)| 00:00:02 |     1 |     1 |  Q1,00 | PCWP |            |
    |  13 |          PX BLOCK ITERATOR     |                   |    88M|    32G|       |   188K (27)| 00:02:39 |   KEY |   KEY |  Q1,01 | PCWC |            |
    |  14 |           TABLE ACCESS FULL    |    ORDER_DETAIL   |    88M|    32G|       |   188K (27)| 00:02:39 |     1 |     1 |  Q1,01 | PCWP |            |
    Predicate Information (identified by operation id):
       3 - filter("orddtl"."rownbr"=1)
       4 - filter(ROW_NUMBER() OVER ( PARTITION BY "od"."ORD_DTL_KEY","od"."START_TS" ORDER BY INTERNAL_FUNCTION("SC"."START_TS"(+))
                  DESC )<=1)
       7 - filter(ROW_NUMBER() OVER ( PARTITION BY "od"."ORD_DTL_KEY","od"."START_TS" ORDER BY INTERNAL_FUNCTION("SC"."START_TS"(+))
                  DESC )<=1)
       8 - access("od"."part_nbr"="SC"."part_nbr"(+) AND "SC"."SRVC_CD_KEY"(+)="od"."SRVC_CD_KEY")
           filter("od"."ITEM_CRE_DT"<"SC"."END_TS"(+) AND "od"."ITEM_CRE_DT">="SC"."START_TS"(+))

    Thanks Jonathan for your reply.
    This type of pattern happens quite frequently in parallel execution with aggregation. A layer of slave processes can do partial aggregation before passing a reduced result set to the query co-ordinator to finish the job.
    I wouldn't be 100% sure without building a model to check, but I think the logic of your quer allows the eight slaves to identify each "rownumber() = 1" for the data set they have collected, and the allows the query coordinator to do the window sort on the eight incoming rows (for each key) and determine which one of the eight is ultimate the highest date.So is it a normal pattern? Will step#7 & #4 do the same amount work as stated in PREDICATE information part of execution plan.?
    You’re correct! There are 8 slave processes appears to be performing WINDOW PUSHED RANK ( Step#7 in Execution Plan ) as you see in following output. Per execution plan and your comment, each one appears to be finding partial set of rows row_num <= 1. It’s apparently doing lots of work and very slow even with 8 processes. So not sure , how slow would be QC doing the same work just by itself.
    And as you see below , it’s [Step#7 ] very slow and half of the slaves performing multi pass sort operation. Even though , it was estimated 35GB for that operation, why it’s estimating work area size of only 6-14MB only? Also, It’s allocating so low amount of PGA than expected. P_A_T was set to approx 11 GB. Currently this was the only query/operation on the Instance.
    Why it’s not allocating more PGA for that operation? [My apologies for diverting from my original question ].
    I have included PGA stats as well here which was taken 5-10 minutes later than other PQ session information. It’s still shows that there is no shortage of PGA.
    Moreover, I have observed this behavior (under allocation of PGA) especially for WINDOWS SORT operations for other SQLs too. Is it normal behavior ? I’m on 10.2.0.4.
    select
    decode(px.qcinst_id,NULL,username,
    ' - '||lower(substr(pp.SERVER_NAME,
    length(pp.SERVER_NAME)-4,4) ) )"Username",
    decode(px.qcinst_id,NULL, 'QC', '(Slave)') "QC/Slave" ,
    to_char( px.server_set) "SlaveSet",
    to_char(s.sid) "SID",
    to_char(px.inst_id) "Slave INST",
    decode(sw.state,'WAITING', 'WAIT', 'NOT WAIT' ) as STATE,
    case  sw.state WHEN 'WAITING' THEN substr(sw.event,1,30) ELSE NULL end as wait_event ,
    to_char(s.ROW_WAIT_OBJ#)  wait_OBID,
    decode(px.qcinst_id, NULL ,to_char(s.sid) ,px.qcsid) "QC SID",
    to_char(px.qcinst_id) "QC INST",
    px.req_degree "Req. DOP",
    px.degree "Actual DOP"
    from gv$px_session px,
    gv$session s ,
    gv$px_process pp,
    gv$session_wait sw
    where px.sid=s.sid (+)
    and px.serial#=s.serial#(+)
    and px.inst_id = s.inst_id(+)
    and px.sid = pp.sid (+)
    and px.serial#=pp.serial#(+)
    and sw.sid = s.sid
    and sw.inst_id = s.inst_id
    order by
      decode(px.QCINST_ID,  NULL, px.INST_ID,  px.QCINST_ID),
      px.QCSID,
      decode(px.SERVER_GROUP, NULL, 0, px.SERVER_GROUP),
      px.SERVER_SET,
      px.INST_ID
    UNAME        QC/Slave SlaveSet SID       Slave INS STATE    WAIT_EVENT                      WAIT_OBID QC SID QC INS Req. DOP Actual DOP
    APPS_ORD     QC                1936      2         WAIT     PX Deq: Execute Reply          71031      1936
    - p006      (Slave)  1        1731      2         WAIT     PX Deq: Execution Msg          71021      1936   2             8          8
    - p007      (Slave)  1        2159      2         WAIT     PX Deq: Execution Msg          71021      1936   2             8          8
    - p002      (Slave)  1        2090      2         WAIT     PX Deq: Execution Msg          71021      1936   2             8          8
    - p005      (Slave)  1        1965      2         WAIT     PX Deq: Execution Msg          71021      1936   2             8          8
    - p001      (Slave)  1        1934      2         WAIT     PX Deq: Execution Msg          71021      1936   2             8          8
    - p004      (Slave)  1        1843      2         WAIT     PX Deq: Execution Msg          71021      1936   2             8          8
    - p000      (Slave)  1        1778      2         WAIT     PX Deq: Execution Msg          71021      1936   2             8          8
    - p003      (Slave)  1        1751      2         WAIT     PX Deq: Execution Msg          71021      1936   2             8          8
    - p009      (Slave)  2        2138      2         NOT WAIT                                71031      1936   2             8          8
    - p012      (Slave)  2        1902      2         NOT WAIT                                71031      1936   2             8          8
    - p008      (Slave)  2        1921      2         NOT WAIT                                71031      1936   2             8          8
    - p013      (Slave)  2        2142      2         NOT WAIT                                71031      1936   2             8          8
    - p015      (Slave)  2        2091      2         NOT WAIT                                71031      1936   2             8          8
    - p014      (Slave)  2        2122      2         NOT WAIT                                71031      1936   2             8          8
    - p010      (Slave)  2        2146      2         NOT WAIT                                71031      1936   2             8          8
    - p011      (Slave)  2        1754      2         NOT WAIT                                71031      1936   2             8          8
    SELECT operation_type AS type                      ,
            workarea_address WADDR,
            operation_id as OP_ID,
            policy                                      ,
            vwa.sql_id,
            vwa.inst_id i#,
            vwa.sid                                     ,
            vwa.qcsid   QCsID,
            vwa.QCINST_ID  QC_I#,
            s.username uname,
            ROUND(active_time    /1000000,2)   AS a_sec ,
            ROUND(work_area_size /1024/1024,2) AS wsize ,
            ROUND(expected_size  /1024/1024,2) AS exp   ,
            ROUND(actual_mem_used/1024/1024,2) AS act   ,
            ROUND(max_mem_used   /1024/1024,2) AS MAX   ,
            number_passes                      AS p#,
            ROUND(tempseg_size/1024/1024,2)    AS temp
    FROM   gv$sql_workarea_active vwa ,
            gv$session s
    where  vwa.sid = s.sid
    and    vwa.inst_id = s.inst_id
    order by vwa.sql_id, operation_id, vwa.inst_id, username, vwa.qcsid
    TYPE            WADDR            OP_ID POLI SQL_ID         I#    SID  QCSID QC_I# UNAME                A_SEC      WSIZE        EXP        ACT        MAX   P#       TEMP
    WINDOW (SORT)   07000003D2B03F90     7 AUTO 8z5s5wdy94ty3   2   2146   1936     2 APPS_ORD            1181.22      13.59      13.59       7.46      90.98    1        320
    WINDOW (SORT)   07000003D2B03F90     7 AUTO 8z5s5wdy94ty3       2142   1936     2 APPS_ORD            1181.07       7.03       7.03       4.02      90.98    0        288
    WINDOW (SORT)   07000003D2B03F90     7 AUTO 8z5s5wdy94ty3       2091   1936     2 APPS_ORD            1181.06       7.03       7.03        4.5      90.98    0        288
    WINDOW (SORT)   07000003D2B03F90     7 AUTO 8z5s5wdy94ty3       1921   1936     2 APPS_ORD            1181.09      13.59      13.59       2.24      90.98    1        320
    WINDOW (SORT)   07000003D2B03F90     7 AUTO 8z5s5wdy94ty3       2138   1936     2 APPS_ORD            1181.16       7.03       7.03       1.34      90.98    0        288
    WINDOW (SORT)   07000003D2B03F90     7 AUTO 8z5s5wdy94ty3       1754   1936     2 APPS_ORD            1181.09      14.06      14.06       5.77      90.98    1        320
    WINDOW (SORT)   07000003D2B03F90     7 AUTO 8z5s5wdy94ty3       2122   1936     2 APPS_ORD            1181.15       6.56       6.56        .24      90.98    0        288
    WINDOW (SORT)   07000003D2B03F90     7 AUTO 8z5s5wdy94ty3       1902   1936     2 APPS_ORD            1181.12      14.06      14.06       9.12      90.98    1        320
    HASH-JOIN       07000003D2B03F28     8 AUTO 8z5s5wdy94ty3       2142   1936     2 APPS_ORD            1183.24      98.64      98.64     100.44     100.44    0
    HASH-JOIN       07000003D2B03F28     8 AUTO 8z5s5wdy94ty3       2138   1936     2 APPS_ORD            1183.24      98.64      98.64     100.44     100.44    0
    HASH-JOIN       07000003D2B03F28     8 AUTO 8z5s5wdy94ty3       2122   1936     2 APPS_ORD            1183.24      98.64      98.64     100.44     100.44    0
    HASH-JOIN       07000003D2B03F28     8 AUTO 8z5s5wdy94ty3       2091   1936     2 APPS_ORD            1183.24      98.64      98.64     100.44     100.44    0
    HASH-JOIN       07000003D2B03F28     8 AUTO 8z5s5wdy94ty3       1921   1936     2 APPS_ORD            1183.24      98.64      98.64     100.44     100.44    0
    HASH-JOIN       07000003D2B03F28     8 AUTO 8z5s5wdy94ty3       1902   1936     2 APPS_ORD            1183.24      98.64      98.64     100.44     100.44    0
    HASH-JOIN       07000003D2B03F28     8 AUTO 8z5s5wdy94ty3       2146   1936     2 APPS_ORD            1183.24      98.64      98.64     100.44     100.44    0
    HASH-JOIN       07000003D2B03F28     8 AUTO 8z5s5wdy94ty3       1754   1936     2 APPS_ORD            1183.24      98.64      98.64     100.44     100.44    0
                                                              sum                                                872.07            838.21
    PGA Stats – taken 5-10 minutes later than above.
    select name, decode(unit,'bytes',round(value/1048576,2)||' MB', value) value from v$pgastat
    NAME                                               VALUE
    aggregate PGA target parameter                     11264 MB
    aggregate PGA auto target                          9554.7 MB
    global memory bound                                1024 MB
    total PGA inuse                                    902.21 MB
    total PGA allocated                                3449.64 MB
    maximum PGA allocated                              29155.44 MB
    total freeable PGA memory                          2140.56 MB
    process count                                      107
    max processes count                                379
    PGA memory freed back to OS                        77240169.56 MB
    total PGA used for auto workareas                  254.14 MB
    maximum PGA used for auto workareas                22797.02 MB
    total PGA used for manual workareas                0 MB
    maximum PGA used for manual workareas              16.41 MB
    over allocation count                              0
    bytes processed                                    323796668.77 MB
    extra bytes read/written                           183362312.02 MB
    cache hit percentage                               63.84
    recompute count (total)                            2054320
    SELECT
    PGA_TARGET_FOR_ESTIMATE/1048576 ESTMTD_PGA_MB,
       PGA_TARGET_FACTOR PGA_TGT_FCTR,
       ADVICE_STATUS ADV_STS,
       BYTES_PROCESSED/1048576 ESTMTD_MB_PRCD,
       ESTD_EXTRA_BYTES_RW/1048576 ESTMTD_XTRA_MB,
       ESTD_PGA_CACHE_HIT_PERCENTAGE ESTMTD_CHIT_PCT,
       ESTD_OVERALLOC_COUNT O_ALOC_CNT
    FROM V$PGA_TARGET_ADVICE
    ESTMTD_PGA_MB PGA_TGT_FCTR ADV ESTMTD_MB_PRCD ESTMTD_XTRA_MB ESTMTD_CHIT_PCT O_ALOC_CNT
            1,408         .125 ON     362,905,053    774,927,577              32      19973
            2,816          .25 ON     362,905,053    571,453,995              39        709
            5,632           .5 ON     362,905,053    249,201,001              59          5
            8,448          .75 ON     362,905,053    216,717,381              63          0
           11,264            1 ON     362,905,053    158,762,256              70          0
           13,517          1.2 ON     362,905,053    153,025,642              70          0
           15,770          1.4 ON     362,905,053    153,022,337              70          0
           18,022          1.6 ON     362,905,053    153,022,337              70          0
           20,275          1.8 ON     362,905,053    153,022,337              70          0
           22,528            2 ON     362,905,053    153,022,337              70          0
           33,792            3 ON     362,905,053    153,022,337              70          0
           45,056            4 ON     362,905,053    153,022,337              70          0
           67,584            6 ON     362,905,053    153,022,337              70          0
           90,112            8 ON     362,905,053    153,022,337              70          0

  • Qosmio F50-125 - How to use TV-FM Tuner in Windows 7

    Hello,
    I am using Qosmio F50-125 and I just upgraded to Windows 7.
    I just now found out that I have a TV tuner on my notebook and I dont know how to use it.
    First I dont have drivers for my TV tuner and tried to download something like TV-tuner driver v.2.3.3.31 from the toshiba website, but there is not a typical setup.exe but just some files inside.
    If you could tell me a bit more about how to use my TV option and how to install the proper drivers I would be truly grateful.
    Thanks in advance!

    Hi mate,
    Friend of me has also Qosmio F50 with TV Tuner and Windows 7 now. As far as I know the posted instructions from the other users are correct.
    First you have to extract all files. Then go in device manager and right click on the TV card (I think its marked with yellow exclamation mark). If you right click choose Update Driver and in next windows choose the advanced installation (second point). Now you have to choose the driver directory yourself and navigate to the folder where you have extracted the files. Click on OK, Next, etc. and the driver should be installed properly.
    Maybe you to restart the notebook but this shouldnt be a problem! ;)
    If you have more questions, please let us know! If you need more assistance I can ask my friend again for further details.

  • I can't open I tunes in Windows Vista "The procedure entry point ADAadPolicyEngine_DidEnterstation could not be located in the dynamic link library iADCore.dll

    I can't open I tunes in Windows Vista " I am recieving a entry point error. How do I get I tunes to open in Windows Vista with an error message 127?

    See iTunes launch errors caused by iAdCore.dll.
    Review the rest of the user tip if required.
    tt2

  • I-Tunes for  Windows with  Lame

    How about not using the I-Tunes for Windows MP3 encoder, and encoding with Lame ? Is this possible ? From where can I get the plug-in ? does it really work ? Pros and Cons ?
    Thanks for the comments
    Elvert

    Thanks Joe for your help. I will check back. I would like to rip with I-Tunes for Windows and encode with the Lame plug-in ( it seems it is available only for Mac). I know EAC is excellent in Secure Mode, but it comes with Freedb (no composer tag info) and not CDDB/Gracenote that comes with I-Tunes and shows composer tag. The composer tag is of extreme importance to me when ripping my Jazz cds.
    suse Lame, but not EAC. Eac uses freedb and not CDDB/GRacenote. I

  • I tunes for windows xp 6d bit

    i want i tunes for windows xp 6d bit
    Regards
    Sunil.

    There is no version of iTunes that supports the 64-bit version of Windows XP and never will be. If you search this forum for "XP 64"or do a web search for something like "iTunes Windows XP 64",  you'll find threads describing the process some people have used to "crowbar" iTunes onto XP 64, with varying levels of success, none of them complete.  
    Regards.

  • Significant difference in response times for same query running on Windows client vs database server

    I have a query which is taking a long time to return the results using the Oracle client.
    When I run this query on our database server (Unix/Solaris) it completes in 80 seconds.
    When I run the same query on a Windows client it completes in 47 minutes.
    Ideally I would like to get a response time equivalent on the Windows client to what I get when running this on the database server.
    In both cases the query plans are the same.
    The query and plan is shown below :
    {code}
    SQL> explain plan
      2  set statement_id = 'SLOW'
      3  for
      4  SELECT DISTINCT /*+ FIRST_ROWS(503) */ objecttype.id_object
      5  FROM documents objecttype WHERE objecttype.id_type_definition = 'duotA9'
      6  ;
    Explained.
    SQL> select * from table(dbms_xplan.display('PLAN_TABLE','SLOW','TYPICAL'));
    PLAN_TABLE_OUTPUT
    | Id  | Operation          | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)|
    |   0 | SELECT STATEMENT   |           |  2852K|    46M|       | 69851   (1)|
    |   1 |  HASH UNIQUE       |           |  2852K|    46M|   153M| 69851   (1)|
    |*  2 |   TABLE ACCESS FULL| DOCUMENTS |  2852K|    46M|       | 54063   (1)|
    {code}
    Are there are configuration changes that can be done on the Oracle client or database to improve the response times for the query when it is running from the client?
    The version on the database server is 10.2.0.1.0
    The version of the oracle client is also 10.2.0.1.0
    I am happy to provide any further information if required.
    Thank you in advance.

    I have a query which is taking a long time to return the results using the Oracle client.
    When I run this query on our database server (Unix/Solaris) it completes in 80 seconds.
    When I run the same query on a Windows client it completes in 47 minutes.
    There are NO queries that 'run' on a client. Queries ALWAYS run within the database server.
    A client can choose when to FETCH query results. In sql developer (or toad) I can choose to get 10 rows at a time. Until I choose to get the next set of 10 rows NO rows will be returned from the server to the client; That query might NEVER complete.
    You may get the same results depending on the client you are using. Post your question in a forum for whatever client you are using.

  • I-tunes for Windows XP Professional x64

    I tried a lot to find out i-tunes for Windows XP Professional x64 bit
    but i didn't get any solution for installing i-tunes in my laptop which had Windows XP Professional x64 bit.
    when i asked to other person then at last i found only one reply that,
    "If i want to install i-tunes in my laptop then i has to CHANGE OPERATING SYSTEM

    iTunes is a 32 bit program.
    The 64 bit installer has 64 bit drivers for burning and the iPhone.
    If you don't have an iPhone you should be able to install the 32 bit iTunes and then download the 64 bit Gear drivers for burning from the Gear download site:
    http://www.gearsoftware.com/support/drivers.cfm
    You may need to enable scripts if you are using Firefox with Noscript.
    If you have an iphone and want to try to get the 64 bit installer to work here are some links that may help:
    http://yukichigai.googlepages.com/iphonex64
    http://pctech.invisibill.net/?page_id=36
    http://skunkwerks.wordpress.com/2008/04/13/getting-itunes-to-work-with-windows-x p-x64/

  • Hp Pavilion dv6120ca with Hp ExpressCard Digital/Analog TV Tuner in Windows 7 32bit, will not record

    I have a Pavilion dv6120ca notebook with the HP ExpressCard D/A TV Tuner running Windows 7 - 32bit
    All installs and works fine except that it will not record with either Windows media center or HP quick Play.
    Can anyone help

    An update from my original question;
    I have now got the tv tuner to record with quickplay, but still unable to record using Windows Media Center

  • Iv just done update for i phone 5 of 7.03 and my phone has froze with i tunes on screen only tried re booting , tried updating i tunes and windows on my pc anyone else out there same prob? Any answers to the prob poss :) hopefully

    Can any1 help me poss?
    Iv just done the latest update on my i phone 5 of 7.03
    And my phone has frozen on the screen
    With just logo of i tunes
    Tried re booting
    Tried updating i tunes and windows on pc
    And to no avail NO PHONE STILL
    OMG. I had nothing but probs since the 7 update
    With my i pad and phone and blue tooth in car also
    AT LEAST AT THE MO MY I PAD WORKS
    But seriously this is putting me off buying another r latest
    I phone
    I cant even get the serial number off my phone eva to send the
    Prob to apple on e mail etc
    I am to ring tomoz
    Im expecting poss having to get a new phone
    And LOSE ALL I HAD ON IT
    THIS IS SO NOT RIGHT AT ALL FOR ANY1
    Who has bought i phones etc
    As they ciat enough when u do
    You seriously do not expect this many probs
    Even if they are teething probs with the latest software

    Well the term "hotlined" I have never heard before. In any case many states (like NY) just passed regulatory powers to the State Public Service Commission of which it may be called something different in your state. You could file a complaint with them. Or file a complaint with your state attorney generals office, they also take on wireless providers.
    The problem here is the staff you speak to are poorly trained, in days gone by it took one call to them and they pulled up your account and see the error and had the authority to remove any errors. They did not remove legitimate account actions, but used their heads instead of putting a customer off or worse lying to the customer.
    Its a shame you have to go through what you going through.
    Good Luck

  • TS3212 I'm trying to download i tunes for windows 8 but it will not complete the process?

    I'm trying to download i tunes for windows 8 but it will not complete the process

    does it give you an error message?

  • I have installed and uninstalled i tunes to windows vista several times and i keep getting an error message of no apple support

    I have tried numerous times to install and uninstall i tunes on windows vista and I keep getting an error message of no apple support.  Anyone have a solution to this?

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    The further information area has direct links to the current and recent builds in case you have problems downloading, need to revert to an older version, or want to try the iTunes for Windows (64-bit - for older video cards) release as a workaround for installation or performance issues, or compatibility with QuickTime or third party software.
    Your library should be unaffected by these steps but there are also links to backup and recovery advice should it be needed.
    tt2

  • Trying to update to 10.7 I tunes to windows 7 64 bit and download gets stuck and can't switch it off without crashing computer-pain and frustrating,can anyone at apple help?

    Trying to update to 10.7 I tunes to windows 7 64 bit and download gets stuck and have to crash the computer to stope download window to try other options-it's been the same all week
    Even when I try to download 64bit updated as forums say it gets stuck.
    You would have thought it should be a simple update as usual.
    Any advice
    Thanks,

    I'd first try downloading an installer from the Apple website using a different web browser:
    http://www.apple.com/quicktime/download/
    If you use Firefox instead of IE for the download (or vice versa), do you get a working installer?

  • TS1538 my iphone 5s showing timed out when i access to i tunes on windows 7,pls help me

    my iphone 5s showing timed out when i access to i tunes on windows 7,pls help me

    Try again with your firewall & anti-virus off.

Maybe you are looking for

  • Changing HTML head in RTF template?

    Hello everybody, I have a question concerning RTF templates and BIP's HTML output: Is it possible to add information to the <head> section of HTML pages generated by BI Publisher when creating the RTF template? And if it is, can somebody tell me how

  • Garbled order when photos transferred to IPhone

    I have a file of photos on my computer which are viewed sequentially in name order - topic 1.jpg, topic 2.jpg, etc. They transfer fine to the IPhone, but the order is garbled so the slide show on the IPhone doesn't show in the correct sequence. How c

  • Hyperion OLAP model vs. Oracle OLAP

    Hi, I have a question re: how to properly model stuff in Hyperion OLAP. I know the basics of Essbase, but I've never found out how to do this... In Oracle OLAP, I can define a set of dimensions, and then create cubes that use any subset of those dime

  • Premiere CC 2014 handles HDV drop frames differently from CC?

    In working with several HDV clips with drop frames, I come to notice that what used to play fine in Premiere CC now have audio out of sync in CC 2014. Is anyone facing the same situation?

  • SAP PS ( Assembley )

    Guys I am novice in SAP PS  , Need Help can you please advice how to access this information from my  SAP Server , Appreciate your response Assembly Processing 1) Need a List of all materials that are impacted by assembly processing  ( Strategy group