Long run time with ORDER by clause

Hi,
I am having a query which is executing fine(in 2 mins) but when i am using order by clause in it, its taking around 13 mins.
Can anyone suggest what could be th reason and how to execute the same query are get the ordered record?
thanks.

Sorry for not providing complet details.
Database version id 10g.
Below is the execution plan when using with order by clause.
Execution Plan
| Id  | Operation                              | Name              | Rows  | Bytes | Cost  |
|   0 | SELECT STATEMENT                       |                   |     1 |   118 |  1538 |
|   1 |  FILTER                                |                   |       |       |       |
|   2 |   HASH JOIN                            |                   | 16657 |  1089K|    56 |
|   3 |    TABLE ACCESS FULL                   | FILETYP           |     6 |    60 |     3 |
|   4 |    TABLE ACCESS FULL                   | FILETYPSOURCEID   | 16657 |   927K|    52 |
|   5 |   NESTED LOOPS                         |                   |     1 |    35 |     3 |
|   6 |    TABLE ACCESS BY INDEX ROWID         | FILEWAREHOUSE     |     1 |    25 |     2 |
|   7 |     INDEX RANGE SCAN                   | FILEWAREHOUSE_DX2 |     1 |       |     2 |
|   8 |    TABLE ACCESS BY INDEX ROWID         | EXTFILE           |     1 |    10 |     1 |
|   9 |     INDEX UNIQUE SCAN                  | PK_EXTFILE        |     1 |       |     1 |
|  10 |  SORT ORDER BY                         |                   |     1 |   118 |  1538 |
|  11 |   NESTED LOOPS                         |                   |     1 |   118 |  1534 |
|  12 |    NESTED LOOPS OUTER                  |                   |     1 |   100 |  1533 |
|  13 |     NESTED LOOPS OUTER                 |                   |     1 |    96 |  1532 |
|  14 |      NESTED LOOPS                      |                   |     1 |    88 |  1531 |
|  15 |       HASH JOIN                        |                   |     5 |   360 |  1524 |
|  16 |        TABLE ACCESS BY INDEX ROWID     | RTXN              |     1 |    22 |     1 |
|  17 |         NESTED LOOPS                   |                   |   117 |  5148 |  1518 |
|  18 |          VIEW                          | VW_SQ_1           | 20869 |   448K|  1441 |
|  19 |           HASH GROUP BY                |                   | 20869 |   427K|  1441 |
|  20 |            FILTER                      |                   |       |       |       |
|  21 |             TABLE ACCESS BY INDEX ROWID| RTXNSTATHIST      | 20869 |   427K|  1304 |
|  22 |              INDEX RANGE SCAN          | RTXNSTATHIST_DX2  | 20869 |       |    29 |
|  23 |          INDEX RANGE SCAN              | PK_RTXN           |     1 |       |     1 |
|  24 |           NESTED LOOPS                 |                   |     1 |    24 |     3 |
|  25 |            TABLE ACCESS BY INDEX ROWID | FILEWAREHOUSE     |     1 |    14 |     2 |
|  26 |             INDEX RANGE SCAN           | FILEWAREHOUSE_DX2 |     1 |       |     2 |
|  27 |            TABLE ACCESS BY INDEX ROWID | EXTFILE           |     1 |    10 |     1 |
|  28 |             INDEX UNIQUE SCAN          | PK_EXTFILE        |     1 |       |     1 |
|  29 |        TABLE ACCESS FULL               | RTXNTYP           |     1 |    28 |     5 |
|  30 |       TABLE ACCESS BY INDEX ROWID      | RTXNSTATHIST      |     1 |    16 |     2 |
|  31 |        INDEX RANGE SCAN                | PK_RTXNSTATHIST   |     1 |       |     1 |
|  32 |      TABLE ACCESS BY INDEX ROWID       | NTWKNODE          |     1 |     8 |     1 |
|  33 |       INDEX UNIQUE SCAN                | PK_NTWKNODE       |     1 |       |     1 |
|  34 |     INDEX UNIQUE SCAN                  | PK_ORG            |     1 |     4 |     1 |
|  35 |    TABLE ACCESS BY INDEX ROWID         | ACCT              |     1 |    18 |     1 |
|  36 |     INDEX UNIQUE SCAN                  | PK_ACCT           |     1 |       |     1 |
Below is the execution plan when running without ORDER BY clause...
Execution Plan
| Id  | Operation                             | Name              | Rows  | Bytes | Cost  |
|   0 | SELECT STATEMENT                      |                   |     1 |   135 |  1537 |
|   1 |  FILTER                               |                   |       |       |       |
|   2 |   HASH JOIN                           |                   | 16657 |  1089K|    56 |
|   3 |    TABLE ACCESS FULL                  | FILETYP           |     6 |    60 |     3 |
|   4 |    TABLE ACCESS FULL                  | FILETYPSOURCEID   | 16657 |   927K|    52 |
|   5 |   NESTED LOOPS                        |                   |     1 |    35 |     3 |
|   6 |    TABLE ACCESS BY INDEX ROWID        | FILEWAREHOUSE     |     1 |    25 |     2 |
|   7 |     INDEX RANGE SCAN                  | FILEWAREHOUSE_DX2 |     1 |       |     2 |
|   8 |    TABLE ACCESS BY INDEX ROWID        | EXTFILE           |     1 |    10 |     1 |
|   9 |     INDEX UNIQUE SCAN                 | PK_EXTFILE        |     1 |       |     1 |
|  10 |  NESTED LOOPS                         |                   |     1 |   135 |  1534 |
|  11 |   NESTED LOOPS OUTER                  |                   |     1 |   117 |  1533 |
|  12 |    NESTED LOOPS OUTER                 |                   |     1 |   113 |  1532 |
|  13 |     NESTED LOOPS                      |                   |     1 |   105 |  1531 |
|  14 |      HASH JOIN                        |                   |     5 |   445 |  1524 |
|  15 |       TABLE ACCESS FULL               | RTXNTYP           |     1 |    28 |     5 |
|  16 |       TABLE ACCESS BY INDEX ROWID     | RTXN              |     1 |    22 |     1 |
|  17 |        NESTED LOOPS                   |                   |   117 |  7137 |  1518 |
|  18 |         VIEW                          | VW_SQ_1           | 20869 |   794K|  1441 |
|  19 |          HASH GROUP BY                |                   | 20869 |   427K|  1441 |
|  20 |           FILTER                      |                   |       |       |       |
|  21 |            TABLE ACCESS BY INDEX ROWID| RTXNSTATHIST      | 20869 |   427K|  1304 |
|  22 |             INDEX RANGE SCAN          | RTXNSTATHIST_DX2  | 20869 |       |    29 |
|  23 |         INDEX RANGE SCAN              | PK_RTXN           |     1 |       |     1 |
|  24 |          NESTED LOOPS                 |                   |     1 |    24 |     3 |
|  25 |           TABLE ACCESS BY INDEX ROWID | FILEWAREHOUSE     |     1 |    14 |     2 |
|  26 |            INDEX RANGE SCAN           | FILEWAREHOUSE_DX2 |     1 |       |     2 |
|  27 |           TABLE ACCESS BY INDEX ROWID | EXTFILE           |     1 |    10 |     1 |
|  28 |            INDEX UNIQUE SCAN          | PK_EXTFILE        |     1 |       |     1 |
|  29 |      TABLE ACCESS BY INDEX ROWID      | RTXNSTATHIST      |     1 |    16 |     2 |
|  30 |       INDEX RANGE SCAN                | PK_RTXNSTATHIST   |     1 |       |     1 |
|  31 |     TABLE ACCESS BY INDEX ROWID       | NTWKNODE          |     1 |     8 |     1 |
|  32 |      INDEX UNIQUE SCAN                | PK_NTWKNODE       |     1 |       |     1 |
|  33 |    INDEX UNIQUE SCAN                  | PK_ORG            |     1 |     4 |     1 |
|  34 |   TABLE ACCESS BY INDEX ROWID         | ACCT              |     1 |    18 |     1 |
|  35 |    INDEX UNIQUE SCAN                  | PK_ACCT           |     1 |       |     1 |
-------------------------------------------------------------------------------------------Edited by: user10754555 on Feb 5, 2010 6:02 PM

Similar Messages

  • Select statement takes very long to run with order by clause.

    Hi all,
    I have a select statement which when I run without the order by clause takes arround 2 minutes to run. But with the order by clause it goes on for ever. I am trying to access the database server through a network which is not too fast.
    The select statement is based on 9 views which are again based on some views. It also has inline views and outer joins. These views and inline views can not be done away with.
    When selected without the order by clause it gives 3215 records.
    Anything like 2 to 3 minutes will be Ok.
    Thanks.
    --Malay                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    The select statement is as follows :-
    SELECT f.system_name,
    a.signal_type,
    f.sys_signal_name,
    a.bus_desc,
    b.vl_ident,
    b.vl_name,
    b.src_mac,
    b.src_mac_addr,
    b.dest_mac,
    b.dest_mac_addr,
    b.network,
    bb.bufr_size_in_bytes,
    bb.bag_in_ms,
    bb.is_rma_used,
    bb.is_ic_used,
    bb.sub_vl_cnt,
    bb.skew_max_in_ns,
    cc.msg_name,
    c.src_ip,
    c.src_ip_addr,
    c.src_port,
    c.dest_ip,
    c.dest_ip_addr,
    c.dest_port,
    cc.rate_in_ms,
    cc.tx_mode,
    cc.protocol,
    cc.port_type,
    cc.msg_length_in_bytes,
    d.mnemonic,
    d.start_addr32,
    d.lsb,
    d.end_addr32,
    d.msb,
    d.format,
    d.init_value,
    d.fs_mnemonic,
    d.fs_afdx_data_id,
    d.digital_data_id,
    DECODE(
    d.digital_datatype,
    NULL, '',
    'UNUSED', '',
    api$util.concat_column_data(
    'api_'
    || d.digital_datatype,
    'digital_data_id',
    d.digital_data_id,
    bool.FALSE
    ) AS data_details,
    f.connection_id
    || '_'
    || a.digital_bus_id
    || '_'
    || b.afdx_vl_id
    || '_'
    || bb.afdx_output_id
    || '_'
    || c.afdx_frame_id
    || '_'
    || cc.afdx_msg_id
    || '_'
    || d.afdx_data_id AS KEY
    FROM api_afdx a,
    api_afdx_vl b,
    api_afdx_output bb,
    api_afdx_frame c,
    api_afdx_msg cc,
    api_afdx_data d,
    vf_signal e,
    (SELECT DISTINCT aa.signal_id,
    cc.system_name,
    bb.connection_id,
    bb.sys_signal_name
    FROM vf_nodes aa,
    vf_connections bb,
    vf_system cc
    WHERE aa.connection_id = bb.connection_id
    AND bb.system_id = cc.system_id) f
    WHERE e.signal_id = f.signal_id(+)
    AND e.digital_bus_id = a.digital_bus_id
                   AND a.digital_bus_id = bb.digital_bus_id(+)
    AND bb.afdx_output_id = b.afdx_output_id(+)
                   AND b.afdx_vl_id = c.afdx_vl_id(+)
    AND bb.afdx_output_id = cc.afdx_output_id(+)
    AND cc.afdx_msg_id = d.afdx_msg_id(+)
    ORDER BY f.system_name,
    a.signal_type,
    f.sys_signal_name,
    b.vl_name,
    cc.msg_name,
    d.start_addr32,
    d.lsb;
    Where api_afdx ,
    api_afdx_vl ,
    api_afdx_output ,
    api_afdx_frame ,
    api_afdx_msg ,
    api_afdx_data ,
    vf_signal ,
    vf_nodes ,
    vf_connections ,
    vf_system
    are all views.

  • Query with order by clause

    Hi,
    I found a query with order by clause in procedure which is taking long time.
    Stats are upto date.
    Total Rows :650000.
    It is ordered by primary key column.
    select * from table_name order by col1;
    col1 is a primary key.No of cpu's used is 4.
    can anyone suggest me a better solution to improve the performance of a query.
    Is it better to use parallel hint for above scenario.
    Any help really apprecaited.
    Thanks in advance.

    Hi,
    Thanks for ur immediate reply.
    It doesn't have where clause.
    below is the plan
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 619071987
    | Id  | Operation                   | Name                 | Rows  | Bytes | Cos
    |   0 | SELECT STATEMENT            |                      |   671K|   255M| 125
    |   1 |  TABLE ACCESS BY INDEX ROWID| FULL_ITEM_FACILITIES |   671K|   255M| 125
    |   2 |   INDEX FULL SCAN           | FIF_PK               |   671K|       |
    9 rows selected
    Executed in 0.094 secondsThanks in advance
    Edited by: unique on Jun 22, 2009 8:26 AM

  • F4 on Variable Screen for a DataStore Object Produces Long Run Time

    We experiencing a long run time in returning values when we select F4 for the Variable 0COMP_CODE when we process query for a DataStore.  Before our upgrade to NW04S, we did not experience this issue.  As background, the DataStore (ODS) has not changed, the variable has not changed, and the query has not changed.
    0COMP_CODE has the following configuration in RSD1:
    Query Def. Filter Value Selection – Values in Master Data Table
    Query Execution Filter Val. Selectn – Only Posted Values for Navigation.
    These settings are exactly like this in our BW 3.5 system.
    In my review of the differences, I found that in BW 3.5, the runtime is short because the selection that is returned is the Company Codes in the Master Data table, but in NW04S, the selection that is returned is the Company Codes within the ODS. 
    Has anyone experienced this before and if so what was your resolution?
    Thanks!

    <b>Query Execution Filter Val. Selection</b> should help you a lot in improving performance for F4.
    Three options are available for the <b>Query Execution Filter Val. Selection</b> field on the BEx tab that directly affect F4 searches.
    <b>The Only Posted Values for Navigation</b> setting limits an F4 search to the values related to the query’s navigation state. It is the recommended setting if you’re working with less savvy BW end users who may have trouble identifying applicable values or are confused when faced with long lists of characteristics. This setting yields the <b>slowest performance</b> in terms of the F4 search.
    <b>Only Values in InfoProvider</b> is a better option if you need a list of characteristic values for a variable that is limited to the transactional records in the InfoProvider that a query is being executed against. This setting is ideal for restricting users to the appropriate source when data is available in different InfoProviders with different values. For example, let’s say you have an InfoCube with billing data for Europe and another for the US. Each sales office will have different values, so by using this setting a variable can be restricted to the correct values.
    <b>The Values in Master Data Table</b> setting allows users to list all possible characteristic values when they run F4. Recommend that you use it when you have transactional records for almost all the values across InfoProviders and users are aware of the relevance of the values for the navigation state.
    While the Values in Master Data Table setting is the <b>fastest F4</b> search setting, you need to be aware of a couple of situations when using it. Users with authorization restrictions may have an F4 list returned with all the values from the master data table, but a subsequent query may not report the result. Instead it will generate an error message informing the user of the authorization restriction. Likewise, users may select values from the master data table that are not valid for the current query due to other restrictions. There may not be any records for an InfoObject in its underlying InfoProvider designed for a query, so the system returns a “no applicable data found” message.
    <b>Important Notes for F4 - Performance -</b>
    748623 Input help (F4) has a very long runtime—recommendations
    661251 Filter value selection displays too few/too many values
    581802 Variable dialog boxes: performance of the F4 help
    581079 Performance for the F4 help of navigation attributes
    626887 F4 variables and InfoObject settings.
    Hope it Helps
    Chetan
    @CP..

  • Problem with order by clause

    Hai all,
    I have problem with order by clause,
    My query is
    "select number from table1 order by number asc "
    and the output is displaying as
    1
    10
    12
    13
    15
    17
    19
    2
    20
    21
    22
    But if we give order by it should display as below only right ?
    1
    2
    10
    12
    13
    15
    17
    19
    20
    21
    22 ........
    Please help me why it is not displaying like it. and how to make the statement to display like the second case. Thanks in advance.
    Regards,
    Uraja

    The column datatype that you are selecting is not of NUMBER datatype(might be char or varchar2) hence you are getting such result set.
    And for this purpose, it is recommended to set datatype of a column appropriately.
    For now you can add TO_NUMBER function to column in ORDER BY clause, only if it has data of number type.
    Edited by: Ora on 19 Nov, 2012 3:10 AM

  • Default where with order by clause

    Hi all
    How to use Default where with order by clause
    for example i want to use Default_where clause with order by clause
    Regards
    Shahzaib ismail

    Hi,
    I have a similar query for where clause.
    my query-find form is a multi record form like below:
    Criteria - Condition - Value
    Item/Category/Planner (List_Item) - Equals/Among (List_Item) - text_FIELD
    Item - Equals - ITEM_1
    Category - Among - ('CAT1', 'CAT2')
    Planner - Equals - PL1
    Find_BUTTON Clear_BUTTON
    User can select any criteria and condition combination and then enter the value in "Value" text field.
    My query is: how can I prepare a where clause based on user input since the user can enter any number of values/combinations? I guess I would have to use some looping to generate where clause.
    Thanks
    Imran

  • IN clause with ORDER BY clause in sub-queries

    Hello,
    We generate dynamic queries with the following statement pattern (could be many union/intersect sub-queries):
    select my_col
    from my_table
    where my_col IN
    select table_2.my_col , x_col from table_2 where x_col > 10
    UNION
    select table_3.my_col , y_col from table_3 where y_col > 20
    INTERSECT
    select table_4.my_col , z_col from table_4 where z_col is between 30 and 50
    I know that I can do just the sub-queries w/ an ORDER BY clause as follows (as long as the 2nd parameter in the select stmts are of the same type):
    select table_2.my_col , x_col from table_2 where x_col > 10
    UNION
    select table_3.my_col , y_col from table_3 where y_col > 20
    INTERSECT
    select table_4.my_col , z_col from table_4 where z_col is between 30 and 50
    order by 2 desc
    But my questions are:
    1. What is (if there is) the syntax that will ensure that the result set order will be that of the ordering of the sub-queries?
    Or does my SQL stmt have to have syntactically (but not semantically) change to achieve this?
    Thanks,
    Jim

    Randolf Geist wrote:
    just a minor doubt - I think it is not officially supported to have separate ORDER BYs in a compound query with set operators (e.g. UNION / UNION ALL subsets). Of course one could use inline views with NO_MERGE + NO_ELIMINATE_OBY hints, but I think the only officially supported approach is to use a single, final ORDER BY (that needs to use positional notation as far as I remember).
    Randolf,
    You're right, of course, about the separate "order by" clauses.
    Interestingly the following type of thing does work though (in 10.2.0.3, at least):
    with v1 as (
        select * from t1 where col1 = 'ABC' order by col2
    v2 as (
        select * from t1 where col1 = 'DEF' order by col2
    select * from v1
    union all
    select * from v2
    ;A quick check the execution plan suggsts that Oracle appears to be convering this to the following - even though its technically not acceptable in normal circumstances:
    select * from t1 where col1 = 'ABC' order by col2
    union all
    select * from t1 where col1 = 'DEF' order by col2
    ;Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    "Science is more than a body of knowledge; it is a way of thinking"
    Carl Sagan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Oracle query tuning : query with Order-by clause

    Hi
    I am having a query in my database :
    SELECT * FROM SAPR3.HRP1001 WHERE "MANDT" = 990
    ORDER BY
    "MANDT" , "OTYPE" , "OBJID" , "PLVAR" , "RSIGN" , "RELAT" , "ISTAT" , "PRIOX" , "BEGDA" , "ENDDA" ,"VARYF" , "SEQNR" ;
    Autotrace output is :
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=4649 Card=171895 Byt
    es=22862035)
    1 0 SORT (ORDER BY) (Cost=4649 Card=171895 Bytes=22862035)
    2 1 TABLE ACCESS (FULL) OF 'HRP1001' (Cost=1170 Card=171895
    Bytes=22862035)
    Statistics
    0 recursive calls
    5 db block gets
    12157 consistent gets
    11543 physical reads
    0 redo size
    38253080 bytes sent via SQL*Net to client
    376841 bytes received via SQL*Net from client
    34201 SQL*Net roundtrips to/from client
    0 sorts (memory)
    1 sorts (disk)
    512992 rows processed
    Since it is a issue with order by , it seems a PGA memory issue. there is 12GB PGA available but only 3GB gets allocated. pga_aggregate target is set in the DB. There is a index created for al the columns on order by, but it is not getting used.
    pleas suggest me as I am running into major problems, i can post the output of any query u require from my side. Any help wil be highly apprciated.
    Rishi

    > The query was alwasy spilling over to the One-Parse execution . It can be seen thru ST04N ->resource consumption-> sql work area trace.
    >
    > An undocumented oracle parameter smmmax_size was set which allowed for more usage of physical memory by single process and there was no spillover to the TEMP tablespaces.
    >
    > Also the File read time was analysed from Unix level ( From SAP thru ST04 ->filesystem wait s-> Avg rd (ms) and Ang writes (ms) which showed that reading from the File was not happening well. )
    Hi Rishi,
    the provided execution statistics prove the opposite:
    >Statistics
    >...
    >0 sorts (memory)
    > 1 sorts (disk)
    >512992 rows processed
    This indeed was a single-pass sort, which means it had to use the temp tablespace for one pass of the sorting/grouping.
    Remember that Oracle distinguishes three kinds of sorts: 1. "in memory", 2. "single-pass" and 3. "multi-pass".
    Only the first one won't need to spill out data to the disks. The others do this by definition.
    BTW: the file read times in ST04 are aquired through Oracle V$ views and not directly from the OS - that can make a big difference sometimes.
    regards,
    Lars

  • Performance with order by clause

    Dear all,
    please find the below query .if i executed without order by it is going to execute with in 2 sec.if i add order by clause
    it is taking more than 2 min.as per the business we need order by clause .plaese suggest me.it's very urgent.
    SELECT "FACILITY_ID","VESSEL_NAME","CLASS_NUM","SURVEY_REPORT_NO","IMO_NUMBER","VESSEL_TYPE","VESSEL_TYPE_ID","PRIMARY_BUILDER","BUILDER_ID","REGISTER_OWNER","ABS_SURVEY_STATUS_ID","ABS_SURVEY_STATUS_DATE","NOT_ASSIGNED_SINCE","NO_OF_FINDINGS","CASE","SPM_ITM_CAT_NAME","LEAST_CONFIDENCE" FROM (SELECT
    V. FACILITY_ID,
    v.vessel_name,
    v.class_num,
    ASR.SURVEY_REPORT_NO,
    V.IMO_NUMBER,
    V.VESSEL_TYPE,
    v.vessel_type_id,
    V.PRIMARY_BUILDER,
    V.BUILDER_ID,
    V.REGISTER_OWNER,
    ASR.ABS_SURVEY_STATUS_ID,
    ASR.abs_survey_status_date,
    ROUND(SYSDATE - ASR.abs_survey_status_date) AS NOT_ASSIGNED_SINCE,
    (SELECT COUNT(1) FROM ABS_FINDINGS WHERE survey_report_no = asr.survey_report_no AND FIN_TAG_STAT_ID IN( 'TG')) AS no_of_findings,
    CASE WHEN ( SELECT rnum FROM (SELECT survey_report_no,COUNT(rnum) rnum FROM (SELECT a.survey_report_no,COUNT(*) rnum FROM ABS_FINDINGS A,ABS_SURVEY_REPORTS b
         WHERE a.survey_report_no=b.survey_report_no
         GROUP BY a.survey_report_no,spm_item_category) GROUP BY survey_report_no ) WHERE survey_report_no=asr.survey_report_no )=1 THEN
    ( SELECT spm_item_cat_id FROM ABS_FINDINGS WHERE survey_report_no = asr.survey_report_no AND ROWNUM<2)
    ELSE
    5
    END CASE,
    (SELECT SPM_ITM_CAT_NAME FROM SPM_ITEM_CATEGORIES WHERE SPM_ITEM_CAT_ID =
    (CASE WHEN ( SELECT rnum FROM (SELECT survey_report_no,COUNT(rnum) rnum FROM (SELECT a.survey_report_no,COUNT(*) rnum FROM ABS_FINDINGS A,ABS_SURVEY_REPORTS b
         WHERE a.survey_report_no=b.survey_report_no
         GROUP BY a.survey_report_no,spm_item_category) GROUP BY survey_report_no ) WHERE survey_report_no=asr.survey_report_no )=1 THEN
    ( SELECT spm_item_cat_id FROM ABS_FINDINGS WHERE survey_report_no = asr.survey_report_no AND ROWNUM<2)
    ELSE
    5
    END )) AS SPM_ITM_CAT_NAME,
    (SELECT MIN(tag_weight) FROM TAGGED_FINDINGS
              WHERE finding_id IN (SELECT finding_id FROM ABS_FINDINGS WHERE survey_report_no IN (ASR.SURVEY_REPORT_NO))) AS least_confidence
    FROM
    ABS_SURVEY_REPORTS ASR,
    ABS_VESSELS V
    WHERE
    ASR.FACILITY_ID = V.FACILITY_ID
    AND abs_survey_Status_id = 1 ) WHERE no_of_findings>0
    ORDER BY ABS_SURVEY_STATUS_DATE
    Thanks
    venkat

    Please start reading these informative links first:
    HOW TO: Post a SQL statement tuning request - template posting
    When your query takes too long ...
    and then rephrase your question by posting
    - database version
    - execution plans
    - etc. (see the links above)
    Put the tag before and after your examples, so it'll stay formatted.
    See: http://forums.oracle.com/forums/help.jspa                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Why do I get lots of noise in my photos on the D30 at long exposure times with 100 ISO speed? Help!

    So I'm using a Canon D30 (3.1 megapixel). My ISO speed is set to 100, but when take phots at very slow shutter speeds I get a lot of noise. And I mean a lot. Can anybody help?

    Long exposure time is the 2nd main way to get noise in an image.  Not a lot you can do other than post processing.  How long an exposure?  Perhaps a compromise like ISO 200 and a shutter that is half as long (twice as fast) would be slightly better if you played around with it.  Or perhaps that would be even worse.
    Scott
    Canon 6D, Canon T3i, EF 70-200mm L f/2.8 IS mk2; EF 24-105 f/4 L; EF-S 17-55mm f/2.8 IS; EF 85mm f/1.8; Sigma 35mm f/1.4 "Art"; EF 1.4x extender mk. 3; 3x Phottix Mitros+ speedlites
    Why do so many people say "fer-tographer"? Do they take "fertographs"?

  • Problems bundling visa run time with installer

    I am trying to build an installer for an application that makes VISA read/writes through a serial port.  I have tried to create an installer for this application but I keep getting a cryptic error that then terminates LV.  I am experiencing the same problem as described in this thread:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=228510&query.id=494979#M228510
    I am developing with LV8.2 on XP SP2.  I would like to bundle the VISA Run Time so that I can communicate via VISA R/Ws.  After reading the above mentioned thread it didn't seem like there was ever a real resolution to the problem.  I am bundling the VISA Run Time engine just fine with other projects and I have deleted and started over several times with the installer inside this project, but I keep getting the same error, see attached document. 
    So are there any ideas short of me having to reinstall LV or VISA? 
    Thanks in advance!
    Dave
    Attachments:
    LV Error.doc ‏32 KB

    Thanks for the reply.
    I would agree that the project is corrupted.  I think I proved to myself that this was the case when I created a new project and magically everything worked just fine.  The project was created under the exact same release of LV by the same PC so I am just trying to understand why the project was corrupted while trying to build the installer. 
    I guess I have my solution now I'm into the deep dark hole of trying to understand why the error occured.  I know once I go down this path there is no returning.......
    Thanks!

  • How to instantiate classes at run time with constructors having arguments?

    I have to instantiate some classes in the run-time because they are plugins. The name of the plugin (pluginClassName) comes from a configuration file.
    Currently I am doing this to achieve it:-
    UIPlugin plugin = (UIPlugin)Class.forName(pluginClassName).newInstance();However, there is a disadvantage. I can not pass arguments to the constructor of the plugin.
    public class RainyTheme extends UIPlugin {
      public RainyTheme() {
       // bla bla
      public RainyTheme(int x, int y , int width, int height) {
       // set co-ordinates
       // bla bla
      // bla bla bla bla
    }Now if I want to instantiate this plugin at runtime and at the same time I want to pass the 4 arguments as shown in the second constructor, how can I achieve this?

    I have no experience with JME and the limitations of its API, but looking at the API docs ( http://java.sun.com/javame/reference/apis.jsp ) it seems that there are two main versions, CLDC and CDC, of which CLDC is more limited in its API.
    The Class class does not contain the methods getConstructor(Object[]) or getConstructors() in this version ( http://java.sun.com/javame/reference/apis/jsr139/java/lang/Class.html ), so it seems that if you are using CLDC then there is no way to reflectively call a constructor with parameters. You'd have to find another way to do what you want, such as use the noarg constructor then initialise the instance after construction.

  • Installing VISA run-time with distribution

    Is there a way to seamlessly (transparent to the end-user) integrate the VISA run-time engine installation into an installation of a Labview app created with App Builder?
    I am trying to avoid the user having to run two different install programs (the app install and the VISA install).
    I am doing some serial port communications, using the VISA VI's in my app. Also, does VISA need to be configured beforehand, or can I just load a customized 'visaconf.ini' file with the serial ports aliases?
    Thanks.

    Hi,
    There isn't a way to automatically include the VISA installer on the LabVIEW app installer. You can use some batch files to make the LabVIEW app installer execute other installers.
    The following knowledge base gives some suggestions and points some of the problems you might encounter when using the LabVIEW 6.1 App Builder.
    How Do I Distribute National Instruments Drivers with Applications Built in LabVIEW 6.1?
    Hope this helps
    DiegoF
    National Instruments.

  • Can no longer run queries with 7.10 GUI after BI upgrade to 7.3

    We have some users who can no longer run BEx workbooks.  The selection screens no longer pop-up.  We upgraded to BI 7.3.  Not all users having this problem.  they are all using GUI 7.10, Excel 2003, OS XP

    SAP NW BI BEx Compatibility of MS Operating Systems and Office Products
    Regards,
    Sushant

  • EJB finder query with ORDER BY clause

    Hi,
    How to query the data in ordered list using Order By clause in the entity Bean.
    Here is the part of My code in which i am interrested.
    /* @ejbgen:finder
    * signature = "Collection findAllData()"
    * ejb-ql = "SELECT OBJECT(z) FROM DataProfileBean AS z"
    abstract public class DataProfileBean extends EntityAdapter {
    * @ejbgen:cmp-field column = DATA_PREFIX
    * @ejbgen:primkey-field
    * @ejbgen:local-method transaction-attribute = Required
    public abstract Integer getDataPrefix();
    public abstract void setDataPrefix(Integer DataPrefix);
    Now what modification needs to be done in the ejb-ql query to find the DataPrefix in the sorted list.
    Regards,
    Dilip

    I don't think the current spec for EJBs support ORDER BY. But Weblogic has an extension that you can use (that is, if you're using it). Here's the info: http://e-docs.bea.com/wls/docs61/ejb/cmp.html#1076421

Maybe you are looking for

  • DocumentBuilderFactory question

    Hi to all! Is it possible to force DocumentBuilderFactory to use default platform implementation? It's neither possible to change system property in applet nor write a file in lib directory. Thanks

  • Can't get original InDesign to install on G5 running OS 10.5.8

    Bought original CS and installed on iMac G5. Recently the computer died a tragic death. I bought a used machine same vintage but Running OS 10.5.8. I was able to install Photoshop CS and Illustrator CS (after a few errors). But unable to get InDesign

  • Strange sequence of error messages during recovery

    Hi, I am trying to do an incomplete recovery as follows: "alter database recover automatic from 'C:\logsdir' using backup controlfile until change 2192315;" which results in the following error messages: ERROR at line 1: ORA-00279: change 2169480 gen

  • Allow all users to choose startup disk

    Is there any way to allow all users to choose the startup disk on the OS X side?  We want non admin users to be able to reboot to windows without having to hold down the option button when booting.

  • Dynamic XSLT in BPEL in SOA 11G

    Hi all, How can we run xslt dynamically in soa suite 11g . I have a requirement to get the xslt file name from the DB based on the input request ID . Then apply that xslt dynamically in the input request . Whenever we identified any new input request