Query Performance Problem!! Oracle 25 minutes || SQLServer 3 minutes

Hi all,
I'm having a performance problem with this query bellow. It runs in 3 minutes on SQLServer and 25 minutes in Oracle.
SELECT
CASE WHEN (GROUPING(a.estado) = 1) THEN 'TOTAL'
ELSE ISNULL(a.estado, 'UNKNOWN')
END AS estado,
CASE WHEN (GROUPING(m.id_plano) = 1) THEN 'GERAL'
ELSE ISNULL(m.id_plano, 'UNKNOWN')
END AS id_plano,
sum(m.valor_2s_parcelas) valor_2s_parcelas,
convert(decimal(15,2),convert(int,sum(convert(int,(m.valor_2s_parcelas+.0000000001)*100)*
isnull(e.percentual,0.0))/100.0+.0000000001))/100 BB_Educar
FROM
movimento_dco m ,
evento_plano e,
agencia_tb a
WHERE
m.id_plano = e.id_plano
AND m.agencia *= a.prefixo
--AND  m.id_plano LIKE     'pm60%'
AND m.data_pagamento >= '20070501'
AND m.data_pagamento <= '20070531'
AND m.codigo_retorno = '00'
AND m.id_parcela > 1
AND m.valor_2s_parcelas > 0.
AND e.id_evento = 'BB-Educar'
AND a.banco_id = '001'
AND a.ordem = '00'
group by m.id_plano, a.estado WITH ROLLUP
order by a.estado, m.id_plano DESC
Can anyone help me with this query?

What version of Oracle, what version of SQL? Are the tables the same exact size? are they both indexed the same? Are you running on the some or similar hardware? Are the Oracle parameters similar like SGA size and PGA_AGGREGATE Target? Did you run statistics in Oracle?
Did you compare execution plans in SQL Server vs Oracle to see if SQl Servers execution plan is more superior than the one Oracle is trying to use? (most likely stale statistics).
There are many variables and we need more information than just the Query : ).

Similar Messages

  • Query performance problem

    I am having performance problems executing a query.
    System:
    Windows 2003 EE
    Oracle 9i version 9.2.0.6
    DETAIL table with 120Million rows partitioned in 19 partitions by SD_DATEKEY field
    We are trying to retrieve the info from an account (SD_KEY) ordered by date (SD_DATEKEY). This account has about 7000 rows and it takes about 1 minute to return the first 100 rows ordered by SD_DATEKEY. This time should be around 5 seconds to be acceptable.
    There is a partitioned index by SD_KEY and SD_DATEKEY.
    This is the query:
    SELECT * FROM DETAIL WHERE SD_KEY = 'xxxxxxxx' AND ROWNUM < 101 ORDER BY SD_DATEKEY
    The problem is that all the 7000 rows are read prior to be ordered. I think that it is not necessary for the optimizer to access all the partitions to read all the rows because only the first 100 are needed and the partitions are bounded by SD_DATEKEY.
    Any idea to accelerate this query? I know that including a WHERE clause for SD_DATEKEY will increase the performance but I need the first 100 rows and I don't know the date to limit the query.
    Anybody knows if this time is a normal response time for tis query or should it be improved?
    Thank to all in advance for the future help.

    Thank to all for the replies.
    - We have computed statistics and no changes in the response time.
    - We are discussing about restrict the query to some partitions but for the moment this is not the best solution because we don't know where are the latest 100 rows.
    - The query from Maurice had the same response time (more or less)
    select * from
    (SELECT * FROM DETAIL WHERE SD_KEY = 'xxxxxxxx' ORDER BY SD_DATEKEY)
    where ROWNUM < 101
    - We have a local index on SD_DATEKEY. Do we need another one on SD_KEY? Should it be created as BITMAP?
    I can't test inmediately your sugestions because this is a problem with one of our customers. In our test system (that has only 10Million records) the indexes accelerate the query but this is not the same in the customer system. I think the problem is the total records on the table.

  • Performance Problem, RPC Call auf SQLServer 2000

    Hi,
    we have a performance problem with SQLServer 2000. We use Bea WLS 6.1, SQLServer
    2000, and JDBC Driver mssqlserver4v65.jar from Bea.
    we use this for performance optimization as in Documetation at
    "http://www.datadirect-technologies.com/download/docs/jdbc/Jdbcref/jdbcdesign.html"
    case 2
    Stored Procedure can be optimized to use a server-side RPC. Because the application
    calls the procedure by name and the argument values are already encoded, the load
    on the database server is less
    CallableStatement cstmt = conn.prepareCall ("Call getCustName (?)");
    cstmt.setLong (1,12345);
    ResultSet rs = cstmt.executeQuery();
    But the checking in the SQlServer 2000 with SQL Profiler don't show the use of
    RPC Call.
    I can test the different from Query Analyser:
    exec IF_GetBueroStatistik 1 -> SQLProfiler: SQL:BatchCompleted
    {call IF_GetBueroStatistik(1)} -> SQlProfiler: RPC:Completed
    But the Call from Bea Aplication make in SQlProfiler alwasy SQl:BatchCompleted.
    The RPC ist faster from the Batch call.
    is that a bug in the driver implementation?
    can any help me with a solution or workaround?
    thanks Halim

    Hi,
    thank you very much Joe.
    Halim.
    Joseph Weinstein <[email protected]> wrote:
    >
    >
    Halim wrote:
    Hi,
    we have a performance problem with SQLServer 2000. We use Bea WLS 6.1,SQLServer
    2000, and JDBC Driver mssqlserver4v65.jar from Bea.You shouldn't be using the 6.5 version of the driver anyway. The 7.0
    version is better,
    but what you are seeing is that our driver does send fresh SQL for PreparedStatements,
    which is not as fast as using the RPC protocol. It's not a bug, but it
    is a feature we didn't
    implement.
    You should probably download and use the free driver from MS. It does
    implement
    the procedure protocol.
    Joe
    we use this for performance optimization as in Documetation at
    "http://www.datadirect-technologies.com/download/docs/jdbc/Jdbcref/jdbcdesign.html"
    case 2
    Stored Procedure can be optimized to use a server-side RPC. Becausethe application
    calls the procedure by name and the argument values are already encoded,the load
    on the database server is less
    CallableStatement cstmt = conn.prepareCall ("Call getCustName (?)");
    cstmt.setLong (1,12345);
    ResultSet rs = cstmt.executeQuery();
    But the checking in the SQlServer 2000 with SQL Profiler don't showthe use of
    RPC Call.
    I can test the different from Query Analyser:
    exec IF_GetBueroStatistik 1 -> SQLProfiler: SQL:BatchCompleted
    {call IF_GetBueroStatistik(1)} -> SQlProfiler: RPC:Completed
    But the Call from Bea Aplication make in SQlProfiler alwasy SQl:BatchCompleted.
    The RPC ist faster from the Batch call.
    is that a bug in the driver implementation?
    can any help me with a solution or workaround?
    thanks Halim

  • OAF page : How to get its query performance from Oracle Apps Screen?

    Hi Team,
    How to get the query performance of an OAF page using Oracle Apps Screen ??
    regards
    sridhar

    Go through this link
    Any tools to validate performance of an OAF Page?
    However do let us know as these queries performance can be check through backend also
    Thanks
    --Anil
    http://oracleanil.blogspot.com/

  • Spatial query performance problems

    In preparation for making using of spatial data in our oracle database, I wanted to create a view (materialised) that brings together data from a few different tables into one place ready for publishing as a WMS layer.
    I'm being stumped at first base by crippling performance of Oracle spatial function. Later joins of ordinary fields are ok, but the spatial joining of two tables using the following sql runs for an absurd length of time (i've given up - I don't know how long it actually takes only that it takes far too long)
    SELECT /*+ ordered */
    lg.GRIDREF, lg.SYSTEM, lg.PARENT, lg.TYPE,
    lrd.REGION_CODE
    FROM TABLE (SDO_JOIN('L_GRIDS','BOUNDARY','L_REGION_DEFINITION','BOUNDARY','mask=COVERS')) c,
    L_GRIDS lg, L_REGION_DEFINITION lrd
    WHERE c.rowid1 = lg.rowid AND c.rowid2 = lrd.rowid
    ORDER BY lrd.REGION_CODE
    Both tables have spatial indexs. L_REGION_DEFINITION contains 200 rows with complex boundaries stored as spatial objects. L_GRIDS contains 475,000 rows, each with a trivially simple spatial object consisting of a square polygon of 4 points.
    The database is 10g patched to latest. The server is dual quad Xeon processors with 16gb of ram. I didn't expect it to be a lightning query, but surely it should be usable?
    Any ideas?

    Try to upgrade to at least 11.2.0.2 and use the following query
    SELECT /*+ leading(lrd lg) */
    lg.GRIDREF, lg.SYSTEM, lg.PARENT, lg.TYPE,
    lrd.REGION_CODE
    FROM L_GRIDS lg, L_REGION_DEFINITION lrd
    WHERE sdo_relate(lg.boundary, lrd.boundary, 'mask=COVEREDBY') = 'TRUE'
    ORDER BY lrd.REGION_CODE;
    And since not sure about your query's intention, maybe it is "mask=INSIDE+COVEREDBY",
    please check out oracle spatial developer guide for details about different masks.

  • Query performance problem - events 2505-read cache and 2510-write cache

    Hi,
    I am experiencing severe performance problems with a query, specifically with events 2505 (Read Cache) and 2510 (Write Cache) which went up to 11000 seconds on some executions. Data Manager (400 s), OLAP data selection (90 s) and OLAP user exit (250 s) are other the other event with noticeable times. All other events are very quick.
    The query settings (RSRT) are
    persistent cache across each app server -> cluster table,
    update cache in delta process is checked ->group on infoprovider type
    use cache despite virtual characteristics/key figs checked (one info-cube has1 virtual key figure which should have a static result for a day)
    =>Do you know how I can get more details than what's in 0TCT_C02 to break down the read and write cache events time or do you have any recommandation?
    I have checked and no dataloads were in progres on the info-providers and no master data loads (change run). Overall system performance was acceptable for other queries.
    Thanks

    Hi,
    Looks like you're using BDB, not BDB JE, and this is the BDB JE forum. Could you please repost here?:
    Berkeley DB
    Thanks,
    mark

  • Fuzzy searching and concatenated datastore query performance problems.

    I am using the concatenated datastore and indexing two columns.
    The query I am executing includes an exact match on one column and a fuzzy match on the second column.
    When I execute the query, performance should improve as the exact match column is set to return less values.
    This is the case when we execute an exact match search on both columns.
    However, when one column is an exact match and the second column is a fuzzy match this is not true.
    Is this normal processing??? and why??? Is this a bug??
    If you need more information please let me know.
    We are under a deadline and this is our final road block.
    TIA
    Colleen GEislinger

    I see that you have posted the message in the Oracle text forum, good! You should get a better, more timely answer there.
    Larry

  • Bad Query Performance in Oracle Text

    Hello everyone, I have the following problem:
    I have a table, TABLE_A from now on, a table of more or less 1,000.000 rows, with a CONTEXT index, using FILE_DATASTORE, CTXSYS.DEFAULT_STORAGE, CTXSYS.NULL_FILTER, CTXSYS.BASIC_LEXER and querying the index in the following way:
    SELECT /*+FIRST_ROWS*/ A.ID, B.ID2, SCORE(1) FROM TABLE_A A, TABLE_B WHERE A.ID = B.ID AND CONTAINS(A.PATH, '<SOME KW>', 1) > 0 ORDER BY SCORE(1) DESC
    where TABLE_B has another 1,000.000 rows.
    The problem is that the query response time is much higher after some time of inactivity regarding those tables. How can I avoid this behavior?. The fact is that those inactivity times (not more than 20min) are core to my application, so I always get long long response times for my queries.
    Is there any cache or cache time parameter that affects this behavior? I have checked the Oracle Text documentation without finding anything about that...
    More data: I am using Oracle 9.2.0.1, but I have tested with the latest patches an the behavior is the same...
    Thank you very much in advance.

    Pablo,
    This appears to be a generic database or OS issue, not a Text specific issue. It really depends on what your application is doing.
    If your application is doing some other database activity such as queries or DMLs on other non-text tables, chances are Oracle Text related data blocks are being aged out of cache. You can either increase the db_cache_size init
    parmater or try to keep the text tables and index tables blocks in cache using ALTER TABLE commands.
    If your app is doing NON-database activity, then chances are your application is taking up much of the machine's physical memory such that OS is swapping ORACLE out of the memory. In which case, you may want to consider to add more memory to the machine or have ORACLE run on a separate machine by itself.

  • Spatial query performance problem after upgrade to 10G

    I am in the process of converting my database from a 9i box to a new 10G 64-bit box. But I have found a problem which is causing some reports to be slower on the new box. I have simplified the queries down to having the user_sdo_geom_metadata table joined to use the diminfo in the queries (I know that I am not using them in these queries, but I simplified for testing purposes...)
    If I run the following I get and look at the explain plan I get full table scans for both spatial tables and index lookups for the user_sdo_geom_metadata table queries and runs for about 14 seconds.
    SELECT ROWNUM
    from COUNTIES s,
    NOMINATIONS O,
    (select diminfo from user_sdo_geom_metadata where table_name='COUNTIES') S_DIM,
    (select diminfo from user_sdo_geom_metadata where table_name='NOMINATIONS') O_DIM
    where sdo_filter(S.GEOM,o.geom, 'querytype=WINDOW')='TRUE'
    and sdo_geom.within_distance(o.geom,0,S.GEOM,.5)='TRUE';
    If I just remove the two user_sdo_geom_metadata joins, I get spatial index usage on COUNTIES and the whole thing runs in less that a second.
    SELECT ROWNUM
    from COUNTIES s,
    NOMINATIONS O
    where sdo_filter(S.GEOM,o.geom, 'querytype=WINDOW')='TRUE'
    and sdo_geom.within_distance(o.geom,0,S.GEOM,.5)='TRUE';
    I have rebuilt the indexes, gathered stats, and tried hints to force the first query to use the spatial index. None of which made any change.
    Has anyone else seen this?
    Gerard Vidrine

    Hi Gerard,
    When the query window comes from a table Oracle always recommends:
    1) Use the /*+ ordered */ hint
    2) Put the table the quiery window comes from (geometry-2 in the query) first in the from clause
    However, your query is also written very strange. Do you know about SDO_WITHIN_DISTANCE? Or are you trying to do SDO_ANYINTERACT (since the distance is 0)?
    So I would write the query you have as:
    SELECT s.ROWNUM
    from NOMINATIONS O, COUNTIES s
    where sdo_relate(S.GEOM,o.geom, 'querytype=WINDOW mask=anyinteract')='TRUE';
    or in Oracle10g:
    SELECT s.ROWNUM
    from NOMINATIONS O, COUNTIES s
    where sdo_anyinteract(S.GEOM,o.geom)='TRUE';

  • Physical query (performance)problem in obiee11.1.1.6.8

    Hi all,
    i have built  same Logical model  for sql server database and Oracle database.i have performance issue in sql server where as it not showing the filter in physical query(nqs query log) hitting the DB of SQL server( so its taking more time to respond) but same model i m using for oracle Db its passing the physical query with filter to oracle DB (it is not taking more time  )to respond in obiee11.1.1.6.8
    Please help me

    Can you run the same query on Physical SQL Server DB and let us know the outcome ?
    Thanks,

  • Mdx Query performance problem

    Hi
    Is there any way to control the performance of Mdx expressions that use the Filter function? The following Mdx statement is an example of a query we are generating to return filtered characteristic values for users to make selections for variables.
    Note: It is intentional that the column axis is not populated as we are interested only in the returned characteristic values.
    SELECT {} N COLUMNS,
    Order(
         Filter(
              {[ZPLANTYPE].[All].Children},
              (([ZPLANTYPE].CurrentMember.Name >= 'a' AND [ZPLANTYPE].CurrentMember.Name < 'b') OR
              ([ZPLANTYPE].CurrentMember.Name >= 'A' AND [ZPLANTYPE].CurrentMember.Name < 'B'))
         [ZPLANTYPE].CurrentMember.Name, BASC
    ) ON ROWS FROM [$IC_FLT]
    In a real example with 162,000 charateristics this query is taking up to 5 minutes to run - clearly unacceptable as part of a user interface. It appears that behind the scenes a sequential read of the underlying dimesnion table is being carried out.
    It is difficult to create a more sophisticated query due to the lack of string handling logic in the raw Mdx language.

    Hi,
    I have been through the queries, and understand that the "_MSCM1" is being aggregated across Product and Paid Amount from the query extract below:
    member [Accounts].[_MSCM1] as 'AGGREGATE({[_Product2]}, [Accounts].[Paid Amount])'
    If I am getting it right, there is an aggregation rule missing for [Paid Amount] (I think that's the reason, the query is to aggregate _MSCM1 by "Paid Amount" ie just like any other dimension).
    Could you please check this once and this is why I think BI is generating two queries? I am sorry, if I got this wrong.
    Hope this helps.
    Thank you,
    Dhar

  • Query performance problem when using hierarchies

    Hello All,
    I've a query which is built on a hieracrhy with the following structure for eg.
    <b>A</b>
    |_<b>B</b>
    | |_L1
    |
    |_<b>C</b>
      |_L2
    When I restrict the query to hierarchy levels B and C simultaneously the query executes fine. But when i directly restrict the query to heirarchy level A , the query runs endlessly.
    Could some one please help me out as to why this is the case ?
    I don't have aggregates built on any of the hierarchy level.
    Best Regards,
    Sanjay

    Hi Roberto,
    thanks for your response. However, the problem is not solved even after applying the suggestions of the note 738098 :(. These queries used to execute fine until yesterday and there have been no major additions to the hierarchy. Please let me know if there is any thing else that can be done. We are planning to bounce the system and see if there are any performance improvements.
    PS: I've awarded points to you nevertheless, as the option suggested in the note seems useful and should be tried in case of these kind of performance issues
    Best Regards,
    Sanjay

  • Query, Performance Problem in apex

    Hi All,
    I am using
    select address1,address2,address3,city,place,pincode,siteid,bpcnum_0, contactname,fax,mobile,phone,website,rn from (select address1,address2,address3,city,place,pincode,siteid,bpcnum_0, contactname,fax,mobile,phone,website,dense_rank() over(order by contactname,address1)as rn, row_number() over (partition by contactname, address1 order by contactname, address1) as rn1 from vw_sub_cl_add1 where siteid=v('P10_SITENO') and bpcnum_0 = v('P10_CLNO')) emp where rn1 =1 and rn >= v('P10_RN')
    the above query to extract the details from a view, in a pl/sql region
    pagination is also working fine.
    ie only 4 records at a time will get displayed.
    Problem is
    it is taking 1min and 5 seconds to display, next set of records.
    please, could any tell me how to reduce the time of rendering the page.?
    Thanks in advance
    bye
    Srikavi

    If it's really true, that when using bind variables the query is fast, than can you rewrite your query in your application to use bind variables?
    Try to rewrite your query to use :P10_SITENO instead of v('P10_SITENO') etc. where possible.
    You can find more details at Patrick Wolf's blog http://www.inside-oracle-apex.com/2006/12/drop-in-replacement-for-v-and-nv.html

  • Slow query performance in Oracle 10.2.0.3

    Hi,
    We have Oracle 10.2.0.3 installed on RHEL 5(64 bit).We have two queries out of which one is a query using select while other query is using a insert.First we executed insert query which inserts 10000 rows in a table and then select query on this table.This works fine in one thread.But when we do samething in 10 threads, at that time INSERT is fine but select is taking very long time for 10 threads.Any bug related to parallel execution of queries for SELECT in 10.2.0.3?Any suggestion??
    Thanks in advance.
    Regards,
    RJ.

    Justin,
    We have a same queries for INSERT and Select in 10 manual sessions outof which select query is taking more time to execute.Please refer to WAITs given below.No there is no bottleneck as far as hardware is concerned because we tested it on different configuration of servers.
    Event                    Waits            Time(s)          Avg Wait(ms)     % Total Call Time     Wait Class
    CPU time                52                                    93.2     
    latch: cache buffers chains     45,542          6          0               10.7               Concurrency
    log file parallel write          2,107          3          1               5.2               System I/O
    log file sync               805          2          2               3.5               Commit
    latch: session allocation     5,116          1          0               2.6               Other Wait Events
    •     s - second
    •     cs - centisecond - 100th of a second
    •     ms - millisecond - 1000th of a second
    •     us - microsecond - 1000000th of a second
    •     ordered by wait time desc, waits desc (idle events last)
    Event                    Waits     %Time-outs     Total Wait Time (s)     Avg wait (ms)     Waits /txn
    latch: cache buffers chains     45,542     0.00          6                    0     22.99
    log file parallel write          2,107     0.00          3                    1     1.06
    log file sync               805     0.00          2                    2     0.41
    latch: session allocation     5,116     0.00          1                    0     2.58
    buffer busy waits          20,482     0.00          1                    0     10.34
    db file sequential read          157     0.00          1                    4     0.08
    control file parallel write     1,330     0.00          0                    0     0.67
    wait list latch free          39     0.00          0                    10     0.02
    enq: TX - index contention     632     0.00          0                    0     0.32
    latch free               996     0.00          0                    0     0.50
    SQL*Net break/reset to client     1,738     0.00          0                    0     0.88
    SQL*Net message to client     108,947     0.00          0                    0     55.00
    os thread startup          2     0.00          0                    19     0.00
    cursor: pin S wait on X          3     100.00          0                    11     0.00
    latch: In memory undo latch     136     0.00          0                    0     0.07
    log file switch completion     4     0.00          0                    7     0.00
    latch: shared pool          119     0.00          0                    0     0.06
    latch: undo global data          121     0.00          0                    0     0.06
    buffer deadlock               238     99.58          0                    0     0.12
    control file sequential read     1,735     0.00          0                    0     0.88
    SQL*Net more data to client     506     0.00          0                    0     0.26
    log file single write          2     0.00          0                    2     0.00
    SQL*Net more data from client     269     0.00          0                    0     0.14
    reliable message          12     0.00          0                    0     0.01
    LGWR wait for redo copy          26     0.00          0                    0     0.01
    rdbms ipc reply               6     0.00          0                    0     0.00
    latch: library cache          7     0.00          0                    0     0.00
    latch: redo allocation          2     0.00          0                    0     0.00
    enq: RO - fast object reuse     2     0.00          0                    0     0.00
    direct path write          21     0.00          0                    0     0.01
    cursor: pin S               1     0.00          0                    0     0.00
    log file sequential read     2     0.00          0                    0     0.00
    direct path read          8     0.00          0                    0     0.00
    SQL*Net message from client     108,949     0.00          43,397                    398     55.00
    jobq slave wait               14,527     49.56          35,159                    2420     7.33
    Streams AQ: qmn slave idle wait     246     0.00          3,524                    14326     0.12
    Streams AQ:qmn coordinator-
    idle wait                451     45.45          3,524                    7814     0.23
    wait for unread message on -
    broadcast channel          3,597     100.00          3,516                    978     1.82
    virtual circuit status          120     100.00          3,516                    29298     0.06
    class slave wait          2     0.00          0                    0     0.00 Message was edited by:
    RJiv
    Message was edited by:
    RJiv
    Message was edited by:
    RJiv
    Message was edited by:
    RJiv
    Message was edited by:
    RJiv
    Message was edited by:
    RJiv
    Message was edited by:
    RJiv
    Message was edited by:
    RJiv
    Message was edited by:
    RJiv

  • Query Performance problem after upgrade from 8i to 10g

    Following query takes longer time in 10g.
    SELECT LIC_ID,FSCL_YR,KEY_NME,CRTE_TME_STMP,REMT_AMT,UNASGN_AMT,BAD_CK_IND,CSH_RCPT_PARTY_ID,csh_rcpt_id,REC_TYP,XENT_ID,CLNT_CDE,BTCH_CSH_STA,file_nbr,
    lic_nbr,TAX_NBR,ASGN_AMT FROM (
    SELECT /*+ FIRST_ROWS*/
         cpty.lic_id,
    cpty.clnt_cde,
    cpty.csh_rcpt_party_id,
    cpty.csh_rcpt_id,
    cpty.rec_typ,
    cpty.xent_id,
    cr.fscl_yr,
    cbh.btch_csh_sta,
    nam.key_nme,
    lic.file_nbr,
    lic.lic_nbr,
    cr.crte_tme_stmp,
    cr.remt_amt,
    cr.unasgn_amt,
    ee.tax_nbr,
    cr.asgn_amt,
    cr.bad_ck_ind
    FROM lic lic
    ,csh_rcpt_party cpty
    ,name nam
    ,xent ee
    ,csh_rcpt cr
    ,csh_btch_hdr cbh
    WHERE 1 = 1
    AND ee.xent_id = nam.xent_id
    AND cbh.btch_id = cr.btch_id
    AND cr.csh_rcpt_id = cpty.csh_rcpt_id
    AND ee.xent_id = cpty.xent_id
    AND cpty.lic_id = lic.lic_id(+)
    AND (cpty.clnt_cde IN ( SELECT clnt_cde
    FROM clnt
                   START WITH clnt_cde = '4006'
    CONNECT BY PRIOR clnt_cde_prnt = clnt_cde)
    OR cpty.clnt_cde IS NULL)
    AND nam.cur_nme_ind = 'Y'
    AND nam.ent_nme_typ = 'P' AND nam.key_nme LIKE 'WHITE%')
    order by lic_id
    Explain Plan in 8i
    0 SELECT STATEMENT Optimizer=HINT: FIRST_ROWS (Cost=17 Card=1
    Bytes=107)
    1 0 FILTER
    2 1 NESTED LOOPS (Cost=17 Card=1 Bytes=107)
    3 2 NESTED LOOPS (Cost=15 Card=1 Bytes=101)
    4 3 NESTED LOOPS (OUTER) (Cost=13 Card=1 Bytes=73)
    5 4 NESTED LOOPS (Cost=11 Card=1 Bytes=60)
    6 5 NESTED LOOPS (Cost=6 Card=1 Bytes=35)
    7 6 INDEX (RANGE SCAN) OF 'NAME_WBSRCH1_I' (NON-UN
    IQUE) (Cost=4 Card=1 Bytes=26)
    8 6 TABLE ACCESS (BY INDEX ROWID) OF 'XENT' (Cost=
    2 Card=4649627 Bytes=41846643)
    9 8 INDEX (UNIQUE SCAN) OF 'EE_PK' (UNIQUE) (Cos
    t=1 Card=4649627)
    10 5 TABLE ACCESS (BY INDEX ROWID) OF 'CSH_RCPT_PARTY
    ' (Cost=5 Card=442076 Bytes=11051900)
    11 10 INDEX (RANGE SCAN) OF 'CPTY_EE_FK_I' (NON-UNIQ
    UE) (Cost=2 Card=442076)
    12 4 TABLE ACCESS (BY INDEX ROWID) OF 'LIC' (Cost=2 Car
    d=3254422 Bytes=42307486)
    13 12 INDEX (UNIQUE SCAN) OF 'LIC_PK' (UNIQUE) (Cost=1
    Card=3254422)
    14 3 TABLE ACCESS (BY INDEX ROWID) OF 'CSH_RCPT' (Cost=2
    Card=6811443 Bytes=190720404)
    15 14 INDEX (UNIQUE SCAN) OF 'CR_PK' (UNIQUE) (Cost=1 Ca
    rd=6811443)
    16 2 TABLE ACCESS (BY INDEX ROWID) OF 'CSH_BTCH_HDR' (Cost=
    2 Card=454314 Bytes=2725884)
    17 16 INDEX (UNIQUE SCAN) OF 'CBH_PK' (UNIQUE) (Cost=1 Car
    d=454314)
    18 1 FILTER
    19 18 CONNECT BY
    20 19 INDEX (UNIQUE SCAN) OF 'CLNT_PK' (UNIQUE) (Cost=1 Ca
    rd=1 Bytes=4)
    21 19 TABLE ACCESS (BY USER ROWID) OF 'CLNT'
    22 19 TABLE ACCESS (BY INDEX ROWID) OF 'CLNT' (Cost=2 Card
    =1 Bytes=7)
    23 22 INDEX (UNIQUE SCAN) OF 'CLNT_PK' (UNIQUE) (Cost=1
    Card=1)
    Explain Plan in 10g
    0 SELECT STATEMENT Optimizer=HINT: FIRST_ROWS (Cost=19 Card=1
    Bytes=112)
    1 0 SORT (ORDER BY) (Cost=19 Card=1 Bytes=112)
    2 1 FILTER
    3 2 NESTED LOOPS (Cost=18 Card=1 Bytes=112)
    4 3 NESTED LOOPS (Cost=16 Card=1 Bytes=106)
    5 4 NESTED LOOPS (OUTER) (Cost=14 Card=1 Bytes=78)
    6 5 NESTED LOOPS (Cost=12 Card=1 Bytes=65)
    7 6 NESTED LOOPS (Cost=6 Card=1 Bytes=34)
    8 7 INDEX (RANGE SCAN) OF 'NAME_WBSRCH1_I' (INDE
    X) (Cost=4 Card=1 Bytes=25)
    9 7 TABLE ACCESS (BY INDEX ROWID) OF 'XENT' (TAB
    LE) (Cost=2 Card=1 Bytes=9)
    10 9 INDEX (UNIQUE SCAN) OF 'EE_PK' (INDEX (UNI
    QUE)) (Cost=1 Card=1)
    11 6 TABLE ACCESS (BY INDEX ROWID) OF 'CSH_RCPT_PAR
    TY' (TABLE) (Cost=6 Card=1 Bytes=31)
    12 11 INDEX (RANGE SCAN) OF 'CPTY_EE_FK_I' (INDEX)
    (Cost=2 Card=4)
    13 5 TABLE ACCESS (BY INDEX ROWID) OF 'LIC' (TABLE) (
    Cost=2 Card=1 Bytes=13)
    14 13 INDEX (UNIQUE SCAN) OF 'LIC_PK' (INDEX (UNIQUE
    )) (Cost=1 Card=1)
    15 4 TABLE ACCESS (BY INDEX ROWID) OF 'CSH_RCPT' (TABLE
    ) (Cost=2 Card=1 Bytes=28)
    16 15 INDEX (UNIQUE SCAN) OF 'CR_PK' (INDEX (UNIQUE))
    (Cost=1 Card=1)
    17 3 TABLE ACCESS (BY INDEX ROWID) OF 'CSH_BTCH_HDR' (TAB
    LE) (Cost=2 Card=1 Bytes=6)
    18 17 INDEX (UNIQUE SCAN) OF 'CBH_PK' (INDEX (UNIQUE)) (
    Cost=1 Card=1)
    19 2 FILTER
    20 19 CONNECT BY (WITH FILTERING)
    21 20 TABLE ACCESS (BY INDEX ROWID) OF 'CLNT' (TABLE) (C
    ost=2 Card=1 Bytes=15)
    22 21 INDEX (UNIQUE SCAN) OF 'CLNT_PK' (INDEX (UNIQUE)
    ) (Cost=1 Card=1)
    23 20 NESTED LOOPS
    24 23 BUFFER (SORT)
    25 24 CONNECT BY PUMP
    26 23 TABLE ACCESS (BY INDEX ROWID) OF 'CLNT' (TABLE)
    (Cost=2 Card=1 Bytes=7)
    27 26 INDEX (UNIQUE SCAN) OF 'CLNT_PK' (INDEX (UNIQU
    E)) (Cost=1 Card=1)
    28 20 TABLE ACCESS (FULL) OF 'CLNT' (TABLE) (Cost=5 Card
    =541 Bytes=5951)
    Explain plan looks different in steps 19 to 28. I am not sure why 10g have more steps

    Hi
    I have no experience in 8i. I do know 10g does costing different from 8i. So I think the other plan might got elliminated.
    Normally when I see differences. I just collect statistics on the tables and the indexes and remove the hints. Hints are not good . This has helped me to solve few problems.
    Thanks
    CT

Maybe you are looking for