Filter expression in union all in obiee

WHERE offset = 0
OR (offset = 1 AND mkt_value <> 0)
i have to implement this filter in where clause in result columns after union all ..
how to make it feasible
FILTER(saw_6 USING ((saw_6 = 1) OR ((saw_6 = 1) AND ((CASE WHEN saw_6 = 1 THEN saw_31 ELSE saw_11 END) <>0))))
offset = saw_6
mkt_value=CASE WHEN saw_6 = 1 THEN saw_31 ELSE saw_11 END

Ok. for this requirement easiest thing would be to bring an additional column in your resultset of query behind called YearRank. The logic would be as below
SELECT DENSE_RANK() OVER (ORDER BY YearColumn DESC) AS YearRank,
... rest of your query
Then use the filter as below
Expression: [YearRank]
Operator: <=
Value: 5
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • How to apply filters for union all report in OBIEE 11g

    Hi All
    Can we apply saved filters to union reports in obiee 11g?
    I am able to apply saved filters for normal reports but not for union reports.
    The catalog pane is blank, when i click on result columns or each criteria.
    The only option i see is to manually create the filters for each criteria, dont i have any choice to use a saved filter for union report?
    Is this a bug or something i am unaware. Please guide me
    Thanks

    Hi manu,
    Filter is created based on subject area.we can't use save filter in any other subject areas.
    now we can use new filter for union reports.
    if Helps please mark as correct.. :)

  • Union all for 3 tables on repository

    Hello, could anybody help me to find best way for my case?
    i have 3 physical tables - Objects, Facts and Calendar table.
    On repository, i make this scheme:
    OBJECTS left join FACTS right join DATES
    I creating analysis based on pivot table, i need all Dates (from period) and all Objects, it must look like this:
    _______| Month Day 1 | ... | Month Last Day |
    object 1 | fact X______| ... | fact XX _______|
    ..._____|..._________| ... | ... ___________|
    object N | fact Z_____ | ... | fact ZZ _______|
    So, physical query must be like this:
    all facts (with filter by choosen period)
    UNION ALL
    all dates (with filter by choosen period)
    UNION ALL
    all objects
    I don't like to make 3 unions on analysis criteria, don't like to use one view on physical level.
    How i can make this on repository?

    yes, i found solution, really thanks to Nico :)
    [Possibilities to densify the data|http://gerardnico.com/wiki/dat/obiee/densification]
    You have two possibilities in OBIEE to densify the data :
    by designing the repository : OBIEE - Densification with the fact-based fragmentation capabilities
    or with the OBIEE logical Sql : OBIEE - Densification with the logical Sql

  • Can we apply saved filters to union reports in obiee 11g?

    Hi All
    Can we apply saved filters to union reports in obiee 11g?
    I am able to apply saved filters for normal reports but not for union reports.
    The catalog pane is blank, when i click on result columns or each criteria.
    The only option i see is to manually create the filters for each criteria, dont i have any choice to use a saved filter for union report?
    Is this a bug or something i am unaware of , Please guide me.
    Regards
    Pranati

    I get the same issue. I thought that it's a problem in a security - the catalog pane is clear in a union report. But saved filters work in 11g. I migrated catalog from 10g to 11g and I see saved filters in the conditions. But you may add saved filters directly into xml. Go on Tab Advanced and edit Analysis XML. You have to add code like this
    <sawx:expr xsi:type="sawx:savedFilter" path="/shared/FOLDER/_filters/FOLDER/FILTER_NAME" name="FILTER_NAME"/> in a right place.

  • Using sql in the filter expression

    For a project I need to use a filter which is a construction
    with BETWEEN dateFrom AND dateTo.
    But the user does not choose these datevalues,
    he chooses timePeriods which have a unique startDate.
    The dashboard prompts are populated with these timePeriods and the user chooses 2 of these and 2
    presentation variables are set.
    Now I need to retrieve the according startDate for a chosen timePeriod.
    I tried to do this using a sub-query in the filter expression,
    but this seems not to be valid in Answers.
    In standard SQL it is expressed like this:
    select table1.* from table1
    where table1.dateValue  BETWEEN
    +(select table2.startDate from table2 where table2.timePeriod = 'theChosenValue1')+
    AND
    +(select table2.startDate from table2 where table2.timePeriod = 'theChosenValue2')+
    The return of the subqueries are single row, as it should in such constructions.
    I want the where clause to be in the filter expression for the dateValue column in Answers.(trimming of the WHERE keyword)
    Is there any other construction that does this trick in the BI Answers/Dashboard environment to do this?
    Kind regards

    Hi Micek,
    Thanks for your quick reaction.
    Yes you are right the ChosenValues will be replaced by presentation-variables in the final dashboard,
    I just am testing it with constant values in the Answers module.
    The problem seems to be that it is not allowed to use a sub-query in the filter expression.
    The Answers web application says there is a syntax problem near <select>, while I expect the SQL to be valid.
    I guess not all regular SQL is allowed in filter expressions.
    And since the report does not try to fetch data, no log of a generated, real SQL is written to the logfile.
    I need some alternative for the subquery, but one that is allowed in the filter expression.
    The problem is based on the fact that the user chooses a different value then the one that is filtered on.
    The timePeriods represent just one startDate, but I cannot use timePeriod itself to filter on.
    Because I need a between value, wich does not make sense for a timePeriod element
    such as '01-08' or 'JAN-08'.
    Several timePeriod notations are used, so using SubString and || to calculate a numeric value from the timePeriod varchar2 is not a good option.
    The error says:      
    Error getting drill information: SELECT "....
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <SELECT>: Syntax error [nQSError: 26012] . (HY000)
    Any input is welcome
    kind regards

  • SQL in reports filter expression

    Hi All,
    I want to filter the report using the 'in' operator and specify a SQL as the expression. I want apex to be use the result of the query as the list of values for the 'in' operator. Is this supported?
    for example can I specify the filter as 'user_name in (select name from user_name_tab where group_id = 10)'
    Thanks
    Edited by: vmedi on Jan 3, 2012 2:53 PM
    Edited by: vmedi on Jan 3, 2012 2:53 PM

    Hi Micek,
    Thanks for your quick reaction.
    Yes you are right the ChosenValues will be replaced by presentation-variables in the final dashboard,
    I just am testing it with constant values in the Answers module.
    The problem seems to be that it is not allowed to use a sub-query in the filter expression.
    The Answers web application says there is a syntax problem near <select>, while I expect the SQL to be valid.
    I guess not all regular SQL is allowed in filter expressions.
    And since the report does not try to fetch data, no log of a generated, real SQL is written to the logfile.
    I need some alternative for the subquery, but one that is allowed in the filter expression.
    The problem is based on the fact that the user chooses a different value then the one that is filtered on.
    The timePeriods represent just one startDate, but I cannot use timePeriod itself to filter on.
    Because I need a between value, wich does not make sense for a timePeriod element
    such as '01-08' or 'JAN-08'.
    Several timePeriod notations are used, so using SubString and || to calculate a numeric value from the timePeriod varchar2 is not a good option.
    The error says:      
    Error getting drill information: SELECT "....
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <SELECT>: Syntax error [nQSError: 26012] . (HY000)
    Any input is welcome
    kind regards

  • SSRS dataset filter expression using OR

    I have a dataset that I need to set a filter for. What I need the filter to do is check 3 different fields to see if either one of them are in a parameter. The parameter is multi-value. So, I have a parameter set to 1, 2, 3. I need the dataset to return
    records where either Field A, B, or C are IN 1, 2, 3.
    Anyone know how to do this? I tried to have the filter expression = Fields!A.Value or Fields!B.Value or Fields!C.Value then the dataset filter operator "IN" and the dataset filter value = Parameter, but I just get an error on the dataset filter
    (cannot evaluate filter expression error)

    Hello,
    Mulitple expressions added to SSRS dataset filter are evaluated as AND (Expr1 AND Expr1 AND Expr3). If you are looking for a OR like Expr1 Or Expr2 Or Expr3 then you can use this solution explained below.
    Dataset Query used for this test:
    select *
    from (values ('Row1',1,1,4),('Row2',2,1,3),('Row3',3,1,2),('Row4',3,2,2),('Row5',5,3,2),('Row6',5,6,7),('Row7',2,6,7)) x(DataRow,A,B,C)
    Report Parameter :
    Defined a multi select report parameter named "Parameter1" with string datatype and added values 1, 2, 3.
    Dataset Filter Expression:
    =Filter(Parameters!Parameter1.Value,CStr(Fields!A.Value)).Length + Filter(Parameters!Parameter1.Value,CStr(Fields!B.Value)).Length + Filter(Parameters!Parameter1.Value,CStr(Fields!C.Value)).Length
    The expression above uses the Filter function in SSRS to check if the field A\B\C has any match in the parameter1 mutli select parameter. If yes the length property will return a value > 0. Repeat the expression for all the other fields and add the Values
    for length property.
    Use > operator in the filter dialogue box
    and value as 0 as shown in the snapshot below.
    The output is shown below. Row 6 is missing as Field A, B or C doesnt have 1, 2,3 as values. If this is the output you are looking for this solution should work for you.
    --sIbu

  • Error while executing UNION ALL query

    Hello everyone,
    I'm executing the below query on Oracle 9.2.0.8 version.
    select hdr.*
    from ttl_hdr hdr, ttl_service ser
    where hdr.cus_nbr = ser.cus_nbr
    and hdr.dn in ('1232','2342',343','343')
    union all
    select hdr.*
    from ttl_hdr_his hdr, ttl_service ser
    where hdr.cus_nbr = ser.cus_nbr
    and hdr.dn in ('1232','2342',343','343')
    and I encounter following error:
    ORA-01790: expression must have same datatype as corresponding expression
    But instead of * if I'm specifying a list of few columns, it executes the query properly.
    Can anybody tell me what the problem is ?
    regards,
    Rossy

    Hi,
    All columns in your tables TTL_HDR and TTL_HDR_HIS are not with same data type.
    I'm sure you get same error if you specify all columns that * brings.
    Specify column names and use conversion function to get data type same to column from both selects.
    PS: and I think this is not Application Express related
    Br, Jari

  • Union report in obiee 11g problem

    HI,
        I build union report in obiee 11g.In that report i have one column i.e Financial month.I have excluded Financial month column in table view.
        Now my requirement is I have to show results based Financial month at dashboard.For example if i select particular month in dashboard prompt,that month data has to reflect on dashboard.
        For getting results I created one dashboard prompt i.e Financial month and kept 'is prompted' at report level.But am not getting results means if i select any value from Financial month prompt then the report on         dashboard will not reflect.Please help me how to get data based on Financial month.
    Regards,
    Kumar.

    Hi,
    you said about writing query in DB.......whether U meant of trying checking the query in toad..or something else..........
    Since im giving only one join from dim to fact in the physical diagram........
    But more than one join exist between those dim and fact, but im giving only one join mainly the primary key column of the dimension table to the fact table....Whether i need to give all the joins that exist(even if it has 2 or 3 joins between those fact and dim) tables....
    If i give count distinct means it is giving count for every nation as 1....like i mentioned below
    NATIONALITY<----------------------------------------------------->NATION COUNT
    INDIA---------------------------------------------------------------------1
    AUS------------------------------------------------------------------------1
    CAN------------------------------------------------------------------------1
    Since you said to check about depts of the particular column....i couldn't able to understand about "depts" that you meant????
    Whether i made any logical mistake...........
    thanks,
    Harry...
    Edited by: HariPrasad on Oct 10, 2010 9:55 PM

  • Filter Express VI - How to make it work with single samples? (LabVIEW 8)

    Hi there,
    I'm trying to update some older code by implementing some sort of FFT.  Currently, my program acquires X data points, averages them, and spits out the Mean value into a graph (Signal as a function of wavelength) (Spectrofluorimeter).  This is done a number of times with the instrument moving to a different wavelength between each sample scan. I've tried to incorporate the Filter Express VI but it does not seem to be doing what I'd like it to.  I have it wired to my Signal Acquisition Express VI with the Filter set to Low-pass 100 Hz with the result being passed through the "Mean" VI and then graphed with the Build XY Graph Express VI.
    When I graph the Power Spectrum, I am seeing that the maximum observable frequency is always 1/50th my sampling rate (regardless of my low/high/bandpass settings).  For example: my # of samples is set to 100, and my sampling rate is 8000 and I observe a maximum frequency of 160 Hz.  If my # of samples is set to 100 and my sampling rate to 6000, the maximum frequency is 120 Hz.  If I try the Filter Express VI with very basic wiring and just hook up a battery to it, I see all sorts of frequencies all the way up to my sampling rate divided by 2 (i.e. 8000 -> 4000 Hz) so this seems very strange to me.
    I'm not sure what is causing this and perhaps its a limitation of the Filter Express VI and I'm supposed to filter using a different method?  I was thinking that perhaps I would need to store all of the dynamic data and then wire it to the Filter Express VI once the entire scan was completed and filter that way but I'm not sure how to save or buffer this dynamic data.
    I'm hoping this is a common problem and someone would be so kind as to offer me any suggestions!
    Thank you for your help!

    I think I should clarify that these aren't necessarily "Single Samples".  I take X number of samples at a specific wavelength, filter that, then take X number of samples at a different wavelength, filter that, and the goal is to have a frequency filtered data set at the end.

  • Help required on UNION ALL for select query

    Hello all,
    The execution plan for an SQL is impacted when another SELECT is concatenated with a UNION ALL. The two SELECTS are very efficient when run separately (< 100 buffer gets), but when run together (using a UNION ALL), the execution plan changes (for the first SELECT) and the buffer gets jumps to over 45000!
    what customer says with the UNION ALL, Oracle instead of doing a Merge Scan (that allows the inner table to filter out the rows from the outer table), chooses to do a NL join. This results in a Unique Index scan for each one of the 15000 rows in the outer table, resulting in 46000 consistent gets.
    Can you please suggest customer why plan changes when they use UNION ALL &  also suggest better way of running query.
    Please refer to below explain plan .
    WITH THE UNIONS
    ===============
      1  SELECT  count(*)
      2     FROM SOC_LIST SOC
      3     WHERE
      4       ( EXISTS(  SELECT  1
      5               FROM    ELIGIBILITY_RELATION
      6               WHERE   SRC_CODE = 'SHDMM4215'
      7                    AND   DEST_CODE = SOC.SOC
      8                 AND   SRC_TYPE = 'P'
      9                 AND   DEST_TYPE = 'S'))
    10  UNION ALL
    11   SELECT count(*)
    12     FROM SOC_LIST SOC
    13*    WHERE        ( = 'Y')
    12:25:39 SQL> /
      COUNT(*)                                                                                                                                           
           153                                                                                                                                           
             0                                                                                                                                           
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=31 Card=2 Bytes=10)                                                                                
       1    0   UNION-ALL                                                                                                                                
       2    1     SORT (AGGREGATE)                                                                                                                       
       3    2       FILTER                                                                                                                               
       4    3         TABLE ACCESS (FULL) OF 'SOC_LIST' (Cost=15 Card=749                                                                                
              Bytes=7490)                                                                                                                                
       5    3         PARTITION HASH (SINGLE)                                                                                                            
       6    5           INDEX (UNIQUE SCAN) OF 'ELIGIBILITY_RELATION_PK' (                                                                               
              UNIQUE) (Cost=2 Card=1 Bytes=24)                                                                                                           
       7    1     SORT (AGGREGATE)                                                                                                                       
       8    7       FILTER                                                                                                                               
       9    8         TABLE ACCESS (FULL) OF 'SOC_LIST' (Cost=15 Card=1497                                                                               
              8)                                                                                                                                         
    Statistics
              0  recursive calls                                                                                                                         
              0  db block gets                                                                                                                           
          46712  consistent gets         <------large number                                                                                                                 
              0  physical reads                                                                                                                          
              0  redo size                                                                                                                               
            215  bytes sent via SQL*Net to client                                                                                                        
            241  bytes received via SQL*Net from client                                                                                                  
              2  SQL*Net roundtrips to/from client                                                                                                       
              0  sorts (memory)                                                                                                                          
              0  sorts (disk)                                                                                                                            
              2  rows processed                                                                                                                          
    12:25:40 SQL> ed
    Wrote file C:/PADDY/AFIEDT.BUF
    PART 1 of the UNION ALL
    ========================
      1  SELECT  count(*)
      2     FROM SOC_LIST SOC
      3     WHERE
      4       ( EXISTS(  SELECT  1
      5               FROM    ELIGIBILITY_RELATION
      6               WHERE   SRC_CODE = 'SHDMM4215'
      7                    AND   DEST_CODE = SOC.SOC
      8                 AND   SRC_TYPE = 'P'
      9*                AND   DEST_TYPE = 'S'))
    12:25:54 SQL> /
      COUNT(*)                                                                                                                                           
           153                                                                                                                                           
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=4 Card=1 Bytes=34)                                                                                 
       1    0   SORT (AGGREGATE)                                                                                                                         
       2    1     MERGE JOIN (SEMI) (Cost=4 Card=149 Bytes=5066)                                                                                         
       3    2       INDEX (FULL SCAN) OF 'SOC_LIST_1IX' (NON-UNIQUE) (Cost                                                                               
              =41 Card=14978 Bytes=149780)                                                                                                               
       4    2       SORT (UNIQUE) (Cost=3 Card=149 Bytes=3576)                                                                                           
       5    4         PARTITION HASH (ALL)                                                                                                               
       6    5           INDEX (RANGE SCAN) OF 'ELIGIBILITY_RELATION_PK' (U                                                                               
              NIQUE) (Cost=10 Card=149 Bytes=3576)                                                                                                       
    Statistics
              0  recursive calls                                                                                                                         
              0  db block gets                                                                                                                           
             56  consistent gets                                                                                                                         
              0  physical reads                                                                                                                          
              0  redo size                                                                                                                               
            218  bytes sent via SQL*Net to client                                                                                                        
            241  bytes received via SQL*Net from client                                                                                                  
              2  SQL*Net roundtrips to/from client                                                                                                       
              1  sorts (memory)                                                                                                                          
              0  sorts (disk)                                                                                                                            
              1  rows processed                                                                                                                          
    12:25:55 SQL> ed
    Wrote file C:/PADDY/AFIEDT.BUF
    PART 2 of the UNION ALL
    ========================
      1   SELECT count(*)
      2     FROM SOC_LIST SOC
      3*    WHERE        ( = 'Y')
    12:26:15 SQL> /
      COUNT(*)                                                                                                                                           
             0                                                                                                                                           
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=15 Card=1)                                                                                         
       1    0   SORT (AGGREGATE)                                                                                                                         
       2    1     FILTER                                                                                                                                 
       3    2       TABLE ACCESS (FULL) OF 'SOC_LIST' (Cost=15 Card=14978)                                                                               
    Statistics
              0  recursive calls                                                                                                                         
              0  db block gets                                                                                                                           
              0  consistent gets                                                                                                                         
              0  physical reads                                                                                                                          
              0  redo size                                                                                                                               
            215  bytes sent via SQL*Net to client                                                                                                        
            241  bytes received via SQL*Net from client                                                                                                  
              2  SQL*Net roundtrips to/from client                                                                                                       
              0  sorts (memory)                                                                                                                          
              0  sorts (disk)                                                                                                                            
              1  rows processed                                                                                                                          
    12:26:20 SQL> spool off
    Same results but with theUNION ALL, the buffergets is massive ...
    Thanks
    Krishna

    i am also attaching 10043/10053 trace file .
    /opt/oracle/adm/STCUST/udump/stcust_ora_7919_10046_10053_trace_file.trc
    *** TRACE DUMP CONTINUED FROM FILE  ***
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - Production
    ORACLE_HOME = /opt/oracle/product/9.2.0.8
    System name: HP-UX
    Node name: rcihp009
    Release: B.11.23
    Version: U
    Machine: 9000/800
    Instance name: STCUST
    Redo thread mounted by this instance: 1
    Oracle process number: 152
    Unix process pid: 7919, image: oracle@rcihp009 (TNS V1-V3)
    *** 2013-06-10 13:32:48.943
    *** SESSION ID:(533.15875) 2013-06-10 13:32:48.943
    APPNAME mod='SQL*Plus' mh=3669949024 act='' ah=4029777240
    =====================
    PARSING IN CURSOR #1 len=69 dep=0 uid=33 oct=42 lid=33 tim=3017585934213 hv=2004533713 ad='4aa33998'
    alter session set events '10046 trace name context forever, level 12'
    END OF STMT
    EXEC #1:c=0,e=209,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=4,tim=3017585933683
    WAIT #1: nam='SQL*Net message to client' ela= 3 p1=1413697536 p2=1 p3=0
    *** 2013-06-10 13:33:00.090
    WAIT #1: nam='SQL*Net message from client' ela= 10884599 p1=1413697536 p2=1 p3=0
    =====================
    PARSING IN CURSOR #1 len=69 dep=0 uid=33 oct=42 lid=33 tim=3017596819944 hv=2030017677 ad='3af92970'
    alter session set events '10053 trace name context forever, level 1'
    END OF STMT
    PARSE #1:c=0,e=484,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=4,tim=3017596819933
    BINDS #1:
    EXEC #1:c=0,e=160,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=3017596820180
    WAIT #1: nam='SQL*Net message to client' ela= 3 p1=1413697536 p2=1 p3=0
    *** 2013-06-10 13:33:50.197
    WAIT #1: nam='SQL*Net message from client' ela= 48932344 p1=1413697536 p2=1 p3=0
    PARAMETERS USED BY THE OPTIMIZER
    OPTIMIZER_FEATURES_ENABLE = 9.2.0
    OPTIMIZER_MODE/GOAL = Choose
    _OPTIMIZER_PERCENT_PARALLEL = 101
    HASH_AREA_SIZE = 131072
    HASH_JOIN_ENABLED = TRUE
    HASH_MULTIBLOCK_IO_COUNT = 0
    SORT_AREA_SIZE = 65536
    OPTIMIZER_SEARCH_LIMIT = 5
    PARTITION_VIEW_ENABLED = FALSE
    _ALWAYS_STAR_TRANSFORMATION = FALSE
    _B_TREE_BITMAP_PLANS = TRUE
    STAR_TRANSFORMATION_ENABLED = FALSE
    _COMPLEX_VIEW_MERGING = TRUE
    _PUSH_JOIN_PREDICATE = TRUE
    PARALLEL_BROADCAST_ENABLED = TRUE
    OPTIMIZER_MAX_PERMUTATIONS = 2000
    OPTIMIZER_INDEX_CACHING = 0
    _SYSTEM_INDEX_CACHING = 0
    OPTIMIZER_INDEX_COST_ADJ = 1
    OPTIMIZER_DYNAMIC_SAMPLING = 1
    _OPTIMIZER_DYN_SMP_BLKS = 32
    QUERY_REWRITE_ENABLED = TRUE
    QUERY_REWRITE_INTEGRITY = ENFORCED
    _INDEX_JOIN_ENABLED = TRUE
    _SORT_ELIMINATION_COST_RATIO = 0
    _OR_EXPAND_NVL_PREDICATE = TRUE
    _NEW_INITIAL_JOIN_ORDERS = TRUE
    ALWAYS_ANTI_JOIN = CHOOSE
    ALWAYS_SEMI_JOIN = CHOOSE
    _OPTIMIZER_MODE_FORCE = TRUE
    _OPTIMIZER_UNDO_CHANGES = FALSE
    _UNNEST_SUBQUERY = TRUE
    _PUSH_JOIN_UNION_VIEW = TRUE
    _FAST_FULL_SCAN_ENABLED = TRUE
    _OPTIM_ENHANCE_NNULL_DETECTION = TRUE
    _ORDERED_NESTED_LOOP = TRUE
    _NESTED_LOOP_FUDGE = 100
    _NO_OR_EXPANSION = FALSE
    _QUERY_COST_REWRITE = TRUE
    QUERY_REWRITE_EXPRESSION = TRUE
    _IMPROVED_ROW_LENGTH_ENABLED = TRUE
    _USE_NOSEGMENT_INDEXES = FALSE
    _ENABLE_TYPE_DEP_SELECTIVITY = TRUE
    _IMPROVED_OUTERJOIN_CARD = TRUE
    _OPTIMIZER_ADJUST_FOR_NULLS = TRUE
    _OPTIMIZER_CHOOSE_PERMUTATION = 0
    _USE_COLUMN_STATS_FOR_FUNCTION = TRUE
    _SUBQUERY_PRUNING_ENABLED = TRUE
    _SUBQUERY_PRUNING_REDUCTION_FACTOR = 50
    _SUBQUERY_PRUNING_COST_FACTOR = 20
    _LIKE_WITH_BIND_AS_EQUALITY = FALSE
    _TABLE_SCAN_COST_PLUS_ONE = TRUE
    _SORTMERGE_INEQUALITY_JOIN_OFF = FALSE
    _DEFAULT_NON_EQUALITY_SEL_CHECK = TRUE
    _ONESIDE_COLSTAT_FOR_EQUIJOINS = TRUE
    _OPTIMIZER_COST_MODEL = CHOOSE
    _GSETS_ALWAYS_USE_TEMPTABLES = FALSE
    DB_FILE_MULTIBLOCK_READ_COUNT = 128
    _NEW_SORT_COST_ESTIMATE = TRUE
    _GS_ANTI_SEMI_JOIN_ALLOWED = TRUE
    _CPU_TO_IO = 0
    _PRED_MOVE_AROUND = TRUE
    BASE STATISTICAL INFORMATION
    Table stats    Table: SOC_LIST   Alias: SOC
      TOTAL ::  CDN: 17584  NBLKS:  653  AVG_ROW_LEN:  260
    Column:        SOC  Col#: 3      Table: SOC_LIST   Alias: SOC
        NDV: 17584     NULLS: 0         DENS: 5.6870e-05
        NO HISTOGRAM: #BKT: 1 #VAL: 2
    -- Index stats
      INDEX NAME: I_SNAP$_SOC_LIST  COL#: 1
        TOTAL ::  LVLS: 1   #LB: 64  #DK: 17487  LB/K: 1  DB/K: 1  CLUF: 699
      INDEX NAME: SOC_LIST_1IX  COL#: 3
        TOTAL ::  LVLS: 1   #LB: 47  #DK: 17487  LB/K: 1  DB/K: 1  CLUF: 14065
    Table stats    Table: ELIGIBILITY_RELATION   Alias: ELIGIBILITY_RELATION
      (Using composite stats)
      TOTAL ::  CDN: 11982220  NBLKS:  125493  AVG_ROW_LEN:  71
    -- Index stats
      INDEX NAME: ELIGIBILITY_RELATION_1IX  COL#: 3 4 5
        USING COMPOSITE STATS
        TOTAL ::  LVLS: 2   #LB: 38360  #DK: 4164  LB/K: 9  DB/K: 740  CLUF: 3081860
      INDEX NAME: ELIGIBILITY_RELATION_PK  COL#: 2 3 4 5
        USING COMPOSITE STATS
        TOTAL ::  LVLS: 2   #LB: 50740  #DK: 11873160  LB/K: 1  DB/K: 1  CLUF: 9158280
      INDEX NAME: I_SNAP$_ELIGIBILITY_RELATI  COL#: 1
        TOTAL ::  LVLS: 2   #LB: 49600  #DK: 11953600  LB/K: 1  DB/K: 1  CLUF: 8833300
    _OPTIMIZER_PERCENT_PARALLEL = 0
    SINGLE TABLE ACCESS PATH
    Column:   SRC_CODE  Col#: 2      Table: ELIGIBILITY_RELATION   Alias: ELIGIBILITY_RELATION
        NDV: 22087     NULLS: 0         DENS: 4.5276e-05
        NO HISTOGRAM: #BKT: 1 #VAL: 2
    Column:   SRC_TYPE  Col#: 3      Table: ELIGIBILITY_RELATION   Alias: ELIGIBILITY_RELATION
        NDV: 2         NULLS: 0         DENS: 5.0000e-01
        NO HISTOGRAM: #BKT: 1 #VAL: 2
    Column:  DEST_TYPE  Col#: 5      Table: ELIGIBILITY_RELATION   Alias: ELIGIBILITY_RELATION
        NDV: 2         NULLS: 0         DENS: 5.0000e-01
        NO HISTOGRAM: #BKT: 1 #VAL: 2
      TABLE: ELIGIBILITY_RELATION     ORIG CDN: 11982220  ROUNDED CDN: 136  CMPTD CDN: 136
      Access path: tsc  Resc:  3072  Resp:  3072
      Access path: index (iff)
          Index: ELIGIBILITY_RELATION_PK
      TABLE: ELIGIBILITY_RELATION
          RSC_CPU: 0   RSC_IO: 1243
      IX_SEL:  0.0000e+00  TB_SEL:  1.0000e+00
      Access path: iff  Resc:  1243  Resp:  1243
      Skip scan: ss-sel 0  andv 11970 
        ss cost 119700
        index io scan cost 19180
      Access path: index (scan)
          Index: ELIGIBILITY_RELATION_1IX
      TABLE: ELIGIBILITY_RELATION
          RSC_CPU: 0   RSC_IO: 789653
      IX_SEL:  5.0000e-01  TB_SEL:  2.5000e-01
      Skip scan: ss-sel 0  andv 11970 
        ss cost 11970
        index io scan cost 2
      Access path: index (index-only)
          Index: ELIGIBILITY_RELATION_PK
      TABLE: ELIGIBILITY_RELATION
          RSC_CPU: 0   RSC_IO: 10
      IX_SEL:  2.2638e-05  TB_SEL:  2.2638e-05
      ****** trying bitmap/domain indexes ******
      ****** finished trying bitmap/domain indexes ******
      BEST_CST: 1.00  PATH: 4  Degree:  1
    SINGLE TABLE ACCESS PATH
      TABLE: SOC_LIST     ORIG CDN: 17584  ROUNDED CDN: 17584  CMPTD CDN: 17584
      Access path: tsc  Resc:  18  Resp:  18
      Access path: index (iff)
          Index: SOC_LIST_1IX
      TABLE: SOC_LIST
          RSC_CPU: 0   RSC_IO: 3
      IX_SEL:  0.0000e+00  TB_SEL:  1.0000e+00
      Access path: iff  Resc:  3  Resp:  3
      Access path: index (no sta/stp keys)
          Index: SOC_LIST_1IX
      TABLE: SOC_LIST
          RSC_CPU: 0   RSC_IO: 48
      IX_SEL:  1.0000e+00  TB_SEL:  1.0000e+00
      BEST_CST: 1.00  PATH: 4  Degree:  1
    OPTIMIZER STATISTICS AND COMPUTATIONS
    GENERAL PLANS
    Join order[1]:  SOC_LIST[SOC]#0  ELIGIBILITY_RELATION[ELIGIBILITY_RELATION]#1
    Now joining: ELIGIBILITY_RELATION[ELIGIBILITY_RELATION]#1 *******
    NL Join
      Outer table: cost: 1  cdn: 17584  rcz: 10  resp:  1
      Inner table: ELIGIBILITY_RELATION
        Access path: tsc  Resc: 768
        Join:  Resc:  13504513  Resp:  13504513
      Access path: index (iff)
          Index: ELIGIBILITY_RELATION_PK
      TABLE: ELIGIBILITY_RELATION
          RSC_CPU: 0   RSC_IO: 1243
      IX_SEL:  0.0000e+00  TB_SEL:  1.0000e+00
      Inner table: ELIGIBILITY_RELATION
        Access path: iff  Resc: 311
        Join:  Resc:  5464229  Resp:  5464229
      Access path: index (unique)
          Index: ELIGIBILITY_RELATION_PK
      TABLE: ELIGIBILITY_RELATION
          RSC_CPU: 0   RSC_IO: 1
      IX_SEL:  8.3457e-08  TB_SEL:  8.3457e-08
        Join:  resc: 177  resp: 177
      Access path: index (join index)
          Index: ELIGIBILITY_RELATION_1IX
      TABLE: ELIGIBILITY_RELATION
          RSC_CPU: 0   RSC_IO: 750
      IX_SEL:  0.0000e+00  TB_SEL:  2.0886e-05
        Join:  resc: 131881  resp: 131881
      Access path: index (eq-unique)
          Index: ELIGIBILITY_RELATION_PK
      TABLE: ELIGIBILITY_RELATION
          RSC_CPU: 0   RSC_IO: 1
      IX_SEL:  0.0000e+00  TB_SEL:  0.0000e+00
        Join:  resc: 177  resp: 177
      ****** trying bitmap/domain indexes ******
      Access path: index (join index)
          Index: ELIGIBILITY_RELATION_1IX
      TABLE: ELIGIBILITY_RELATION
          RSC_CPU: 0   RSC_IO: 10
      IX_SEL:  1.4217e-05  TB_SEL:  2.0886e-05
        Join:  resc: 1759  resp: 1759
      Access path: index (index-only)
          Index: ELIGIBILITY_RELATION_PK
      TABLE: ELIGIBILITY_RELATION
          RSC_CPU: 0   RSC_IO: 4
      IX_SEL:  4.5276e-05  TB_SEL:  4.5276e-05
        Join:  resc: 704  resp: 704
        SORT resource      Sort statistics
          Sort width:           11 Area size:      628736 Max Area size:    31457280   Degree: 1
          Blocks to Sort:        2 Row size:           21 Rows:        543
          Initial runs:          1 Merge passes:        1 IO Cost / pass:          3
          Total IO sort cost: 2
          Total CPU sort cost: 0
          Total Temp space used: 0
      ****** finished trying bitmap/domain indexes ******
      Best NL cost: 177  resp: 177
    Semi-join cardinality:  135 = outer (17584) * sel (7.6774e-03) [flag=12]
    SM Join
      Outer table:
        resc: 1  cdn: 17584  rcz: 10  deg: 1  resp: 1
      Inner table: ELIGIBILITY_RELATION
        resc: 1  cdn: 136  rcz: 24  deg:  1  resp: 1
        using join:1 distribution:2 #groups:1
        SORT resource      Sort statistics
          Sort width:           11 Area size:      628736 Max Area size:    31457280   Degree: 1
          Blocks to Sort:        1 Row size:           37 Rows:        136
          Initial runs:          1 Merge passes:        1 IO Cost / pass:          2
          Total IO sort cost: 2
          Total CPU sort cost: 0
          Total Temp space used: 0
      Merge join  Cost:  4  Resp:  4
    HA Join
      Outer table:
        resc: 1  cdn: 17584  rcz: 10  deg: 1  resp: 1
      Inner table: ELIGIBILITY_RELATION
        resc: 1  cdn: 136  rcz: 24  deg:  1  resp: 1
        using join:8 distribution:2 #groups:1
      Hash join one ptn Resc: 4   Deg: 1
          hash_area:  154 (max=7680)  buildfrag:  48                probefrag:   1 ppasses:    1
      Hash join   Resc: 6   Resp: 6
    Join result: cost: 4  cdn: 135  rcz: 34
    Best so far: TABLE#: 0  CST:          1  CDN:      17584  BYTES:     175840
    Best so far: TABLE#: 1  CST:          4  CDN:        135  BYTES:       4590
    Join order[2]:  ELIGIBILITY_RELATION[ELIGIBILITY_RELATION]#1  SOC_LIST[SOC]#0
        SORT resource      Sort statistics
          Sort width:           11 Area size:      628736 Max Area size:    31457280   Degree: 1
          Blocks to Sort:        1 Row size:           37 Rows:        136
          Initial runs:          1 Merge passes:        1 IO Cost / pass:          2
          Total IO sort cost: 2
          Total CPU sort cost: 0
          Total Temp space used: 0
    Now joining: SOC_LIST[SOC]#0 *******
    NL Join
      Outer table: cost: 3  cdn: 136  rcz: 24  resp:  2
      Inner table: SOC_LIST
        Access path: tsc  Resc: 18
        Join:  Resc:  2450  Resp:  2450
      Access path: index (iff)
          Index: SOC_LIST_1IX
      TABLE: SOC_LIST
          RSC_CPU: 0   RSC_IO: 3
      IX_SEL:  0.0000e+00  TB_SEL:  1.0000e+00
      Inner table: SOC_LIST
        Access path: iff  Resc: 3
        Join:  Resc:  410  Resp:  410
      Access path: index (join index)
          Index: SOC_LIST_1IX
      TABLE: SOC_LIST
          RSC_CPU: 0   RSC_IO: 1
      IX_SEL:  0.0000e+00  TB_SEL:  5.6870e-05
        Join:  resc: 4  resp: 4
      Best NL cost: 4  resp: 4
    Join cardinality:  136 = outer (136) * inner (17584) * sel (5.6870e-05)  [flag=0]
    SM Join
      Outer table:
        resc: 2  cdn: 136  rcz: 24  deg: 1  resp: 2
      Inner table: SOC_LIST
        resc: 1  cdn: 17584  rcz: 10  deg:  1  resp: 1
        using join:1 distribution:2 #groups:1
        SORT resource      Sort statistics
          Sort width:           11 Area size:      628736 Max Area size:    31457280   Degree: 1
          Blocks to Sort:        1 Row size:           37 Rows:        136
          Initial runs:          1 Merge passes:        1 IO Cost / pass:          2
          Total IO sort cost: 2
          Total CPU sort cost: 0
          Total Temp space used: 0
        SORT resource      Sort statistics
          Sort width:           11 Area size:      628736 Max Area size:    31457280   Degree: 1
          Blocks to Sort:       46 Row size:           21 Rows:      17584
          Initial runs:          1 Merge passes:        1 IO Cost / pass:         51
          Total IO sort cost: 48
          Total CPU sort cost: 0
          Total Temp space used: 0
      Merge join  Cost:  54  Resp:  54
    HA Join
      Outer table:
        resc: 2  cdn: 136  rcz: 24  deg: 1  resp: 2
      Inner table: SOC_LIST
        resc: 1  cdn: 17584  rcz: 10  deg:  1  resp: 1
        using join:8 distribution:2 #groups:1
      Hash join one ptn Resc: 1   Deg: 1
          hash_area:  154 (max=7680)  buildfrag:  1                probefrag:   48 ppasses:    1
      Hash join   Resc: 4   Resp: 4
    Final - All Rows Plan:
      JOIN ORDER: 1
      CST: 4  CDN: 135  RSC: 4  RSP: 4  BYTES: 4590
      IO-RSC: 4  IO-RSP: 4  CPU-RSC: 0  CPU-RSP: 0
    QUERY
    SELECT   count(*)
       FROM SOC_LIST SOC
       WHERE
         ( EXISTS(  SELECT  1
                 FROM    ELIGIBILITY_RELATION
                 WHERE   SRC_CODE = 'SHDMM4215'
                      AND   DEST_CODE = SOC.SOC
                   AND   SRC_TYPE = 'P'
                   AND   DEST_TYPE = 'S'))
    =====================
    PARSING IN CURSOR #1 len=278 dep=0 uid=33 oct=3 lid=33 tim=3017645761269 hv=183981413 ad='492d5bb0'
    SELECT   count(*)
       FROM SOC_LIST SOC
       WHERE
         ( EXISTS(  SELECT  1
                 FROM    ELIGIBILITY_RELATION
                 WHERE   SRC_CODE = 'SHDMM4215'
                      AND   DEST_CODE = SOC.SOC
                   AND   SRC_TYPE = 'P'
                   AND   DEST_TYPE = 'S'))
    END OF STMT
    PARSE #1:c=10000,e=8343,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=4,tim=3017645761258
    BINDS #1:
    EXEC #1:c=0,e=529,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=3017645761970
    WAIT #1: nam='SQL*Net message to client' ela= 3 p1=1413697536 p2=1 p3=0
    WAIT #1: nam='db file sequential read' ela= 9290 p1=2535 p2=142378 p3=1
    WAIT #1: nam='db file sequential read' ela= 2098 p1=2535 p2=142379 p3=1
    WAIT #1: nam='db file sequential read' ela= 11574 p1=2535 p2=33834 p3=1
    WAIT #1: nam='db file sequential read' ela= 10290 p1=2536 p2=60958 p3=1
    WAIT #1: nam='db file sequential read' ela= 11469 p1=2535 p2=61232 p3=1
    WAIT #1: nam='db file sequential read' ela= 378 p1=2535 p2=61233 p3=1
    WAIT #1: nam='db file sequential read' ela= 5493 p1=2535 p2=39498 p3=1
    WAIT #1: nam='db file sequential read' ela= 7397 p1=2536 p2=68185 p3=1
    WAIT #1: nam='db file sequential read' ela= 10037 p1=2536 p2=68520 p3=1
    WAIT #1: nam='db file sequential read' ela= 16125 p1=2535 p2=68809 p3=1
    WAIT #1: nam='db file sequential read' ela= 12426 p1=2535 p2=45162 p3=1
    WAIT #1: nam='db file sequential read' ela= 12447 p1=2535 p2=178335 p3=1
    WAIT #1: nam='db file sequential read' ela= 5974 p1=2535 p2=178798 p3=1
    WAIT #1: nam='db file sequential read' ela= 1247 p1=2535 p2=178799 p3=1
    WAIT #1: nam='db file sequential read' ela= 11010 p1=2535 p2=50826 p3=1
    WAIT #1: nam='db file sequential read' ela= 5421 p1=2536 p2=260451 p3=1
    WAIT #1: nam='db file sequential read' ela= 8230 p1=2536 p2=261538 p3=1
    WAIT #1: nam='db file sequential read' ela= 350 p1=2535 p2=142380 p3=1
    WAIT #1: nam='db file sequential read' ela= 346 p1=2535 p2=142381 p3=1
    WAIT #1: nam='db file sequential read' ela= 343 p1=2535 p2=142382 p3=1
    WAIT #1: nam='db file sequential read' ela= 480 p1=2535 p2=142383 p3=1
    WAIT #1: nam='db file sequential read' ela= 10237 p1=2535 p2=142384 p3=1
    WAIT #1: nam='db file sequential read' ela= 324 p1=2535 p2=142385 p3=1
    WAIT #1: nam='db file sequential read' ela= 359 p1=2535 p2=142386 p3=1
    WAIT #1: nam='db file sequential read' ela= 361 p1=2535 p2=142387 p3=1
    WAIT #1: nam='db file sequential read' ela= 375 p1=2535 p2=142388 p3=1
    WAIT #1: nam='db file sequential read' ela= 425 p1=2535 p2=142389 p3=1
    WAIT #1: nam='db file sequential read' ela= 540 p1=2535 p2=142390 p3=1
    WAIT #1: nam='db file sequential read' ela= 368 p1=2535 p2=142391 p3=1
    WAIT #1: nam='db file sequential read' ela= 479 p1=2535 p2=142392 p3=1
    WAIT #1: nam='db file sequential read' ela= 450 p1=2535 p2=142393 p3=1
    WAIT #1: nam='db file sequential read' ela= 307 p1=2535 p2=142394 p3=1
    WAIT #1: nam='db file sequential read' ela= 324 p1=2535 p2=142395 p3=1
    WAIT #1: nam='db file sequential read' ela= 396 p1=2535 p2=142396 p3=1
    WAIT #1: nam='db file sequential read' ela= 376 p1=2535 p2=142397 p3=1
    WAIT #1: nam='db file sequential read' ela= 295 p1=2535 p2=142398 p3=1
    WAIT #1: nam='db file sequential read' ela= 391 p1=2535 p2=142399 p3=1
    WAIT #1: nam='db file sequential read' ela= 396 p1=2535 p2=142400 p3=1
    WAIT #1: nam='db file sequential read' ela= 344 p1=2535 p2=142401 p3=1
    WAIT #1: nam='db file sequential read' ela= 337 p1=2535 p2=142402 p3=1
    WAIT #1: nam='db file sequential read' ela= 360 p1=2535 p2=142403 p3=1
    WAIT #1: nam='db file sequential read' ela= 402 p1=2535 p2=142404 p3=1
    WAIT #1: nam='db file sequential read' ela= 343 p1=2535 p2=142405 p3=1
    WAIT #1: nam='db file sequential read' ela= 408 p1=2535 p2=142406 p3=1
    WAIT #1: nam='db file sequential read' ela= 388 p1=2535 p2=142407 p3=1
    WAIT #1: nam='db file sequential read' ela= 400 p1=2535 p2=142408 p3=1
    WAIT #1: nam='db file sequential read' ela= 7999 p1=2536 p2=617 p3=1
    WAIT #1: nam='db file sequential read' ela= 520 p1=2536 p2=618 p3=1
    WAIT #1: nam='db file sequential read' ela= 294 p1=2536 p2=619 p3=1
    WAIT #1: nam='db file sequential read' ela= 311 p1=2536 p2=620 p3=1
    WAIT #1: nam='db file sequential read' ela= 316 p1=2536 p2=621 p3=1
    WAIT #1: nam='db file sequential read' ela= 306 p1=2536 p2=622 p3=1
    WAIT #1: nam='db file sequential read' ela= 303 p1=2536 p2=623 p3=1
    WAIT #1: nam='db file sequential read' ela= 1776 p1=2536 p2=624 p3=1
    FETCH #1:c=50000,e=216800,p=54,cr=54,cu=0,mis=0,r=1,dep=0,og=4,tim=3017645978865
    WAIT #1: nam='SQL*Net message from client' ela= 2802 p1=1413697536 p2=1 p3=0
    FETCH #1:c=0,e=1,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=3017645981803
    WAIT #1: nam='SQL*Net message to client' ela= 1 p1=1413697536 p2=1 p3=0
    *** 2013-06-10 13:34:28.160
    WAIT #1: nam='SQL*Net message from client' ela= 36844121 p1=1413697536 p2=1 p3=0
    STAT #1 id=1 cnt=1 pid=0 pos=1 obj=0 op='SORT AGGREGATE (cr=54 r=54 w=0 time=216788 us)'
    STAT #1 id=2 cnt=157 pid=1 pos=1 obj=0 op='MERGE JOIN SEMI (cr=54 r=54 w=0 time=216734 us)'
    STAT #1 id=3 cnt=14296 pid=2 pos=1 obj=5769123 op='INDEX FULL SCAN SOC_LIST_1IX (cr=39 r=39 w=0 time=55399 us)'
    STAT #1 id=4 cnt=157 pid=2 pos=2 obj=0 op='SORT UNIQUE (cr=15 r=15 w=0 time=141933 us)'
    STAT #1 id=5 cnt=286 pid=4 pos=1 obj=0 op='PARTITION HASH ALL PARTITION: 1 4 (cr=15 r=15 w=0 time=130847 us)'
    STAT #1 id=6 cnt=286 pid=5 pos=1 obj=5401812 op='INDEX RANGE SCAN ELIGIBILITY_RELATION_PK PARTITION: 1 4 (cr=15 r=15 w=0 time=130716 us)'
    QUERY
    BEGIN := 'N'; END;
    =====================
    PARSING IN CURSOR #1 len=23 dep=0 uid=33 oct=47 lid=33 tim=3017682828223 hv=16287806 ad='464edb18'
    BEGIN := 'N'; END;
    END OF STMT
    PARSE #1:c=0,e=1569,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=0,tim=3017682828214
    BINDS #1:
    bind 0: dty=96 mxl=01(01) mal=00 scl=00 pre=00 oacflg=03 oacfl2=200071100000000 size=8 offset=0
       bfp=800003ffefe9f748 bln=01 avl=00 flg=05
    WAIT #1: nam='SQL*Net message to client' ela= 3 p1=1413697536 p2=1 p3=0
    EXEC #1:c=0,e=5494,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=4,tim=3017682833795
    *** 2013-06-10 13:34:44.174
    WAIT #1: nam='SQL*Net message from client' ela= 15630899 p1=1413697536 p2=1 p3=0
    QUERY
    SELECT count(*)
       FROM SOC_LIST SOC
       WHERE        ( = 'Y')
    =====================
    PARSING IN CURSOR #1 len=65 dep=0 uid=33 oct=3 lid=33 tim=3017698466665 hv=900106749 ad='43145458'
    SELECT count(*)
       FROM SOC_LIST SOC
       WHERE        ( = 'Y')
    END OF STMT
    PARSE #1:c=0,e=1409,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=0,tim=3017698466654
    PARAMETERS USED BY THE OPTIMIZER
    OPTIMIZER_FEATURES_ENABLE = 9.2.0
    OPTIMIZER_MODE/GOAL = Choose
    _OPTIMIZER_PERCENT_PARALLEL = 101
    HASH_AREA_SIZE = 131072
    HASH_JOIN_ENABLED = TRUE
    HASH_MULTIBLOCK_IO_COUNT = 0
    SORT_AREA_SIZE = 65536
    OPTIMIZER_SEARCH_LIMIT = 5
    PARTITION_VIEW_ENABLED = FALSE
    _ALWAYS_STAR_TRANSFORMATION = FALSE
    _B_TREE_BITMAP_PLANS = TRUE
    STAR_TRANSFORMATION_ENABLED = FALSE
    _COMPLEX_VIEW_MERGING = TRUE
    _PUSH_JOIN_PREDICATE = TRUE
    PARALLEL_BROADCAST_ENABLED = TRUE
    OPTIMIZER_MAX_PERMUTATIONS = 2000
    OPTIMIZER_INDEX_CACHING = 0
    _SYSTEM_INDEX_CACHING = 0
    OPTIMIZER_INDEX_COST_ADJ = 1
    OPTIMIZER_DYNAMIC_SAMPLING = 1
    _OPTIMIZER_DYN_SMP_BLKS = 32
    QUERY_REWRITE_ENABLED = TRUE
    QUERY_REWRITE_INTEGRITY = ENFORCED
    _INDEX_JOIN_ENABLED = TRUE
    _SORT_ELIMINATION_COST_RATIO = 0
    _OR_EXPAND_NVL_PREDICATE = TRUE
    _NEW_INITIAL_JOIN_ORDERS = TRUE
    ALWAYS_ANTI_JOIN = CHOOSE
    ALWAYS_SEMI_JOIN = CHOOSE
    _OPTIMIZER_MODE_FORCE = TRUE
    _OPTIMIZER_UNDO_CHANGES = FALSE
    _UNNEST_SUBQUERY = TRUE
    _PUSH_JOIN_UNION_VIEW = TRUE
    _FAST_FULL_SCAN_ENABLED = TRUE
    _OPTIM_ENHANCE_NNULL_DETECTION = TRUE
    _ORDERED_NESTED_LOOP = TRUE
    _NESTED_LOOP_FUDGE = 100
    _NO_OR_EXPANSION = FALSE
    _QUERY_COST_REWRITE = TRUE
    QUERY_REWRITE_EXPRESSION = TRUE
    _IMPROVED_ROW_LENGTH_ENABLED = TRUE
    _USE_NOSEGMENT_INDEXES = FALSE
    _ENABLE_TYPE_DEP_SELECTIVITY = TRUE
    _IMPROVED_OUTERJOIN_CARD = TRUE
    _OPTIMIZER_ADJUST_FOR_NULLS = TRUE
    _OPTIMIZER_CHOOSE_PERMUTATION = 0
    _USE_COLUMN_STATS_FOR_FUNCTION = TRUE
    _SUBQUERY_PRUNING_ENABLED = TRUE
    _SUBQUERY_PRUNING_REDUCTION_FACTOR = 50
    _SUBQUERY_PRUNING_COST_FACTOR = 20
    _LIKE_WITH_BIND_AS_EQUALITY = FALSE
    _TABLE_SCAN_COST_PLUS_ONE = TRUE
    _SORTMERGE_INEQUALITY_JOIN_OFF = FALSE
    _DEFAULT_NON_EQUALITY_SEL_CHECK = TRUE
    _ONESIDE_COLSTAT_FOR_EQUIJOINS = TRUE
    _OPTIMIZER_COST_MODEL = CHOOSE
    _GSETS_ALWAYS_USE_TEMPTABLES = FALSE
    DB_FILE_MULTIBLOCK_READ_COUNT = 128
    _NEW_SORT_COST_ESTIMATE = TRUE
    _GS_ANTI_SEMI_JOIN_ALLOWED = TRUE
    _CPU_TO_IO = 0
    _PRED_MOVE_AROUND = TRUE
    BASE STATISTICAL INFORMATION
    Table stats    Table: SOC_LIST   Alias: SOC
      TOTAL ::  CDN: 17584  NBLKS:  653  AVG_ROW_LEN:  260
    -- Index stats
      INDEX NAME: I_SNAP$_SOC_LIST  COL#: 1
        TOTAL ::  LVLS: 1   #LB: 64  #DK: 17487  LB/K: 1  DB/K: 1  CLUF: 699
      INDEX NAME: SOC_LIST_1IX  COL#: 3
        TOTAL ::  LVLS: 1   #LB: 47  #DK: 17487  LB/K: 1  DB/K: 1  CLUF: 14065
    _OPTIMIZER_PERCENT_PARALLEL = 0
    SINGLE TABLE ACCESS PATH
      TABLE: SOC_LIST     ORIG CDN: 17584  ROUNDED CDN: 17584  CMPTD CDN: 17584
      Access path: tsc  Resc:  18  Resp:  18
      ****** trying bitmap/domain indexes ******
      ****** finished trying bitmap/domain indexes ******
      BEST_CST: 18.00  PATH: 2  Degree:  1
    OPTIMIZER STATISTICS AND COMPUTATIONS
    GENERAL PLANS
    Join order[1]:  SOC_LIST[SOC]#0
    Best so far: TABLE#: 0  CST:         18  CDN:      17584  BYTES:          0
    Final - All Rows Plan:
      JOIN ORDER: 1
      CST: 18  CDN: 17584  RSC: 18  RSP: 18  BYTES: 0
      IO-RSC: 18  IO-RSP: 18  CPU-RSC: 0  CPU-RSP: 0
    BINDS #1:
    bind 0: dty=96 mxl=32(01) mal=00 scl=00 pre=00 oacflg=03 oacfl2=0 size=32 offset=0
       bfp=800003ffefea9490 bln=32 avl=01 flg=05
       value="N"
    EXEC #1:c=0,e=152,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=3017698469481
    WAIT #1: nam='SQL*Net message to client' ela= 4 p1=1413697536 p2=1 p3=0
    FETCH #1:c=10000,e=1506,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=4,tim=3017698471536
    WAIT #1: nam='SQL*Net message from client' ela= 2607 p1=1413697536 p2=1 p3=0
    FETCH #1:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=3017698474268
    WAIT #1: nam='SQL*Net message to client' ela= 1 p1=1413697536 p2=1 p3=0
    *** 2013-06-10 13:35:07.656
    WAIT #1: nam='SQL*Net message from client' ela= 22922584 p1=1413697536 p2=1 p3=0
    STAT #1 id=1 cnt=1 pid=0 pos=1 obj=0 op='SORT AGGREGATE (cr=0 r=0 w=0 time=93 us)'
    STAT #1 id=2 cnt=0 pid=1 pos=1 obj=0 op='FILTER  (cr=0 r=0 w=0 time=29 us)'
    STAT #1 id=3 cnt=0 pid=2 pos=1 obj=5769120 op='TABLE ACCESS FULL SOC_LIST '
    =====================
    PARSE ERROR #1:len=369 dep=0 uid=33 oct=0 lid=33 tim=3017721397730 err=900
    exec := 'N'
    SELEC ...
    WAIT #1: nam='SQL*Net break/reset to client' ela= 2 p1=1413697536 p2=1 p3=0
    WAIT #1: nam='SQL*Net break/reset to client' ela= 2403 p1=1413697536 p2=0 p3=0
    WAIT #1: nam='SQL*Net message to client' ela= 3 p1=1413697536 p2=1 p3=0
    *** 2013-06-10 13:35:24.017
    WAIT #1: nam='SQL*Net message from client' ela= 15973854 p1=1413697536 p2=1 p3=0
    QUERY
    SELECT  count(*)
       FROM SOC_LIST SOC
       WHERE
         ( EXISTS(  SELECT  1
                 FROM    ELIGIBILITY_RELATION
                 WHERE   SRC_CODE = 'SHDMM4215'
                      AND   DEST_CODE = SOC.SOC
                   AND   SRC_TYPE = 'P'
                   AND   DEST_TYPE = 'S'))
    UNION ALL
    SELECT count(*)
       FROM SOC_LIST SOC
       WHERE        ( = 'Y')
    =====================
    PARSING IN CURSOR #1 len=353 dep=0 uid=33 oct=3 lid=33 tim=3017737377655 hv=4202798596 ad='45639568'
    SELECT  count(*)
       FROM SOC_LIST SOC
       WHERE
         ( EXISTS(  SELECT  1
                 FROM    ELIGIBILITY_RELATION
                 WHERE   SRC_CODE = 'SHDMM4215'
                      AND   DEST_CODE = SOC.SOC
                   AND   SRC_TYPE = 'P'
                   AND   DEST_TYPE = 'S'))
    UNION ALL
    SELECT count(*)
       FROM SOC_LIST SOC
       WHERE        ( = 'Y')
    END OF STMT
    PARSE #1:c=0,e=2624,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=0,tim=3017737377644
    PARAMETERS USED BY THE OPTIMIZER
    OPTIMIZER_FEATURES_ENABLE = 9.2.0
    OPTIMIZER_MODE/GOAL = Choose
    _OPTIMIZER_PERCENT_PARALLEL = 101
    HASH_AREA_SIZE = 131072
    HASH_JOIN_ENABLED = TRUE
    HASH_MULTIBLOCK_IO_COUNT = 0
    SORT_AREA_SIZE = 65536
    OPTIMIZER_SEARCH_LIMIT = 5
    PARTITION_VIEW_ENABLED = FALSE
    _ALWAYS_STAR_TRANSFORMATION = FALSE
    _B_TREE_BITMAP_PLANS = TRUE
    STAR_TRANSFORMATION_ENABLED = FALSE
    _COMPLEX_VIEW_MERGING = TRUE
    _PUSH_JOIN_PREDICATE = TRUE
    PARALLEL_BROADCAST_ENABLED = TRUE
    OPTIMIZER_MAX_PERMUTATIONS = 2000
    OPTIMIZER_INDEX_CACHING = 0
    _SYSTEM_INDEX_CACHING = 0
    OPTIMIZER_INDEX_COST_ADJ = 1
    OPTIMIZER_DYNAMIC_SAMPLING = 1
    _OPTIMIZER_DYN_SMP_BLKS = 32
    QUERY_REWRITE_ENABLED = TRUE
    QUERY_REWRITE_INTEGRITY = ENFORCED
    _INDEX_JOIN_ENABLED = TRUE
    _SORT_ELIMINATION_COST_RATIO = 0
    _OR_EXPAND_NVL_PREDICATE = TRUE
    _NEW_INITIAL_JOIN_ORDERS = TRUE
    ALWAYS_ANTI_JOIN = CHOOSE
    ALWAYS_SEMI_JOIN = CHOOSE
    _OPTIMIZER_MODE_FORCE = TRUE
    _OPTIMIZER_UNDO_CHANGES = FALSE
    _UNNEST_SUBQUERY = TRUE
    _PUSH_JOIN_UNION_VIEW = TRUE
    _FAST_FULL_SCAN_ENABLED = TRUE
    _OPTIM_ENHANCE_NNULL_DETECTION = TRUE
    _ORDERED_NESTED_LOOP = TRUE
    _NESTED_LOOP_FUDGE = 100
    _NO_OR_EXPANSION = FALSE
    _QUERY_COST_REWRITE = TRUE
    QUERY_REWRITE_EXPRESSION = TRUE
    _IMPROVED_ROW_LENGTH_ENABLED = TRUE
    _USE_NOSEGMENT_INDEXES = FALSE
    _ENABLE_TYPE_DEP_SELECTIVITY = TRUE
    _IMPROVED_OUTERJOIN_CARD = TRUE
    _OPTIMIZER_ADJUST_FOR_NULLS = TRUE
    _OPTIMIZER_CHOOSE_PERMUTATION = 0
    _USE_COLUMN_STATS_FOR_FUNCTION = TRUE
    _SUBQUERY_PRUNING_ENABLED = TRUE
    _SUBQUERY_PRUNING_REDUCTION_FACTOR = 50
    _SUBQUERY_PRUNING_COST_FACTOR = 20
    _LIKE_WITH_BIND_AS_EQUALITY = FALSE
    _TABLE_SCAN_COST_PLUS_ONE = TRUE
    _SORTMERGE_INEQUALITY_JOIN_OFF = FALSE
    _DEFAULT_NON_EQUALITY_SEL_CHECK = TRUE
    _ONESIDE_COLSTAT_FOR_EQUIJOINS = TRUE
    _OPTIMIZER_COST_MODEL = CHOOSE
    _GSETS_ALWAYS_USE_TEMPTABLES = FALSE
    DB_FILE_MULTIBLOCK_READ_COUNT = 128
    _NEW_SORT_COST_ESTIMATE = TRUE
    _GS_ANTI_SEMI_JOIN_ALLOWED = TRUE
    _CPU_TO_IO = 0
    _PRED_MOVE_AROUND = TRUE
    BASE STATISTICAL INFORMATION
    Table stats    Table: ELIGIBILITY_RELATION   Alias: ELIGIBILITY_RELATION
      (Using composite stats)
      (adjusted for partition skews)
      ORIG STATS::  CDN: 11982220  NBLKS:  125493  AVG_ROW_LEN:  71
      PARTCNT::
      PRUNED: 4  ANALYZED: 4  UNANALYZED: 0
      TOTAL ::  CDN: 11982220  NBLKS:  125493  AVG_ROW_LEN:  71
    -- Index stats
      INDEX NAME: ELIGIBILITY_RELATION_1IX  COL#: 3 4 5
        USING COMPOSITE STATS
        TOTAL ::  LVLS: 2   #LB: 38360  #DK: 4164  LB/K: 9  DB/K: 740  CLUF: 3081860
      INDEX NAME: ELIGIBILITY_RELATION_PK  COL#: 2 3 4 5
        USING COMPOSITE STATS
        TOTAL ::  LVLS: 2   #LB: 50740  #DK: 11873160  LB/K: 1  DB/K: 1  CLUF: 9158280
      INDEX NAME: I_SNAP$_ELIGIBILITY_RELATI  COL#: 1
        TOTAL ::  LVLS: 2   #LB: 49600  #DK: 11953600  LB/K: 1  DB/K: 1  CLUF: 8833300
    _OPTIMIZER_PERCENT_PARALLEL = 0
    SINGLE TABLE ACCESS PATH
    Column:   SRC_CODE  Col#: 2      Table: ELIGIBILITY_RELATION   Alias: ELIGIBILITY_RELATION
        NDV: 22087     NULLS: 0         DENS: 4.5276e-05
        NO HISTOGRAM: #BKT: 1 #VAL: 2
    Column:  DEST_CODE  Col#: 4      Table: ELIGIBILITY_RELATION   Alias: ELIGIBILITY_RELATION
        NDV: 11970     NULLS: 0         DENS: 8.3542e-05
        NO HISTOGRAM: #BKT: 1 #VAL: 2
    Column:   SRC_TYPE  Col#: 3      Table: ELIGIBILITY_RELATION   Alias: ELIGIBILITY_RELATION
        NDV: 2         NULLS: 0         DENS: 5.0000e-01
        NO HISTOGRAM: #BKT: 1 #VAL: 2
    Column:  DEST_TYPE  Col#: 5      Table: ELIGIBILITY_RELATION   Alias: ELIGIBILITY_RELATION
        NDV: 2         NULLS: 0         DENS: 5.0000e-01
        NO HISTOGRAM: #BKT: 1 #VAL: 2
      TABLE: ELIGIBILITY_RELATION     ORIG CDN: 11982220  ROUNDED CDN: 1  CMPTD CDN: 0
      Access path: tsc  Resc:  3072  Resp:  3072
      Access path: index (iff)
          Index: ELIGIBILITY_RELATION_PK
      TABLE: ELIGIBILITY_RELATION
          RSC_CPU: 0   RSC_IO: 1243
      IX_SEL:  0.0000e+00  TB_SEL:  1.0000e+00
      Access path: iff  Resc:  1243  Resp:  1243
      Access path: index (unique)
          Index: ELIGIBILITY_RELATION_PK
      TABLE: ELIGIBILITY_RELATION
          RSC_CPU: 0   RSC_IO: 2
      IX_SEL:  8.3457e-08  TB_SEL:  8.3457e-08
      Access path: index (equal)
          Index: ELIGIBILITY_RELATION_1IX
      TABLE: ELIGIBILITY_RELATION
          RSC_CPU: 0   RSC_IO: 68
      IX_SEL:  0.0000e+00  TB_SEL:  2.0886e-05
      Access path: index (eq-unique)
          Index: ELIGIBILITY_RELATION_PK
      TABLE: ELIGIBILITY_RELATION
          RSC_CPU: 0   RSC_IO: 2
      IX_SEL:  0.0000e+00  TB_SEL:  0.0000e+00
      ****** trying bitmap/domain indexes ******
      Access path: index (equal)
          Index: ELIGIBILITY_RELATION_1IX
      TABLE: ELIGIBILITY_RELATION
          RSC_CPU: 0   RSC_IO: 3
      IX_SEL:  2.0886e-05  TB_SEL:  2.0886e-05
      Access path: index (index-only)
          Index: ELIGIBILITY_RELATION_PK
      TABLE: ELIGIBILITY_RELATION
          RSC_CPU: 0   RSC_IO: 5
      IX_SEL:  4.5276e-05  TB_SEL:  4.5276e-05
        SORT resource      Sort statistics
          Sort width:           11 Area size:      628736 Max Area size:    31457280   Degree: 1
          Blocks to Sort:        2 Row size:           21 Rows:        543
          Initial runs:          1 Merge passes:        1 IO Cost / pass:          3
          Total IO sort cost: 2
          Total CPU sort cost: 0
          Total Temp space used: 0
      ****** finished trying bitmap/domain indexes ******
    One row CDN: 1
      BEST_CST: 1.00  PATH: 3  Degree:  1
    OPTIMIZER STATISTICS AND COMPUTATIONS
    GENERAL PLANS
    Join order[1]:  ELIGIBILITY_RELATION[ELIGIBILITY_RELATION]#0
    Best so far: TABLE#: 0  CST:          1  CDN:          1  BYTES:         24
    Final - First Rows Plan:
      JOIN ORDER: 1
      CST: 1  CDN: 1  RSC: 1  RSP: 1  BYTES: 24
      IO-RSC: 1  IO-RSP: 1  CPU-RSC: 0  CPU-RSP: 0
      First Rows Plan
    PARAMETERS USED BY THE OPTIMIZER
    OPTIMIZER_FEATURES_ENABLE = 9.2.0
    OPTIMIZER_MODE/GOAL = Choose
    _OPTIMIZER_PERCENT_PARALLEL = 101
    HASH_AREA_SIZE = 131072
    HASH_JOIN_ENABLED = TRUE
    HASH_MULTIBLOCK_IO_COUNT = 0
    SORT_AREA_SIZE = 65536
    OPTIMIZER_SEARCH_LIMIT = 5
    PARTITION_VIEW_ENABLED = FALSE
    _ALWAYS_STAR_TRANSFORMATION = FALSE
    _B_TREE_BITMAP_PLANS = TRUE
    STAR_TRANSFORMATION_ENABLED = FALSE
    _COMPLEX_VIEW_MERGING = TRUE
    _PUSH_JOIN_PREDICATE = TRUE
    PARALLEL_BROADCAST_ENABLED = TRUE
    OPTIMIZER_MAX_PERMUTATIONS = 2000
    OPTIMIZER_INDEX_CACHING = 0
    _SYSTEM_INDEX_CACHING = 0
    OPTIMIZER_INDEX_COST_ADJ = 1
    OPTIMIZER_DYNAMIC_SAMPLING = 1
    _OPTIMIZER_DYN_SMP_BLKS = 32
    QUERY_REWRITE_ENABLED = TRUE
    QUERY_REWRITE_INTEGRITY = ENFORCED
    _INDEX_JOIN_ENABLED = TRUE
    _SORT_ELIMINATION_COST_RATIO = 0
    _OR_EXPAND_NVL_PREDICATE = TRUE
    _NEW_INITIAL_JOIN_ORDERS = TRUE
    ALWAYS_ANTI_JOIN = CHOOSE
    ALWAYS_SEMI_JOIN = CHOOSE
    _OPTIMIZER_MODE_FORCE = TRUE
    _OPTIMIZER_UNDO_CHANGES = FALSE
    _UNNEST_SUBQUERY = TRUE
    _PUSH_JOIN_UNION_VIEW = TRUE
    _FAST_FULL_SCAN_ENABLED = TRUE
    _OPTIM_ENHANCE_NNULL_DETECTION = TRUE
    _ORDERED_NESTED_LOOP = TRUE
    _NESTED_LOOP_FUDGE = 100
    _NO_OR_EXPANSION = FALSE
    _QUERY_COST_REWRITE = TRUE
    QUERY_REWRITE_EXPRESSION = TRUE
    _IMPROVED_ROW_LENGTH_ENABLED = TRUE
    _USE_NOSEGMENT_INDEXES = FALSE
    _ENABLE_TYPE_DEP_SELECTIVITY = TRUE
    _IMPROVED_OUTERJOIN_CARD = TRUE
    _OPTIMIZER_ADJUST_FOR_NULLS = TRUE
    _OPTIMIZER_CHOOSE_PERMUTATION = 0
    _USE_COLUMN_STATS_FOR_FUNCTION = TRUE
    _SUBQUERY_PRUNING_ENABLED = TRUE
    _SUBQUERY_PRUNING_REDUCTION_FACTOR = 50
    _SUBQUERY_PRUNING_COST_FACTOR = 20
    _LIKE_WITH_BIND_AS_EQUALITY = FALSE
    _TABLE_SCAN_COST_PLUS_ONE = TRUE
    _SORTMERGE_INEQUALITY_JOIN_OFF = FALSE
    _DEFAULT_NON_EQUALITY_SEL_CHECK = TRUE
    _ONESIDE_COLSTAT_FOR_EQUIJOINS = TRUE
    _OPTIMIZER_COST_MODEL = CHOOSE
    _GSETS_ALWAYS_USE_TEMPTABLES = FALSE
    DB_FILE_MULTIBLOCK_READ_COUNT = 128
    _NEW_SORT_COST_ESTIMATE = TRUE
    _GS_ANTI_SEMI_JOIN_ALLOWED = TRUE
    _CPU_TO_IO = 0
    _PRED_MOVE_AROUND = TRUE
    BASE STATISTICAL INFORMATION
    Table stats    Table: SOC_LIST   Alias: SYS_ALIAS_1
      TOTAL ::  CDN: 17584  NBLKS:  653  AVG_ROW_LEN:  260
    -- Index stats
      INDEX NAME: I_SNAP$_SOC_LIST  COL#: 1
        TOTAL ::  LVLS: 1   #LB: 64  #DK: 17487  LB/K: 1  DB/K: 1  CLUF: 699
      INDEX NAME: SOC_LIST_1IX  COL#: 3
        TOTAL ::  LVLS: 1   #LB: 47  #DK: 17487  LB/K: 1  DB/K: 1  CLUF: 14065
    _OPTIMIZER_PERCENT_PARALLEL = 0
    SINGLE TABLE ACCESS PATH
      TABLE: SOC_LIST     ORIG CDN: 17584  ROUNDED CDN: 879  CMPTD CDN: 879
      Access path: tsc  Resc:  18  Resp:  18
      ****** trying bitmap/domain indexes ******
      ****** finished trying bitmap/domain indexes ******
      BEST_CST: 18.00  PATH: 2  Degree:  1
    OPTIMIZER STATISTICS AND COMPUTATIONS
    GENERAL PLANS
    Join order[1]:  SOC_LIST[SYS_ALIAS_1]#0
    Best so far: TABLE#: 0  CST:         18  CDN:        879  BYTES:       8790
    Final - All Rows Plan:
      JOIN ORDER: 1
      CST: 18  CDN: 879  RSC: 18  RSP: 18  BYTES: 8790
      IO-RSC: 18  IO-RSP: 18  CPU-RSC: 0  CPU-RSP: 0
    PARAMETERS USED BY THE OPTIMIZER
    OPTIMIZER_FEATURES_ENABLE = 9.2.0
    OPTIMIZER_MODE/GOAL = Choose
    _OPTIMIZER_PERCENT_PARALLEL = 101
    HASH_AREA_SIZE = 131072
    HASH_JOIN_ENABLED = TRUE
    HASH_MULTIBLOCK_IO_COUNT = 0
    SORT_AREA_SIZE = 65536
    OPTIMIZER_SEARCH_LIMIT = 5
    PARTITION_VIEW_ENABLED = FALSE
    _ALWAYS_STAR_TRANSFORMATION = FALSE
    _B_TREE_BITMAP_PLANS = TRUE
    STAR_TRANSFORMATION_ENABLED = FALSE
    _COMPLEX_VIEW_MERGING = TRUE
    _PUSH_JOIN_PREDICATE = TRUE
    PARALLEL_BROADCAST_ENABLED = TRUE
    OPTIMIZER_MAX_PERMUTATIONS = 2000
    OPTIMIZER_INDEX_CACHING = 0
    _SYSTEM_INDEX_CACHING = 0
    OPTIMIZER_INDEX_COST_ADJ = 1
    OPTIMIZER_DYNAMIC_SAMPLING = 1
    _OPTIMIZER_DYN_SMP_BLKS = 32
    QUERY_REWRITE_ENABLED = TRUE
    QUERY_REWRITE_INTEGRITY = ENFORCED
    _INDEX_JOIN_ENABLED = TRUE
    _SORT_ELIMINATION_COST_RATIO = 0
    _OR_EXPAND_NVL_PREDICATE = TRUE
    _NEW_INITIAL_JOIN_ORDERS = TRUE
    ALWAYS_ANTI_JOIN = CHOOSE
    ALWAYS_SEMI_JOIN = CHOOSE
    _OPTIMIZER_MODE_FORCE = TRUE
    _OPTIMIZER_UNDO_CHANGES = FALSE
    _UNNEST_SUBQUERY = TRUE
    _PUSH_JOIN_UNION_VIEW = TRUE
    _FAST_FULL_SCAN_ENABLED = TRUE
    _OPTIM_ENHANCE_NNULL_DETECTION = TRUE
    _ORDERED_NESTED_LOOP = TRUE
    _NESTED_LOOP_FUDGE = 100
    _NO_OR_EXPANSION = FALSE
    _QUERY_COST_REWRITE = TRUE
    QUERY_REWRITE_EXPRESSION = TRUE
    _IMPROVED_ROW_LENGTH_ENABLED = TRUE
    _USE_NOSEGMENT_INDEXES = FALSE
    _ENABLE_TYPE_DEP_SELECTIVITY = TRUE
    _IMPROVED_OUTERJOIN_CARD = TRUE
    _OPTIMIZER_ADJUST_FOR_NULLS = TRUE
    _OPTIMIZER_CHOOSE_PERMUTATION = 0
    _USE_COLUMN_STATS_FOR_FUNCTION = TRUE
    _SUBQUERY_PRUNING_ENABLED = TRUE
    _SUBQUERY_PRUNING_REDUCTION_FACTOR = 50
    _SUBQUERY_PRUNING_COST_FACTOR = 20
    _LIKE_WITH_BIND_AS_EQUALITY = FALSE
    _TABLE_SCAN_COST_PLUS_ONE = TRUE
    _SORTMERGE_INEQUALITY_JOIN_OFF = FALSE
    _DEFAULT_NON_EQUALITY_SEL_CHECK = TRUE
    _ONESIDE_COLSTAT_FOR_EQUIJOINS = TRUE
    _OPTIMIZER_COST_MODEL = CHOOSE
    _GSETS_ALWAYS_USE_TEMPTABLES = FALSE
    DB_FILE_MULTIBLOCK_READ_COUNT = 128
    _NEW_SORT_COST_ESTIMATE = TRUE
    _GS_ANTI_SEMI_JOIN_ALLOWED = TRUE
    _CPU_TO_IO = 0
    _PRED_MOVE_AROUND = TRUE
    BASE STATISTICAL INFORMATION
    Table stats    Table: SOC_LIST   Alias: SOC
      TOTAL ::  CDN: 17584  NBLKS:  653  AVG_ROW_LEN:  260
    -- Index stats
      INDEX NAME: I_SNAP$_SOC_LIST  COL#: 1
        TOTAL ::  LVLS: 1   #LB: 64  #DK: 17487  LB/K: 1  DB/K: 1  CLUF: 699
      INDEX NAME: SOC_LIST_1IX  COL#: 3
        TOTAL ::  LVLS: 1   #LB: 47  #DK: 17487  LB/K: 1  DB/K: 1  CLUF: 14065
    _OPTIMIZER_PERCENT_PARALLEL = 0
    SINGLE TABLE ACCESS PATH
      TABLE: SOC_LIST     ORIG CDN: 17584  ROUNDED CDN: 17584  CMPTD CDN: 17584
      Access path: tsc  Resc:  18  Resp:  18
      ****** trying bitmap/domain indexes ******
      ****** finished trying bitmap/domain indexes ******
      BEST_CST: 18.00  PATH: 2  Degree:  1
    OPTIMIZER STATISTICS AND COMPUTATIONS
    GENERAL PLANS
    Join order[1]:  SOC_LIST[SOC]#0
    Best so far: TABLE#: 0  CST:         18  CDN:      17584  BYTES:          0
    Final - All Rows Plan:
      JOIN ORDER: 1
      CST: 18  CDN: 17584  RSC: 18  RSP: 18  BYTES: 0
      IO-RSC: 18  IO-RSP: 18  CPU-RSC: 0  CPU-RSP: 0
    BINDS #1:
    bind 0: dty=96 mxl=32(01) mal=00 scl=00 pre=00 oacflg=03 oacfl2=0 size=32 offset=0
       bfp=800003ffefea9490 bln=32 avl=01 flg=05
       value="N"
    EXEC #1:c=0,e=159,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=3017737385286
    WAIT #1: nam='SQL*Net message to client' ela= 2 p1=1413697536 p2=1 p3=0
    WAIT #1: nam='db file sequential read' ela= 9958 p1=586 p2=128001 p3=1
    WAIT #1: nam='db file scattered read' ela= 619 p1=586 p2=128002 p3=4
    WAIT #1: nam='db file sequential read' ela= 12880 p1=2535 p2=39498 p3=1
    WAIT #1: nam='db file sequential read' ela= 39878 p1=2536 p2=68185 p3=1
    WAIT #1: nam='db file sequential read' ela= 10240 p1=2536 p2=68520 p3=1
    WAIT #1: nam='db file sequential read' ela= 15805 p1=2535 p2=45162 p3=1
    WAIT #1: nam='db file sequential read' ela= 11733 p1=2535 p2=178335 p3=1
    WAIT #1: nam='db file sequential read' ela= 11863 p1=2535 p2=178798 p3=1
    WAIT #1: nam='db file sequential read' ela= 4886 p1=2535 p2=33834 p3=1
    WAIT #1: nam='db file sequential read' ela= 12067 p1=2536 p2=60958 p3=1
    WAIT #1: nam='db file sequential read' ela= 16496 p1=2535 p2=61232 p3=1
    WAIT #1: nam='db file sequential read' ela= 8970 p1=2535 p2=50826 p3=1
    WAIT #1: nam='db file sequential read' ela= 10940 p1=2536 p2=260451 p3=1
    WAIT #1: nam='db file sequential read' ela= 8508 p1=2536 p2=261538 p3=1
    WAIT #1: nam='db file scattered read' ela= 32000 p1=1613 p2=4622 p3=35
    WAIT #1: nam='db file sequential read' ela= 1762 p1=2535 p2=178799 p3=1
    WAIT #1: nam='db file sequential read' ela= 341 p1=2535 p2=61233 p3=1
    WAIT #1: nam='db file scattered read' ela= 50494 p1=957 p2=230324 p3=35
    WAIT #1: nam='db file scattered read' ela= 36716 p1=5 p2=588169 p3=35
    WAIT #1: nam='db file scattered read' ela= 45241 p1=2326 p2=227427 p3=35
    WAIT #1: nam='db file sequential read' ela= 11783 p1=2535 p2=68809 p3=1
    WAIT #1: nam='db file scattered read' ela= 26720 p1=471 p2=102809 p3=35
    WAIT #1: nam='db file scattered read' ela= 31074 p1=1496 p2=97015 p3=35
    WAIT #1: nam='db file scattered read' ela= 39750 p1=586 p2=69452 p3=35
    WAIT #1: nam='db file scattered read' ela= 30923 p1=1613 p2=8636 p3=35
    WAIT #1: nam='db file scattered read' ela= 46328 p1=957 p2=67050 p3=35
    WAIT #1: nam='db file scattered read' ela= 34570 p1=5 p2=362823 p3=35
    WAIT #1: nam='db file scattered read' ela= 43343 p1=2326 p2=240311 p3=35
    WAIT #1: nam='db file scattered read' ela= 30818 p1=471 p2=76417 p3=35
    WAIT #1: nam='db file scattered read' ela= 19167 p1=1496 p2=480612 p3=35
    WAIT #1: nam='db file scattered read' ela= 26405 p1=586 p2=193036 p3=35
    WAIT #1: nam='db file scattered read' ela= 35374 p1=1613 p2=201565 p3=35
    WAIT #1: nam='db file scattered read' ela= 14275 p1=957 p2=15804 p3=7
    FETCH #1:c=190000,e=926019,p=552,cr=43429,cu=0,mis=0,r=1,dep=0,og=4,tim=3017738311433
    WAIT #1: nam='SQL*Net message from client' ela= 2749 p1=1413697536 p2=1 p3=0
    WAIT #1: nam='SQL*Net message to client' ela= 2 p1=1413697536 p2=1 p3=0
    FETCH #1:c=0,e=79,p=0,cr=0,cu=0,mis=0,r=1,dep=0,og=4,tim=3017738314443
    *** 2013-06-10 13:35:44.078
    WAIT #1: nam='SQL*Net message from client' ela= 18650883 p1=1413697536 p2=1 p3=0
    STAT #1 id=1 cnt=2 pid=0 pos=1 obj=0 op='UNION-ALL  (cr=43429 r=552 w=0 time=926047 us)'
    STAT #1 id=2 cnt=1 pid=1 pos=1 obj=0 op='SORT AGGREGATE (cr=43429 r=552 w=0 time=925989 us)'
    STAT #1 id=3 cnt=157 pid=2 pos=1 obj=0 op='FILTER  (cr=43429 r=552 w=0 time=925909 us)'
    STAT #1 id=4 cnt=14296 pid=3 pos=1 obj=5769120 op='TABLE ACCESS FULL SOC_LIST (cr=541 r=537 w=0 time=579577 us)'
    STAT #1 id=5 cnt=157 pid=3 pos=2 obj=0 op='PARTITION HASH SINGLE PARTITION: KEY KEY (cr=42888 r=15 w=0 time=285564 us)'
    STAT #1 id=6 cnt=157 pid=5 pos=1 obj=5401812 op='INDEX UNIQUE SCAN ELIGIBILITY_RELATION_PK PARTITION: KEY KEY (cr=42888 r=15 w=0 time=265355 us)'
    STAT #1 id=7 cnt=1 pid=1 pos=2 obj=0 op='SORT AGGREGATE (cr=0 r=0 w=0 time=4 us)'
    STAT #1 id=8 cnt=0 pid=7 pos=1 obj=0 op='FILTER  (cr=0 r=0 w=0 time=1 us)'
    STAT #1 id=9 cnt=0 pid=8 pos=1 obj=5769120 op='TABLE ACCESS FULL SOC_LIST '
    QUERY
    select 'close cursor' from dual
    =====================
    PARSING IN CURSOR #1 len=31 dep=0 uid=33 oct=3 lid=33 tim=3017756967074 hv=3487944275 ad='48de6a60'
    select 'close cursor' from dual
    END OF STMT
    PARSE #1:c=0,e=986,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=4,tim=3017756967063
    BINDS #1:
    EXEC #1:c=0,e=47,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=3017756967278
    WAIT #1: nam='SQL*Net message to client' ela= 3 p1=1413697536 p2=1 p3=0
    FETCH #1:c=0,e=134,p=0,cr=3,cu=0,mis=0,r=1,dep=0,og=4,tim=3017756967515
    WAIT #1: nam='SQL*Net message from client' ela= 2682 p1=1413697536 p2=1 p3=0
    FETCH #1:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=3017756970325
    WAIT #1: nam='SQL*Net message to client' ela= 1 p1=1413697536 p2=1 p3=0
    *** 2013-06-10 13:35:57.804
    WAIT #1: nam='SQL*Net message from client' ela= 13399621 p1=1413697536 p2=1 p3=0
    =====================
    PARSING IN CURSOR #3 len=116 dep=1 uid=0 oct=3 lid=0 tim=3017770371839 hv=431456802 ad='39fbad80'
    select o.owner#,o.name,o.namespace,o.remoteowner,o.linkname,o.subname,o.dataobj#,o.flags from obj$ o where o.obj#=:1
    END OF STMT
    PARSE #3:c=0,e=1249,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=0,tim=3017770371828
    BINDS #3:
    bind 0: dty=2 mxl=22(22) mal=00 scl=00 pre=00 oacflg=08 oacfl2=1 size=24 offset=0
       bfp=800003ffefea7a90 bln=22 avl=03 flg=05
       value=172
    EXEC #3:c=0,e=666,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=4,tim=3017770372725
    WAIT #3: nam='db file sequential read' ela= 10318 p1=1 p2=978 p3=1
    WAIT #3: nam='db file sequential read' ela= 10292 p1=1 p2=318 p3=1
    FETCH #3:c=10000,e=21071,p=2,cr=3,cu=0,mis=0,r=1,dep=1,og=4,tim=3017770393830
    STAT #1 id=1 cnt=1 pid=0 pos=1 obj=172 op='TABLE ACCESS FULL DUAL (cr=3 r=0 w=0 time=121 us)'
    QUERY
    ALTER SESSION SET EVENTS '10053 trace name context off'
    =====================
    PARSING IN CURSOR #1 len=55 dep=0 uid=33 oct=42 lid=33 tim=3017770394351 hv=3500836485 ad='3bed84c8'
    ALTER SESSION SET EVENTS '10053 trace name context off'
    END OF STMT
    PARSE #1:c=0,e=227,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=4,tim=3017770394344
    BINDS #1:
    EXEC #1:c=0,e=177,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=3017770394624
    WAIT #1: nam='SQL*Net message to client' ela= 4 p1=1413697536 p2=1 p3=0
    *** 2013-06-10 13:36:13.139
    WAIT #1: nam='SQL*Net message from client' ela= 14951473 p1=1413697536 p2=1 p3=0
    =====================
    PARSE ERROR #1:len=55 dep=0 uid=33 oct=42 lid=33 tim=3017785346905 err=911
    ALTER SESSION SET EVENT=¿10046 trace name context off¿
    WAIT #1: nam='SQL*Net break/reset to client' ela= 2 p1=1413697536 p2=1 p3=0
    WAIT #1: nam='SQL*Net break/reset to client' ela= 2358 p1=1413697536 p2=0 p3=0
    WAIT #1: nam='SQL*Net message to client' ela= 3 p1=1413697536 p2=1 p3=0
    *** 2013-06-10 13:36:53.497
    WAIT #1: nam='SQL*Net message from client' ela= 39408861 p1=1413697536 p2=1 p3=0
    =====================
    PARSE ERROR #1:len=56 dep=0 uid=33 oct=42 lid=33 tim=3017824759339 err=911
    ALTER SESSION SET EVENTS ¿10046 trace name context off¿
    WAIT #1: nam='SQL*Net break/reset to client' ela= 4 p1=1413697536 p2=1 p3=0
    WAIT #1: nam='SQL*Net break/reset to client' ela= 2342 p1=1413697536 p2=0 p3=0
    WAIT #1: nam='SQL*Net message to client' ela= 4 p1=1413697536 p2=1 p3=0
    *** 2013-06-10 13:37:17.528
    WAIT #1: nam='SQL*Net message from client' ela= 23463963 p1=1413697536 p2=1 p3=0
    =====================
    PARSE ERROR #1:len=57 dep=0 uid=33 oct=42 lid=33 tim=3017848226738 err=911
    ALTER SESSION SET EVENTS '10043 trace name context off';
    WAIT #1: nam='SQL*Net break/reset to client' ela= 1 p1=1413697536 p2=1 p3=0
    WAIT #1: nam='SQL*Net break/reset to client' ela= 2305 p1=1413697536 p2=0 p3=0
    WAIT #1: nam='SQL*Net message to client' ela= 3 p1=1413697536 p2=1 p3=0
    WAIT #1: nam='SQL*Net message from client' ela= 9416071 p1=1413697536 p2=1 p3=0
    =====================
    PARSING IN CURSOR #1 len=55 dep=0 uid=33 oct=42 lid=33 tim=3017857646552 hv=2635134026 ad='4b92b7e8'
    ALTER SESSION SET EVENTS '10043 trace name context off'
    END OF STMT
    PARSE #1:c=0,e=616,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=4,tim=3017857646541
    BINDS #1:
    EXEC #1:c=0,e=285,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=3017857647009
    WAIT #1: nam='SQL*Net message to client' ela= 4 p1=1413697536 p2=1 p3=0
    *** 2013-06-10 13:58:46.112
    WAIT #1: nam='SQL*Net message from client' ela= 1248974802 p1=1413697536 p2=1 p3=0
    XCTEND rlbk=0, rd_only=1

  • XPath Exception on Bursting Control File Template Filter Expression

    I am getting the following exception for this bursting control file in EBS 11.5.10.2 on the template filter expression:
    oracle.xml.parser.v2.XPathException: Unknown expression at EOF: (./XXCUS_DIST_CODE='P')[1].
    <?xml version="1.0" encoding="UTF-8"?>
    <xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi">
         <xapi:request select="/XXCUS_RAXINV/LIST_G_DIST/G_DIST">
              <xapi:delivery>
                   <xapi:email server="${XXCUS_EMAIL_SERVER}" port="${XXCUS_EMAIL_PORT}" from="[email protected]">
                        <xapi:message id="einv" to="[email protected]" bcc="[email protected]" content-type="text/html" attachment="true" subject="Invoice ${LIST_G_INVOICE/G_INVOICE/TRX_NUMBER}">
    <![CDATA[
    <html>
    <body>
    Message
    </body>
    </html>
    ]]>
                        </xapi:message>
                   </xapi:email>
              </xapi:delivery>
              <xapi:document output="Invoice_${LIST_G_INVOICE/G_INVOICE/CUSTOMER_NUMBER}_${LIST_G_INVOICE/G_INVOICE/TRX_NUMBER}" output-type="pdf" delivery="einv">
                   <xapi:template type="xsl-fo" location="xdo://XXCUS.XXCUS_COMMON_RAXINV.en.US/?getSource=true" filter="./XXCUS_DIST_CODE='E'" />
              </xapi:document>
         </xapi:request>
         <xapi:request select="/XXCUS_RAXINV/LIST_G_DIST/G_DIST">
              <xapi:delivery>
                   <xapi:print id="print" printer="${XXCUS_PRINTER_NAME}" />
              </xapi:delivery>
              <xapi:document output-type="pdf" delivery="print">
                   <xapi:template type="xsl-fo" location="xdo://XXCUS.XXCUS_COMMON_RAXINV.en.US/?getSource=true" filter="./XXCUS_DIST_CODE='P'" />
              </xapi:document>
         </xapi:request>
    </xapi:requestset>According to the docs, you can use any valid XPath expression. Any idea on what might be wrong here? I am trying to exclusively print or email based on the data. Currently, it prints AND emails all documents regardless of the value of XXCUS_DIST_CODE.
    Thanks,
    Kurz

    Error lies on this line --- filter="./XXCUS_DIST_CODE='P'"
    you need to use it like this --
    Suppose you want condition on name in following XML Struction
    <STUDENT>
    <Name> Jatin </NAME>
    </STUDENT>
    the it should be ...
    filter=".//<STUDENT>[NAME = 'Jatin']"
    Not in your case ui suppose it should be filter=".//XXCUS_RAXINV/LIST_G_DIST/G_DIST[XXCUS_DIST_CODE='P']".
    Hope it solves the problem.

  • How can I join/Full outer join two different columns instead of union all?

    Hi,
    I have a scenario as the following:
    I am performing set operations using obiee 11g where I want to take values from two different criteria. Howwver, I dont want union to take place, instead i want join to take place to see all the columns in the output.
    For that, I tried changing the sql in advanced tab and tried to put full outer join instead of union all but its not allowing me to change.
    How can I achieve it? please help.
    Thanks.

    Hi,
    My problem is that I am unable to modify the sql in advanced tab. Probably due to some security reason,it's restricting me to change.
    Can you suggest me a way to change it?
    Thanks..

  • Order by decode statement with Union all

    Hi
    I use Database Version: Oracle 9.2.0.1.0
    OCI version 9.2
    I try to use order by decode while i have a select base on union and I get en error:
    ORA-01785: ORDER BY item must be the number of a SELECT-list expression
    Here is my code:
    select catalog_type, catalog_id, item_id, item_name
    from items_catalog
    union all
    select catalog_type, catalog_id, organisation_unit_id, organisation_unit_name
    from units_catalog
    order by decode(catalog_type, 1, item_id, organisation_unit_id)
    If I use the decode on a select statement without union, it works.
    What I have to do in order to make it work on union all select?
    Tnx

    Hi,
    Here's a slightly different way:
    COLUMN     sort_key   NOPRINT
    VARIABLE     catalog_type_wanted     VARCHAR2 (5)
    EXEC         :catalog_type_wanted := '4'; 
    SELECT       catalog_id, item_id, item_name
    ,       CASE
               WHEN  :catalog_type_wanted = '1'  THEN  '1'
                                               ELSE  '2'
           END || item_id          AS sort_key
    FROM       items_catalog
          UNION ALL
    SELECT    catalog_id, organisation_unit_id, organisation_unit_name
    ,       CASE
               WHEN  :catalog_type_wanted = '1'  THEN  '2'
                                               ELSE  '1'
           END || organisation_unit_name     AS sort_key
    FROM       units_catalog
    ORDER BY  sort_key
    ;This way guarantees that (for example) 'SHOP50' comes before 'SHOP58', whether or not they are in the first half of the output or the second half.
    Notice that this uses the SQL*Plus COLUMN ... NOPRINT command to hide the sort_key column.
    If you're not using SQL*Plus, then whatever front end you are using may have a similar feature.
    If not, then you can do the UNION in a sub-query, as Daniel did, but do the ORDER BY in the main query (only).

  • Union All slow with order by

    I have 2 queries that I do an "union all" and then an order by after the "union all" This seems to be extremely slow. But when I run the queries individually, they are really fast. Could some help me out with this please.
    SELECT *
      FROM (SELECT a.*, ROWNUM rnum
              FROM (SELECT   COLS......
        FROM (((SELECT  from tables with joins)
               UNION ALL
               (SELECT from tables and view with joins))
                order by colname)
          ) a
             WHERE ROWNUM <= 500)
    WHERE rnum >= 1
    PLAN_TABLE_OUTPUT
    Plan hash value: 3988534528
    | Id  | Operation                                      | Name                          | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT                               |                               |   500 |  1600K|       |  3634M  (1)|999:59:59 |       |       |
    |*  1 |  VIEW                                          |                               |   500 |  1600K|       |  3634M  (1)|999:59:59 |       |       |
    |*  2 |   COUNT STOPKEY                                |                               |       |       |       |            |          |       |       |
    |   3 |    VIEW                                        |                               |  4277K|    13G|       |  3634M  (1)|999:59:59 |       |       |
    |*  4 |     SORT ORDER BY STOPKEY                      |                               |  4277K|   311M|  1095M|  3634M  (1)|999:59:59 |       |       |
    |   5 |      UNION-ALL                                 |                               |       |       |       |            |          |       |       |
    PLAN_TABLE_OUTPUT
    |*  6 |       FILTER                                   |                               |       |       |       |            |          |       |       |
    |*  7 |        HASH JOIN                               |                               |   212K|    15M|       |   153K  (1)| 00:03:37 |       |       |
    |*  8 |         HASH JOIN RIGHT OUTER                  |                               |   507 | 22308 |       |     6  (17)| 00:00:01 |       |       |
    |   9 |          TABLE ACCESS FULL                     | DIR                           |   143 |  3861 |       |     2   (0)| 00:00:01 |       |       |
    |  10 |          TABLE ACCESS FULL                     | USER                          |   507 |  8619 |       |     3   (0)| 00:00:01 |       |       |
    |  11 |         PARTITION RANGE ITERATOR               |                               |   212K|  6645K|       |   153K  (1)| 00:03:37 |   KEY |   KEY |
    |  12 |          TABLE ACCESS BY LOCAL INDEX ROWID     | FL                                |   212K|  6645K|       |   153K  (1)| 00:03:37 |   KEY |   KEY |
    |* 13 |           INDEX RANGE SCAN                     | I_FL_ID                      |   382K|       |       | 38943   (2)| 00:00:56 |   KEY |   KEY |
    |* 14 |            COUNT STOPKEY                       |                               |       |       |       |            |          |       |       |
    |* 15 |             FILTER                             |                               |       |       |       |            |          |       |       |
    |  16 |              PARTITION RANGE ITERATOR          |                               |     1 |    22 |       |   856   (1)| 00:00:02 |   KEY |   KEY |
    PLAN_TABLE_OUTPUT
    |* 17 |               TABLE ACCESS BY LOCAL INDEX ROWID| PAY                           |     1 |    22 |       |   856   (1)| 00:00:02 |   KEY |   KEY |
    |* 18 |                INDEX RANGE SCAN                | I_PAY_FLID                       |     1 |       |       |   855   (1)| 00:00:02 |   KEY |   KEY |
    |* 19 |       FILTER                                   |                               |       |       |       |            |          |       |       |
    |* 20 |        HASH JOIN RIGHT OUTER                   |                               | 25019 |  3029K|       |   138K  (1)| 00:03:17 |       |       |
    |  21 |         TABLE ACCESS FULL                      | DIR                            |   143 |  3861 |       |     2   (0)| 00:00:01 |       |       |
    |* 22 |         HASH JOIN                              |                               | 25019 |  2369K|       |   138K  (1)| 00:03:17 |       |       |
    |  23 |          TABLE ACCESS FULL                     | USER                          |   507 |  8619 |       |     3   (0)| 00:00:01 |       |       |
    |* 24 |          HASH JOIN                             |                               | 25019 |  1954K|       |   138K  (1)| 00:03:17 |       |       |
    |  25 |           INDEX FULL SCAN                      | PK_HO                         |   278 |  1112 |       |     1   (0)| 00:00:01 |       |       |
    |* 26 |           HASH JOIN                            |                               | 25019 |  1856K|       |   138K  (1)| 00:03:17 |       |       |
    |  27 |            INDEX FULL SCAN                     | PK_HO                         |   278 |  1112 |       |     1   (0)| 00:00:01 |       |       |
    PLAN_TABLE_OUTPUT
    |  28 |            NESTED LOOPS                        |                               | 25019 |  1759K|       |   138K  (1)| 00:03:17 |       |       |
    |  29 |             PARTITION RANGE ITERATOR           |                               | 25018 |   830K|       | 63575   (1)| 00:01:30 |   KEY |   KEY |
    |* 30 |              TABLE ACCESS BY LOCAL INDEX ROWID | PAY                           | 25018 |   830K|       | 63575   (1)| 00:01:30 |   KEY |   KEY |
    |* 31 |               INDEX RANGE SCAN                 | I_PAY_TIME_ID                  |  1493K|       |       |  9052   (2)| 00:00:13 |   KEY |   KEY |
    |* 32 |             TABLE ACCESS BY GLOBAL INDEX ROWID | FL                            |     1 |    38 |       |     3   (0)| 00:00:01 | ROWID | ROWID |
    |* 33 |              INDEX UNIQUE SCAN                 | PK_FL                         |     1 |       |       |     2   (0)| 00:00:01 |       |       |
      SELECT *
      FROM (SELECT a.*, ROWNUM rnum
              FROM ( SELECT  from tables with joins order by colname) a
             WHERE ROWNUM <= 500)
    WHERE rnum >= 1
    PLAN_TABLE_OUTPUT
    Plan hash value: 3503998222
    | Id  | Operation                                     | Name                    | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT                              |                         |   500 |  1228K|   222K  (1)| 00:05:15 |       |       |
    |*  1 |  VIEW                                         |                         |   500 |  1228K|   222K  (1)| 00:05:15 |       |       |
    |*  2 |   COUNT STOPKEY                               |                         |       |       |            |          |       |       |
    |   3 |    VIEW                                       |                         |   520 |  1271K|   222K  (1)| 00:05:15 |       |       |
    |*  4 |     FILTER                                    |                         |       |       |            |          |       |       |
    |   5 |      NESTED LOOPS OUTER                       |                         |    26 |  1976 |    54   (0)| 00:00:01 |       |       |
    PLAN_TABLE_OUTPUT
    |   6 |       NESTED LOOPS                            |                         |    26 |  1274 |    48   (0)| 00:00:01 |       |       |
    |   7 |        PARTITION RANGE ITERATOR               |                         |   212K|  6645K|    22   (0)| 00:00:01 |   KEY |   KEY |
    |   8 |         TABLE ACCESS BY LOCAL INDEX ROWID     | FL                      |   212K|  6645K|    22   (0)| 00:00:01 |   KEY |   KEY |
    |*  9 |          INDEX RANGE SCAN                     | I_FL_START_ID              |    47 |       |     8   (0)| 00:00:01 |   KEY |   KEY |
    |* 10 |           COUNT STOPKEY                       |                         |       |       |            |          |       |       |
    |* 11 |            FILTER                             |                         |       |       |            |          |       |       |
    |  12 |             PARTITION RANGE ITERATOR          |                         |     1 |    22 |   856   (1)| 00:00:02 |   KEY |   KEY |
    |* 13 |              TABLE ACCESS BY LOCAL INDEX ROWID| PAY                   |     1 |    22 |   856   (1)| 00:00:02 |   KEY |   KEY |
    |* 14 |               INDEX RANGE SCAN                | I_PAY_ID               |     1 |       |   855   (1)| 00:00:02 |   KEY |   KEY |
    |  15 |        TABLE ACCESS BY INDEX ROWID            | USER                     |     1 |    17 |     1   (0)| 00:00:01 |       |       |
    |* 16 |         INDEX UNIQUE SCAN                     | PK_USER                  |     1 |       |     0   (0)| 00:00:01 |       |       |
    PLAN_TABLE_OUTPUT
    |  17 |       TABLE ACCESS BY INDEX ROWID             | DIR                    |     1 |    27 |     1   (0)| 00:00:01 |       |       |
    |* 18 |        INDEX UNIQUE SCAN                      | PK_DIR                 |     1 |       |     0   (0)| 00:00:01 |       |       |
       SELECT *
      FROM (SELECT a.*, ROWNUM rnum
              FROM ( SELECT from tables and view with joins order by colname) a
             WHERE ROWNUM <= 500)
    WHERE rnum >= 1
    PLAN_TABLE_OUTPUT
    Plan hash value: 1786470271
    | Id  | Operation                                   | Name                          | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | SELECT STATEMENT                            |                               |   500 |  1600K|  1696   (1)| 00:00:03 |       |       |
    |*  1 |  VIEW                                       |                               |   500 |  1600K|  1696   (1)| 00:00:03 |       |       |
    |*  2 |   COUNT STOPKEY                             |                               |       |       |            |          |       |       |
    |   3 |    VIEW                                     |                               |   501 |  1596K|  1696   (1)| 00:00:03 |       |       |
    |*  4 |     FILTER                                  |                               |       |       |            |          |       |       |
    |   5 |      NESTED LOOPS                           |                               |   501 | 60120 |  1696   (1)| 00:00:03 |       |       |
    PLAN_TABLE_OUTPUT
    |   6 |       NESTED LOOPS                          |                               |   501 | 58116 |  1696   (1)| 00:00:03 |       |       |
    |   7 |        NESTED LOOPS OUTER                   |                               |   501 | 56112 |  1695   (1)| 00:00:03 |       |       |
    |   8 |         NESTED LOOPS                        |                               |   501 | 42585 |  1689   (1)| 00:00:03 |       |       |
    |   9 |          NESTED LOOPS                       |                               |   501 | 34068 |  1550   (1)| 00:00:03 |       |       |
    |  10 |           PARTITION RANGE ITERATOR          |                               |   829K|    23M|    42   (0)| 00:00:01 |   KEY |   KEY |
    |  11 |            TABLE ACCESS BY LOCAL INDEX ROWID| PAY                        |   829K|    23M|    42   (0)| 00:00:01 |   KEY |   KEY |
    |* 12 |             INDEX RANGE SCAN                | I_PAY_TIME_ID               |   902 |       |     9   (0)| 00:00:01 |   KEY |   KEY |
    |* 13 |           TABLE ACCESS BY GLOBAL INDEX ROWID| FL                               |     1 |    38 |     3   (0)| 00:00:01 | ROWID | ROWID |
    |* 14 |            INDEX UNIQUE SCAN                | PK_FL                            |     1 |       |     2   (0)| 00:00:01 |       |       |
    |  15 |          TABLE ACCESS BY INDEX ROWID        | USER                              |     1 |    17 |     1   (0)| 00:00:01 |       |       |
    |* 16 |           INDEX UNIQUE SCAN                 | PK_USER                           |     1 |       |     0   (0)| 00:00:01 |       |       |
    PLAN_TABLE_OUTPUT
    |  17 |         TABLE ACCESS BY INDEX ROWID         | DIR                          |     1 |    27 |     1   (0)| 00:00:01 |       |       |
    |* 18 |          INDEX UNIQUE SCAN                  | PK_DIR                          |     1 |       |     0   (0)| 00:00:01 |       |       |
    |* 19 |        INDEX UNIQUE SCAN                    | PK_HO                         |     1 |     4 |     0   (0)| 00:00:01 |       |       |
    |* 20 |       INDEX UNIQUE SCAN                     | PK_HO                         |     1 |     4 |     0   (0)| 00:00:01 |       |       |
    ---------------------------------------------------------------------------------------------------------------------------------------------

    Can you limit the number of rows coming out of each part of the UNION ALL before limiting the number of rows you're trying to return? So that you end up with something like
    SELECT *
      FROM (<<Get first 500 rows from first query>>
           UNION ALL
           <<Get first 500 rows from second query>>)
    WHERE rownum <= 500It appears from the query plan that your problem is that Oracle is sorting the entire result of the UNION ALL before finding the first 500 rows. That's obviously rather time consuming since the two queries return 10's of GB of data. Individually, the two queries are fast because you're limiting each of them to 500 rows, so Oracle can do a quick index scan (presumably on the sort column) that would find those rows.
    And depending on what's behind the queries, I'd look to see whether you can put some additional filter conditions in place to look for data with dates in the past day or two in order to at least limit the worst case if Oracle does have to sort everything.
    Justin

Maybe you are looking for

  • How do I save a frame of video from Final Cut X to my computer?

    I am trying to save a single frame from my storyline to my computer. I used to know how to do this until they updated Final Cut X and now I can't find the option in the menues anymore. Can anybody please help me?? I am working on a project and I real

  • How to create abapProxy without ESR connection

    I use local object in sproxy and i want to copy a local object service..but i cannot copy it because when i do right click,in context menu copy option doesnt exist.. is it possible to create abap proxy without Integration Builder?and how can i do it?

  • T61 Wlan freeze, System slow down

    Hi,  everytime i connect via wlan at my university my  wlan freezes after 20-50 minutes(Wlan -LED turns off, AC do not react, hole fu**in windows gets slow). this suxx, cause when i try to search something on e.g wiki i have to reboot first. this mak

  • Why is my 40GB only showing 16.0GB even after restoring it

    please help me, I've now tried everything, my 40GB just one day showed a unhappy ipod with !, so i rebooted it, restored it, and it now only shows 16Gb capacity and available. Where has the rest gone? Is there anything i can do?

  • Is there any way to restore a vi from a stand alone application

    I was trying to setup a datasocket write from a vi and was going to test the datasocket read. I received about 5 "Insane errors" when I hit run that seemed to reference Fieldpoint(the main vi reads from Fieldpoint). Completely bombed me out of labvie