Sort Operation in Collections

Hi All,
Can any one please explain where and why SORT operation will performed while executing below code?
PROCEDURE process_all_rows
IS
TYPE employees_aat IS TABLE OF employees%ROWTYPE INDEX BY PLS_INTEGER;
l_employees employees_aat;
BEGIN
SELECT * BULK COLLECT INTO l_employees FROM employees;
FOR index IN 1 .. l_employees.COUNT
LOOP
analyze_compensation
(l_employees(indx));
END LOOP;
END process_all_rows;
The code from below link:
http://www.oracle.com/technetwork/issue-archive/2008/08-mar/o28plsql-095155.html
Thanks in advance.

Red Penyon wrote:
An associative array (formerly called PL/SQL table or index-by table) is a set of key-value pairs. Each key is a unique index, used to locate the associated value with the syntax variable_name(index).
The data type of index can be either a string type or PLS_INTEGER. Indexes are stored in sort order, not creation order. For string types, sort order is determined by the initialization parameters NLS_SORT and NLS_COMP.So then associative arrays with name-value pairs where the name is numeric, are not sorted? Why would an associative array indexed by number not be sorted?

Similar Messages

  • 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

  • Buffer(sort) operator

    Hi,
    i'm trying to understand what "buffer sort" operation is in the following explain plan:
    0 SELECT STATEMENT
    -1 MERGE JOIN CARTESIAN
    --2 TABLE ACCESS FULL PLAYS
    --3 BUFFER SORT
    ---4 TABLE ACCESS FULL MOVIE
    In Oracle 9i DataBase Performance Guide and Reference, "buffer sort" is not mentioned although all other explain plan's operations are.
    What does it mean? Does it take place in main memory or is it an external sort?
    Thank you.

    A BUFFER SORT typically means that Oracle reads data blocks into private memory,because the block will be accessed multiple times in the context of the SQL statement execution. in other words, Oracle sacrifies some extra memory to
    reduce the overhead of accessing blocks multiple times in shared memory.
    Hope this will clear your doubts.
    Thanks.

  • Confusion in FILTER and SORT operations in the execution plan

    Hi
    I have been working on tuning of a sql query:
    SELECT SUM(DECODE(CR_FLG, 'C', NVL(TOT_AMT, 0), 0)),
           SUM(DECODE(CR_FLG, 'C', 1, 0)),
           SUM(DECODE(CR_FLG, 'R', NVL(TOT_AMT, 0), 0)),
           SUM(DECODE(CR_FLG, 'R', 1, 0)),
           SUM(DECODE(CR_FLG, 'C', NVL(TOT_AMT, 0), -1 * NVL(TOT_AMT, 0))),
           SUM(1)
         FROM TS_TEST
        WHERE SMY_DT BETWEEN TO_DATE(:1, 'DD-MM-YYYY') AND
           TO_DATE(:1, 'DD-MM-YYYY');Table TS_TEST is range partitioned on smy_dt and there is an index on smy_dt column. Explain plan of the query is:
    SQL> explain plan for  SELECT SUM(DECODE(CR_FLG, 'C', NVL(TOT_AMT, 0), 0)),
      2         SUM(DECODE(CR_FLG, 'C', 1, 0)),
      3         SUM(DECODE(CR_FLG, 'R', NVL(TOT_AMT, 0), 0)),
      4         SUM(DECODE(CR_FLG, 'R', 1, 0)),
      5         SUM(DECODE(CR_FLG, 'C', NVL(TOT_AMT, 0), -1 * NVL(TOT_AMT, 0))),
      6         SUM(1)
      7    FROM TS_TEST
      8   WHERE SMY_DT BETWEEN TO_DATE(:1, 'DD-MM-YYYY') AND
      9         TO_DATE(:1, 'DD-MM-YYYY');
    Explained.
    SQL> @E
    PLAN_TABLE_OUTPUT
    Plan hash value: 766961720
    | Id  | Operation                            | Name                | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT                     |                     |     1 |    14 | 15614   (1)| 00:03:08 |       |       |
    |   1 |  SORT AGGREGATE                      |                     |     1 |    14 |            |             |       |       |
    |*  2 |   FILTER                             |                     |       |       |            |          |       |       |
    |   3 |    TABLE ACCESS BY GLOBAL INDEX ROWID| T_TEST             | 79772 |  1090K| 15614   (1)| 00:03:08 | ROWID | ROWID |
    |*  4 |     INDEX RANGE SCAN                 | I_SMY_DT         |   143K|       |   442   (1)| 00:00:06 |       |       |
    Predicate Information (identified by operation id):
       2 - filter(TO_DATE(:1,'DD-MM-YYYY')<=TO_DATE(:1,'DD-MM-YYYY'))
       4 - access("SMY_DT">=TO_DATE(:1,'DD-MM-YYYY') AND "SMY_DT"<=TO_DATE(:1,'DD-MM-YYYY'))
    17 rows selected.
    SQL>I am not able to understand the FILTER & SORT operations. As there is an index on SMY_DT column, so index range scan is fine. But why a FILTER (Step no 2) and SORT (Step no 1) operation after that ?
    Oracle version is 10.2.0.3 on AIX 5.3 64 bit.
    Any other information required please let me know.
    Regards,
    Amardeep Sidhu

    Sort aggregate tells you that there was performed an aggregate operation which returns one row, in opposite to sort order by or hash group by which indicates you have grouping, and there more than one row can be returned.
    SQL> SELECT SUM(comm) FROM emp;
    SUM(COMM)
          2200
    Plan wykonywania
    Plan hash value: 2083865914
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |     2 |     3   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE    |      |     1 |     2 |            |          |
    |   2 |   TABLE ACCESS FULL| EMP  |    14 |    28 |     3   (0)| 00:00:01 |
    SQL> SELECT AVG(comm) FROM emp;
    AVG(COMM)
           550
    Plan wykonywania
    Plan hash value: 2083865914
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |     2 |     3   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE    |      |     1 |     2 |            |          |
    |   2 |   TABLE ACCESS FULL| EMP  |    14 |    28 |     3   (0)| 00:00:01 |
    SQL> SELECT MIN(comm) FROM emp;
    MIN(COMM)
             0
    Plan wykonywania
    Plan hash value: 2083865914
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |     2 |     3   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE    |      |     1 |     2 |            |          |
    |   2 |   TABLE ACCESS FULL| EMP  |    14 |    28 |     3   (0)| 00:00:01 |
    SQL> SELECT deptno, SUM(comm) FROM emp GROUP BY deptno;
        DEPTNO  SUM(COMM)
            30       2200
            20
            10
    Plan wykonywania
    Plan hash value: 4067220884
    | Id  | Operation          | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     3 |    15 |     4  (25)| 00:00:01 |
    |   1 |  HASH GROUP BY     |      |     3 |    15 |     4  (25)| 00:00:01 |
    |   2 |   TABLE ACCESS FULL| EMP  |    14 |    70 |     3   (0)| 00:00:01 |
    SQL>Edited by: Łukasz Mastalerz on Jan 14, 2009 11:41 AM

  • Losing manual sort in Bridge collections

    I installed the latest version of Bridge CC and created several collections. Each collection contains between 10 and 60 images which are all taken from the same Windows directory. The directory contains less than 300 image files. I did this in two sessions. In the first, I created 3 collections and in the second, I created 5 more. Each collection was manually sorted after all the images were added. No additional images were added after the manual sort.
    After restarting Windows and opening Bridge CC again, some collections were still manually sorted and some were sorted by filename. All the collections are still showing as manual sort. Can't figure out why some are OK but others are in filename order even though it shows manual sort.
    I'm running on Window 8 Pro and have InDesign installed as well. Bridge is not set to start at login.
    Now, the only thing I can think of is that when I updated InDesign in Adobe CC this morning, that something may have affected Bridge. But then I would have expected all the collections to revert to filename order and not just some.
    Is there a secret to keeping the manual sort in Bridge collections intact? It's not much use to me if it won't. I sort images in the order I want to insert them in book pages.
    I checked other threads on this subject but it doesn't look like anything was resolved.
    Thanks

    DUUUUUUUDE! IT'S WORKING NOW!!!!
    When you originally asked, "What happens if you click on an image and move it to another folder?", I didn't really understand what you were talking about because I almost never have my workspace set up in a way that the folders are showing. I always hide them. So I didn't really understand what you were saying. Just a few minutes ago, I realized that that is what you were asking so I opened up the folder area and tried dragging thumbs into different folders and saw that it does work.
    So then, because of you mentioning that blue line and me know that I did see the blue line on occasion. I went back over into the thumbnails to find out if I always got the blue line or if it was a hit or miss thing. I couldn't believe my eyes when all of the sudden I saw that I no longer was getting that circle with the line through it, and low and behold, the thumbnail dropped right into position like it is supposed to!!!!
    The thing is, I don't know what I've learned from this. I thought, "well, what is different?" The only thing that I can think of is that I now have the folders showing in my workspace so I wondered if that was the secret but I just now hid the folders again like I usually do and the drag and drop into position is STILL WORKING!!!
    All I can figure is that somehow, dragging and dropping a thumbnail into a folder like that for the first time, triggered something so that I can now drag and drop among the thumbnail positions? Not sure. All I know is that for some reason, IT'S WORKING NOW!
    Now, for the second important part, I wonder if I drag and drop everything into the order that I want and then select all of the files and drag them into a new folder, will they stay in that order? I need to go experiment with that.
    If you hadn't kept at it and in turn had me keep trying stuff, it would have never happened because I had pretty much given up.
    Thanks Curt!
    You da man!!!

  • Swap, temporary tablespace and sort operations

    Hello.
    I have an Oracle 8.1.7 on Linux RH7.1. I see a very interesting situation: when users begin to execute large selects with many sorts operation swapping grows, but temporary tablespace does'nt grow. As I know, when Oracle has no memory to use as "sort_area_size" it uses temporary tablespace. But looks like that when Oracle ask for memory Linux begin to swap (in order to give memory for Oracle). I mean that Oracle don't use temporary tablespace but use swap instead of it. Is it true? Is it problem? Is it Oracle, Linux or my own configuration bug? Is it better to use swap or to use temporary tablespace? What is faster?
    Thanx for all advises and ideas. ANd sorry for pure English

    login to your database as DBA (SYS AS SYSDBA) and issue the following query:
    SQL> select name, value from v$parameter where name = 'sga_max_size' ;
    see the value defined for this parameter. If this is larger than what you have configured as your SGA size,
    Oracle will assume that it can expand the SGA to "sga_max_size" value, and will try to expand the SGA when
    required. This will result in Oracle asking more memory from the linux kernel and then linux starts to use
    the swap space.
    Try changing the value of this parameter and see if it helps.

  • Is max function will carry sort operation..?

    Hi friends,
    Is the max function will perform sort operation in temporary
    segments..? Please list the set of operations that will take
    place for the following Query (Apart from Syntax & Fetching the
    data).
    Ex:
    delete from tab1 p1
    where p1.rowid < (select max(p2.rowid)
         from tab1 p2 where
         p1.c1 = p2.c2);
    Regards,
    G. Rajakumar.

    you can get that information using explain plan command.
    DELETE STATEMENT
    DELETE TAB1
    FILTER
    TABLE ACCESS FULL TAB1
    SORT AGGREGATE TAB1
    TABLE ACCESS FULL TAB1

  • Sort method in collections

    Anyone able to tell me if i can use the sort method on a hashmap.Please

    Ok could you please tell me how i call the sort
    method?
    I know i pass the name of ArrayList into the sort
    method.
    Collections.sort(theList) ;Kaj

  • Why Sort operation on clustered columstore index insert?

    Looking at the execution plan for a clustered columnstore index insert I noticed a Sort operation. My T-SQL has no sort and I understand that the clustered columnstore is not a sorted index. Why would there be a Sort operation in the execution plan?
    This is running on:
    Microsoft SQL Server 2014 - 12.0.2000.8 (X64)
     Feb 20 2014 20:04:26
     Copyright (c) Microsoft Corporation
     Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hypervisor)

    Hello,
    It's because how a columnstore index works: The index is created & compressed on column Level, not on row level. SQL Server orders the data to have the same data after each other to calculate the compressed index values.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Group By, Sort operation on pl/sql collection

    Hi,
    Is it possible to do a group by or a order by operation on a pl/sql table of records?
    Thanks,
    Ashish

    If you are building your cllection from a database then why dont you SORT in the SQL that you use toget data from the database. If that dose not help then this link will help you.
    sort data of pl/sql table
    Thanks

  • Using JavaScript need to Sort subsite site collection based on date in descending order

    Hi,
    Below is my code, where i need to sort the " webCollection
    = web.getSubwebsForCurrentUser(null)" web collection based on the web.get_created() in
    descending order. How could i do it any suggestions. Also i need it in JavaScript.
    <script src="/_layouts/15/sp.runtime.js" type="text/javascript"></script>
    <script src="/_layouts/15/SP.js"></script>
    <script type="text/javascript">
    var context = SP.ClientContext.get_current();
    var web = context.get_web();
    ExecuteOrDelayUntilScriptLoaded(getWebProperties, "sp.js");
        function getWebProperties() {
                    webCollection = web.getSubwebsForCurrentUser(null);
            context.load(webCollection)
            //ctx.load(this.web);
            context.executeQueryAsync(Function.createDelegate(this, this.onSuccess),
                Function.createDelegate(this, this.onFail));
        function onSuccess(sender, args) {
            //alert('web title:' + this.web.get_title() + '\n ID:' + this.web.get_id()
    + '\n Created Date:' + this.web.get_created());
            alert("Number of sites: " + webCollection.get_count());
                   var webEnumerator = webCollection.getEnumerator();
                    while (webEnumerator.moveNext()){
       var web = webEnumerator.get_current();
      alert("Title="+web.get_title() +"\n"+ "Created="+web.get_created());
        function onFail(sender, args) {
            alert('failed to get list. Error:'+args.get_message());
    //getWebProperties();
    </script>
    Thanks!
    MCTS- Please vote and mark posts as answered where appropriate.

    Hi,
    According to your post, my understanding is that you wanted to sort the subsite based on the date in descending order.
    You can refer to the following code snippets, it sorts the subsites by the date in descending order.
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    // When the body is loaded, the onload event handler executes each function whose name is contained in this array.
    _spBodyOnLoadFunctionNames.push("callCSOM");
    function callCSOM()
    $("#Button1").click(function()
    ExecuteOrDelayUntilScriptLoaded(RetriveSites, "sp.js");
    var currentcontext = null;
    var currentweb = null;
    function RetriveSites()
    currentcontext = new SP.ClientContext.get_current();
    currentweb = currentcontext.get_web();
    this.subsites = currentweb.get_webs();
    currentcontext.load(this.subsites);
    currentcontext.executeQueryAsync(Function.createDelegate(this, this.ExecuteOnSuccess),
    Function.createDelegate(this, this.ExecuteOnFailure));
    function ExecuteOnSuccess(sender, args)
    var subsites = '';
    var enum1 = this.subsites.getEnumerator();
    var siteCreatedTime = '';
    var array=new Array();
    while (enum1.moveNext())
    var site = enum1.get_current();
    array.push(new Array(site.get_created(),site.get_title()));
    alert(array);
    array=sortMethod(array);
    alert(array);
    function sortMethod(arr) {
    var i, j, stop, len = arr.length;
    for (i=0; i<len; i=i+1)
    for (j=1;j<len - i; j++)
    // change the "<" to ">" would be sort by the Ascending.
    if (new Date(arr[j-1][0]) < new Date(arr[j][0]))
    //swap(j, j+1);
    var temp = arr[j-1];
    arr[j-1] = arr[j];
    arr[j] = temp;
    //alert(new Date(arr[j]));
    return arr;
    function ExecuteOnFailure(sender, args) {
    alert("error");
    </script>
    <input id="Button1" type="button" value="Run Code"/>
    Results:
    Sort before:
    Sort after:
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected].
    Jason Guo
    TechNet Community Support

  • Sort operations in several orders

    I have a requirement for a report where I could list all the operations for a revision.
    The user wants to be able to sort these operations to be able to perform the maintenance in the right order. One idea was to use the sort term on the operation but then the user has to go in on each and every order and then to the operation and then update the field.
    Any ideas on how to solve this?
    Has anyone had any similar requirements?

    Hi Kristoffer,
    ' I have a requirement for a report where I could list all the operations for a revision. '
    The Revision Selection field in General/Administration Tab of Tcode IW37n , is giving the desired results. Isn't this the requirement?
    See this picture.
    Jogeswara Rao K

  • Showing sort icons without applying sort to the collection in AdvancedDataGrid

    Hi All,
    We have a scenario in our application where all the sorting has to be handled by the web services and the client just needs to show the sorted data in an Advanced Data Grid.
    The web services though returns details for the column on which it is being sorted and also the sort order i.e. ASC or DESC. So based on the same we need to simply show a ASC or DESC icon on the specified column header.
    We tried different options, but it seems the sort icons only show up when sorting is actually applied to the collection. But since the sorting is to be dealt with from the web services, it is not possible to apply sorting on the client side as it may result is differentiating data.
    So, can anyone please suggest a solution for this.
    Thanks,
    Eshaan

    Hi All,
    We have a scenario in our application where all the sorting has to be handled by the web services and the client just needs to show the sorted data in an Advanced Data Grid.
    The web services though returns details for the column on which it is being sorted and also the sort order i.e. ASC or DESC. So based on the same we need to simply show a ASC or DESC icon on the specified column header.
    We tried different options, but it seems the sort icons only show up when sorting is actually applied to the collection. But since the sorting is to be dealt with from the web services, it is not possible to apply sorting on the client side as it may result is differentiating data.
    So, can anyone please suggest a solution for this.
    Thanks,
    Eshaan

  • Images sorted in collections are gone

    It happened to us already several times that images we sorted into different collections suddenly do not longer belong to the collection. E.g. a collection containing about 125 images on one day does only contain 20 images on the next day. All others are gone (not deleted, but they do not longer belong to the collection) and there is no way to get them back to the collection but to sort them manually again.
    Why does this happen and how can we avoid it? It happened to different collegues already (on different computers - all using Adobe CS5.5)
    I hope to get an answer to that soon. We love the collection function but if it does not work correctly, there is no use for us...
    Thanks and greetings from Berlin!
    Claudia

    There was an old thread about this issue here:
    http://forums.adobe.com/message/3374043
    comment #19 clearly explains that CS5 Bridge when making the .filelist file for the Collection does not automatically change any apostrophes to %27 like CS4 Bridge would (similarly blank spaces get converted to %20 in CS5 just like CS4). 
    This bug was reported over a year ago and seems to be a simple fix - put back in the feature from CS4 that changed any single quote in paths of the images to %27 - How about it Adobe? I am working off of a server and can not change old folder filenames that contain the offending apostrophe.

  • Collections.sort()

    HI all
    I am re-writing a program which I wrote earlier which takes a list
    1 Joanne Smith and Lionel Brown
    2 Augustus Belcher
    3 Fatima Bacon and Gaynor White
    4 Celina Simmons and Rupert Rodgers-Smythe
    5 Ahmed Hussain
    6 Samuel Peacock and Sarah Peacock
    7 Hsin Cheng Liu
    8 Blanche Peacock and Harry Peacock
    and outputs
    1 Joanne Smith and Lionel Brown
    3 Fatima Bacon and Gaynor White
    5 Ahmed Hussain
    7 Hsin Cheng Liu
    8 Blanche Peacock and Harry Peacock
    6 Samuel Peacock and Sarah Peacock
    4 Celina Simmons and Rupert Rodgers-Smythe
    2 Augustus Belcher
    My brief is
    Create a class called DeliveryHouseDetails, which is Comparable with itself. This will
    store a house number in an instance variable, and the person name details in another. It
    will have an accessor method to obtain the person names. It will also have another in-
    stance method, compareTo(), which orders DeliveryHouseDetails objects by delivery
    order.
    Copy your StreetOrder class from the previous version, and modify it so that it creates a
    DeliveryHouseDetails object for each input line and stores it in the ArrayList. You can
    simply count the lines to obtain the house number ? there is no need to extract it from the details
    on the line. After loading the details the program will use sort() from the Collections class
    to sort them, then it can print them out by looping through them all, and extracting the person
    details.
    My code thus far
    public class DeliveryHouseDetails<ArrayType extends Comparable<ArrayType>>
       private int houseNumber;
       private String nameDetails;
       public DeliveryHouseDetails(String requiredNameDetails)
        nameDetails = requiredNameDetails;
      }//constructor
      public String getNamesDetails()
        return nameDetails;
      public int compareTo(int other)
        if((houseNumber % 2 == 1)&&(other % 2 ==1))
          return houseNumber - other;
        else if((houseNumber % 2 == 0)&& (other % 2 == 0))
          return (other - houseNumber);
        else if(houseNumber % 2 ==1)
          return -1;
        else
          return -1;
      public boolean equals(Object other)
        if (this.equals(other))
          return houseNumber == ((DeliveryHouseDetails)other).houseNumber;
        else
          return super.equals(other);
    import java.io.BufferedReader;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.PrintWriter;
    import java.util.ArrayList;
    import java.util.Collections;
    import java.io.IOException;
    import java.io.FileNotFoundException;
    public class StreetOrderA
      public static void main(String [] args)
        String inputFileName = args[0];
        String outputFileName = args[1];
        ArrayList<String> lineList = new ArrayList<String>();
        String line;
        String item;
        try
        BufferedReader in=new BufferedReader(new FileReader(inputFileName));
        PrintWriter out=new PrintWriter(new FileWriter(outputFileName)); 
        if(args.length!=2)
          throw new ArrayIndexOutOfBoundsException("you have supplied"
                                +" the wrong no of arguments");
        while((line = in.readLine()) != null)
            item = new DeliveryHouseDetails(line);
          for(int index =0; index<=lineList.size();index++)
            lineList.add(item);
          Collections.<String>sort(lineList);
          for(int index =0; index<=lineList.size();index++)
            out.println(lineList.get(index));
          in.close();
          out.close();
       catch (FileNotFoundException e)
          System.out.println("Can't find the file, please enter a valid file");
         System.out.println("Exception"+e.getMessage());
           System.err.println(e); 
        catch (IOException e)
          System.err.println(e);
        catch (ArrayIndexOutOfBoundsException e)
          System.out.println("Supply two filenames");
          System.out.println("Exception message"+ e.getMessage());
          System.err.println(e);
    }Any help is appreciated !!
    Edited by: bigdoggy on Apr 6, 2008 12:34 PM

    Hi
    this is my StreetOrder code, updated from earlier but without the import statements and catch statements from before
    public static void main(String [] args)
        String inputFileName = args[0];
        String outputFileName = args[1];
        ArrayList<DeliveryHouseDetails> lineList
          = new ArrayList<DeliveryHouseDetails>();
        String line;
        try
        BufferedReader in=new BufferedReader(new FileReader(inputFileName));
        PrintWriter out=new PrintWriter(new FileWriter(outputFileName));  
        if(args.length!=2)
          throw new ArrayIndexOutOfBoundsException("you have supplied"
                                  +" the wrong no of arguments");
        while((line = in.readLine()) != null)
            DeliveryHouseDetails item = new DeliveryHouseDetails(line);
          for(int index =0; index<=lineList.size();index++)
            lineList.add(item);
          Collections.<String>sort(lineList);
          for(int index =0; index<=lineList.size();index++)
            out.println(lineList.get(index));
          in.close();
          out.close();

Maybe you are looking for

  • Problem with editing in external application

    Hi, I have tried to edit a web page using an external application (TextEdit in Mac) and Contribute allows me to open it by going to File>Actions>Edit Page Source in External Application; but when closing the document in TextEdit and returning to Cont

  • Issue with Mark of the Web, PDFs, and merged WebHelp

    I'm sure this has come up before, but I can't locate the definitive answer. I am using RH8 and have a merged WebHelp system containing a parent projects and 10 or so child projects.  Previously, when I generated the WebHelp projects, I selected the M

  • Linux j2se 1.4.2 INTERNAL ERROR on Browser End: no manager for initializing

    I have just installed j2sdk1.4.2_04 and NetScape 7.1 on Redhat Linux 9. After following the instruction to enable java in the browser by issuing the command: ln -s /usr/java/j2sdk1.4.2_04/jre/plugin/i386/ns610/libjavaplugin_oji . (note the final peri

  • WiFi Card for E2

    When I turn on WiFi on I get an error saying " the card in the SDIO slot is not a palmOne supported WiFicard"  This card worked in the past and it is a Palm WiFi card.  Any clues?? Thank Post relates to: Tungsten T2

  • Crystal reports in R/3

    Hi, Can someone tell me what transaction do we use to write crystal reports in SAP R/3 ? Thanks. Regards, Tushar.