Tuning Large Spatial Join in Oracle 9i

I have a large (million+ rows) table of line segments (2 point lines) and I want to generate a table of all intersections. I have created the geometry column and populated the values and indexed it with a spatial index.
I even looked in the metadata to get the index table name (not same name as index itself)and computed statistics on the spatial index table.
1. Was this really necessary?
I do a join on the table as follows:
Select a.LineID, b.LineID from Lines a, Lines b
where
mdsys.sdo_relate(a.LineSegment, b.LineSegment,
'mask=anyinteract querytype=JOIN
idxtab2=Line_SPATIAL_IDX') = 'TRUE';
Everything I try results in nested full table scans.
I have tried index table name in place of index name.
2. Which should I really use?
3. QueryType=Join is rarely used but this is what I need, right?
4. Does the optimizer/explain plan accurately represent spatial operations?
5. SDO_Join is not available in 9i and Oracle10 is not an option for me, so any idea's how to do this efficently, or at least any methods to optimize the SQL?
I removed the Insert command and SDO_Intersection function so that I could tune the Select.
(I know i will need to filter each lines intersection with itself, but I am not even to that point yet, this runs for days).
Thanks,

I have the horsepower to do a full scan once and I was hoping that the spatial index would be of some use to avoid nested scans (a million scans of a million rows).
Anyone have insight on why SDO_RELATE would not use the spatial index? Index type make a difference?
It is Geodetic data, so I used the tree index, maybe tiling would be better sdo_relate join?
I am watching from Enterprise Console session screen. Does this show an accurate plan on SQL that uses Spatial Operators?
Also since I am joining a table to itself, on the same column no less, is this outside the capability of sdo_relate? It won't let me put a 2nd spatial index on that column. Should it? Am I doing it wrong?
Any help is appreciated. Thanks.

Similar Messages

  • Spatial Join

    Hi,
    I am new to Oracle Spatial.
    I am having two different version of TeleAtlas road network data. I am not seeing any common id between these two map data. I would like to copy two columns from old data to the new data based on geometry.
    any help on this.

    If you are trying to add two new columns from the old table to the new table, you might have to do some kind of join on these two tables.
    One way to do this is to come up with a mapping table from new IDs to old IDs.
    This can be done by joining the geometry with sdo_equal operator (11.2 19 Spatial Operator in http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11830/sdo_operat.htm) or if you have other unique keys (like name, most likely will be more efficient than spatial join).
    Once the mapping table is created, you can update the new table with two columns from the old table with your old table and the mapping table:
    Since you have a fairly large table (~30M rows) with indexes, a better/efficient approach is to create a new table instead of updating the current new table.
    Then rename it and create necessary indexes on it.
    jack

  • Spatial join view

    Good afternoon,
    I am new on oracle spatial and I have to do a simple spatial join view. So from two table name and a operation I have to create a view that makes a join of type "operation" between two table.
    For example, in a high level language:
    create or replace view VIEW_NAME as select * from table1,table2 where operation(table1.geom,table2.geom).
    Where "operation" could be intersect, touch, overlaps,contains, disjoint...and so on...
    I can't find a complete example for my problem.
    Thanks for all your help, it is very important.
    Best regards
    Anna Zanetti

    ok..thank you very much.
    But If I want to make one of the following operation (BBOX,Beyond,Contains,Crosses,Disjoint,
    Equals,Intersects,Overlaps,Touches,Within), what kind of mask have I to use?
    I understand that this are the possibile mask:
    TOUCH, OVERLAPBDYDISJOINT, OVERLAPBDYINTERSECT, EQUAL, INSIDE, COVEREDBY, CONTAINS, COVERS, ANYINTERACT, ON
    I think that there is not a perfect matching, in fact I think that ANYINTERACT is different from intersects!!!
    I am wrong?
    Is there any table of matching between operations???
    Thank a lot
    Best regards
    Anna Zanetti

  • Significant performance change in spatial join

    Hi,
    I have 2 spatial tables in Oracle 10g: one (PT_SOURCE) has a point column with over a half million records and another (TRJ_TMP_BUF) has a polygon column with 2 records. 2 spatial R-tree indexes were built on the 2 table respectively. I tried a spatial join to see how many points fall into one polygon. The SQL statement is:
    SELECT a.id, d.name FROM pt_source a, trj_tmp_buf b, TABLE (SDO_JOIN('PT_SOURCE', 'SHAPE', 'TRJ_TMP_BUF', 'SHAPE', 'mask=ANYINTERACT')) c, pollution_source d WHERE c.rowid1 = a.rowid AND c.rowid2 = b.rowid and d.id=a.id
    The first a couple of run of the query took about 2 and a half hours to complete. 2 days after I tried the same query again. It only took about 2 minutes to complete! I'm pretty sure that the workload of the server was in the same level as in the first run. I'm wondering if there is something going on with the spatial indexes that may cause such significant improvement.
    BTW, I imported the same data set into another server that is configured similarly and runs another instance of Oracle 10g. All the spatial indexes were built. This time the same query took about 2 hours to complete. Does any body have any explanation about this? Thanks in advance.

    Hi, Dan,
    I'm sorry that I made a mistake in the file names. The second trace file is for the database that is faster.
    I set a less file size for the second trace file. That might be why its space was limited. I ran the query again and set the file size to 5 MB (the same as for the first trace file). The newly generated trace file for the faster database is as following:
    TKPROF: Release 10.1.0.3.0 - Production on Tue May 10 22:50:51 2005
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    Trace file: airpltn_ora_19874_gis23Test2.trc
    Sort options: default
    count = number of times OCI procedure was executed
    cpu = cpu time in seconds executing
    elapsed = elapsed time in seconds executing
    disk = number of physical reads of buffers from disk
    query = number of buffers gotten for consistent read
    current = number of buffers gotten in current mode (usually for update)
    rows = number of rows processed by the fetch or execute call
    alter session set sql_trace=true
    call count cpu elapsed disk query current rows
    Parse 0 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 0 0.00 0.00 0 0 0 0
    total 1 0.00 0.00 0 0 0 0
    Misses in library cache during parse: 0
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 58 (APPDEV)
    select t.ts#,t.file#,t.block#,nvl(t.bobj#,0),nvl(t.tab#,0),t.intcols,
    nvl(t.clucols,0),t.audit$,t.flags,t.pctfree$,t.pctused$,t.initrans,
    t.maxtrans,t.rowcnt,t.blkcnt,t.empcnt,t.avgspc,t.chncnt,t.avgrln,
    t.analyzetime,t.samplesize,t.cols,t.property,nvl(t.degree,1),
    nvl(t.instances,1),t.avgspc_flb,t.flbcnt,t.kernelcols,nvl(t.trigflag, 0),
    nvl(t.spare1,0),nvl(t.spare2,0),t.spare4,t.spare6,ts.cachedblk,ts.cachehit,
    ts.logicalread
    from
    tab$ t, tab_stats$ ts where t.obj#= :1 and t.obj# = ts.obj# (+)
    call count cpu elapsed disk query current rows
    Parse 10 0.00 0.00 0 0 0 0
    Execute 20 0.01 0.00 0 0 0 0
    Fetch 20 0.02 0.00 0 82 0 20
    total 50 0.03 0.01 0 82 0 20
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 2)
    Rows Row Source Operation
    3 NESTED LOOPS OUTER (cr=12 pr=0 pw=0 time=1001 us)
    3 TABLE ACCESS CLUSTER OBJ#(4) (cr=9 pr=0 pw=0 time=728 us)
    3 INDEX UNIQUE SCAN OBJ#(3) (cr=6 pr=0 pw=0 time=334 us)(object id 3)
    0 TABLE ACCESS BY INDEX ROWID OBJ#(671) (cr=3 pr=0 pw=0 time=198 us)
    0 INDEX RANGE SCAN OBJ#(672) (cr=3 pr=0 pw=0 time=160 us)(object id 672)
    select i.obj#,i.ts#,i.file#,i.block#,i.intcols,i.type#,i.flags,i.property,
    i.pctfree$,i.initrans,i.maxtrans,i.blevel,i.leafcnt,i.distkey,i.lblkkey,
    i.dblkkey,i.clufac,i.cols,i.analyzetime,i.samplesize,i.dataobj#,
    nvl(i.degree,1),nvl(i.instances,1),i.rowcnt,mod(i.pctthres$,256),
    i.indmethod#,i.trunccnt,nvl(c.unicols,0),nvl(c.deferrable#+c.valid#,0),
    nvl(i.spare1,i.intcols),i.spare4,i.spare2,i.spare6,decode(i.pctthres$,null,
    null,mod(trunc(i.pctthres$/256),256)),ist.cachedblk,ist.cachehit,
    ist.logicalread
    from
    ind$ i, ind_stats$ ist, (select enabled, min(cols) unicols,
    min(to_number(bitand(defer,1))) deferrable#,min(to_number(bitand(defer,4)))
    valid# from cdef$ where obj#=:1 and enabled > 1 group by enabled) c where
    i.obj#=c.enabled(+) and i.obj# = ist.obj#(+) and i.bo#=:1
    call count cpu elapsed disk query current rows
    Parse 10 0.00 0.00 0 0 0 0
    Execute 23 0.01 0.00 0 0 0 0
    Fetch 58 0.04 0.03 0 189 0 35
    total 91 0.05 0.04 0 189 0 35
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 2)
    Rows Row Source Operation
    7 HASH JOIN OUTER (cr=30 pr=0 pw=0 time=5363 us)
    7 NESTED LOOPS OUTER (cr=21 pr=0 pw=0 time=1211 us)
    7 TABLE ACCESS CLUSTER OBJ#(19) (cr=16 pr=0 pw=0 time=834 us)
    3 INDEX UNIQUE SCAN OBJ#(3) (cr=6 pr=0 pw=0 time=302 us)(object id 3)
    0 TABLE ACCESS BY INDEX ROWID OBJ#(673) (cr=5 pr=0 pw=0 time=252 us)
    0 INDEX UNIQUE SCAN OBJ#(674) (cr=5 pr=0 pw=0 time=170 us)(object id 674)
    1 VIEW (cr=9 pr=0 pw=0 time=1563 us)
    1 SORT GROUP BY (cr=9 pr=0 pw=0 time=1522 us)
    1 TABLE ACCESS CLUSTER OBJ#(31) (cr=9 pr=0 pw=0 time=775 us)
    3 INDEX UNIQUE SCAN OBJ#(30) (cr=6 pr=0 pw=0 time=339 us)(object id 30)
    select name,intcol#,segcol#,type#,length,nvl(precision#,0),decode(type#,2,
    nvl(scale,-127/*MAXSB1MINAL*/),178,scale,179,scale,180,scale,181,scale,182,
    scale,183,scale,231,scale,0),null$,fixedstorage,nvl(deflength,0),default$,
    rowid,col#,property, nvl(charsetid,0),nvl(charsetform,0),spare1,spare2,
    nvl(spare3,0)
    from
    col$ where obj#=:1 order by intcol#
    call count cpu elapsed disk query current rows
    Parse 13 0.00 0.00 0 0 0 0
    Execute 30 0.01 0.00 0 0 0 0
    Fetch 432 0.01 0.02 0 93 0 402
    total 475 0.02 0.03 0 93 0 402
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 2)
    Rows Row Source Operation
    25 SORT ORDER BY (cr=9 pr=0 pw=0 time=1334 us)
    25 TABLE ACCESS CLUSTER OBJ#(21) (cr=9 pr=0 pw=0 time=704 us)
    3 INDEX UNIQUE SCAN OBJ#(3) (cr=6 pr=0 pw=0 time=283 us)(object id 3)
    select type#,blocks,extents,minexts,maxexts,extsize,extpct,user#,iniexts,
    NVL(lists,65535),NVL(groups,65535),cachehint,hwmincr, NVL(spare1,0),
    NVL(scanhint,0)
    from
    seg$ where ts#=:1 and file#=:2 and block#=:3
    call count cpu elapsed disk query current rows
    Parse 8 0.00 0.00 0 0 0 0
    Execute 8 0.00 0.00 0 0 0 0
    Fetch 8 0.00 0.00 0 24 0 8
    total 24 0.00 0.00 0 24 0 8
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    0 TABLE ACCESS CLUSTER SEG$ (cr=0 pr=0 pw=0 time=0 us)
    0 INDEX UNIQUE SCAN I_FILE#_BLOCK# (cr=0 pr=0 pw=0 time=0 us)(object id 9)
    select owner#,name,namespace,remoteowner,linkname,p_timestamp,p_obj#,
    nvl(property,0),subname,d_attrs
    from
    dependency$ d, obj$ o where d_obj#=:1 and p_obj#=obj#(+) order by order#
    call count cpu elapsed disk query current rows
    Parse 42 0.00 0.01 0 0 0 0
    Execute 42 0.01 0.01 0 0 0 0
    Fetch 197 0.06 0.02 0 487 0 155
    total 281 0.07 0.05 0 487 0 155
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    4 SORT ORDER BY (cr=13 pr=0 pw=0 time=806 us)
    4 NESTED LOOPS OUTER (cr=13 pr=0 pw=0 time=729 us)
    4 TABLE ACCESS BY INDEX ROWID DEPENDENCY$ (cr=3 pr=0 pw=0 time=267 us)
    4 INDEX RANGE SCAN I_DEPENDENCY1 (cr=2 pr=0 pw=0 time=160 us)(object id 120)
    4 TABLE ACCESS BY INDEX ROWID OBJ$ (cr=10 pr=0 pw=0 time=313 us)
    4 INDEX UNIQUE SCAN I_OBJ1 (cr=6 pr=0 pw=0 time=171 us)(object id 36)
    select order#,columns,types
    from
    access$ where d_obj#=:1
    call count cpu elapsed disk query current rows
    Parse 42 0.00 0.01 0 0 0 0
    Execute 42 0.02 0.00 0 0 0 0
    Fetch 123 0.03 0.00 0 246 0 81
    total 207 0.05 0.02 0 246 0 81
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    3 TABLE ACCESS BY INDEX ROWID ACCESS$ (cr=8 pr=0 pw=0 time=220 us)
    3 INDEX RANGE SCAN I_ACCESS1 (cr=5 pr=0 pw=0 time=232 us)(object id 122)
    select col#, grantee#, privilege#,max(mod(nvl(option$,0),2))
    from
    objauth$ where obj#=:1 and col# is not null group by privilege#, col#,
    grantee# order by col#, grantee#
    call count cpu elapsed disk query current rows
    Parse 12 0.00 0.00 0 0 0 0
    Execute 16 0.01 0.00 0 0 0 0
    Fetch 16 0.00 0.00 0 32 0 0
    total 44 0.01 0.00 0 32 0 0
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    0 SORT GROUP BY (cr=2 pr=0 pw=0 time=257 us)
    0 TABLE ACCESS BY INDEX ROWID OBJ#(85) (cr=2 pr=0 pw=0 time=156 us)
    0 INDEX RANGE SCAN OBJ#(102) (cr=2 pr=0 pw=0 time=136 us)(object id 102)
    select grantee#,privilege#,nvl(col#,0),max(mod(nvl(option$,0),2))
    from
    objauth$ where obj#=:1 group by grantee#,privilege#,nvl(col#,0) order by
    grantee#
    call count cpu elapsed disk query current rows
    Parse 12 0.00 0.00 0 0 0 0
    Execute 36 0.01 0.00 0 0 0 0
    Fetch 66 0.02 0.01 0 107 0 30
    total 114 0.03 0.02 0 107 0 30
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    0 SORT GROUP BY (cr=2 pr=0 pw=0 time=213 us)
    0 TABLE ACCESS BY INDEX ROWID OBJ#(85) (cr=2 pr=0 pw=0 time=119 us)
    0 INDEX RANGE SCAN OBJ#(102) (cr=2 pr=0 pw=0 time=102 us)(object id 102)
    select col#,intcol#,toid,version#,packed,intcols,intcol#s,flags, synobj#,
    nvl(typidcol#, 0)
    from
    coltype$ where obj#=:1 order by intcol# desc
    call count cpu elapsed disk query current rows
    Parse 11 0.01 0.01 0 0 0 0
    Execute 14 0.03 0.02 0 0 0 0
    Fetch 32 0.00 0.00 0 45 0 18
    total 57 0.04 0.03 0 45 0 18
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    3 SORT ORDER BY (cr=3 pr=0 pw=0 time=362 us)
    3 TABLE ACCESS CLUSTER OBJ#(281) (cr=3 pr=0 pw=0 time=188 us)
    1 INDEX UNIQUE SCAN OBJ#(3) (cr=2 pr=0 pw=0 time=101 us)(object id 3)
    select /*+ rule */ bucket_cnt, row_cnt, cache_cnt, null_cnt, timestamp#,
    sample_size, minimum, maximum, distcnt, lowval, hival, density, col#,
    spare1, spare2, avgcln
    from
    hist_head$ where obj#=:1 and intcol#=:2
    call count cpu elapsed disk query current rows
    Parse 7 0.00 0.00 0 0 0 0
    Execute 99 0.02 0.01 0 0 0 0
    Fetch 99 0.04 0.01 0 291 0 91
    total 205 0.06 0.03 0 291 0 91
    Misses in library cache during parse: 0
    Optimizer mode: RULE
    Parsing user id: SYS (recursive depth: 2)
    Rows Row Source Operation
    13 TABLE ACCESS BY INDEX ROWID OBJ#(214) (cr=39 pr=0 pw=0 time=2198 us)
    13 INDEX RANGE SCAN OBJ#(216) (cr=26 pr=0 pw=0 time=1368 us)(object id 216)
    select /*+ rule */ bucket, endpoint, col#, epvalue
    from
    histgrm$ where obj#=:1 and intcol#=:2 and row#=:3 order by bucket
    call count cpu elapsed disk query current rows
    Parse 4 0.00 0.00 0 0 0 0
    Execute 27 0.00 0.00 0 0 0 0
    Fetch 27 0.01 0.01 0 81 0 432
    total 58 0.01 0.01 0 81 0 432
    Misses in library cache during parse: 0
    Optimizer mode: RULE
    Parsing user id: SYS (recursive depth: 2)
    Rows Row Source Operation
    161 SORT ORDER BY (cr=30 pr=0 pw=0 time=3997 us)
    161 TABLE ACCESS CLUSTER OBJ#(212) (cr=30 pr=0 pw=0 time=2430 us)
    10 INDEX UNIQUE SCAN OBJ#(211) (cr=20 pr=0 pw=0 time=701 us)(object id 211)
    select intcol#, toid, version#, intcols, intcol#s, flags, synobj#
    from
    subcoltype$ where obj#=:1 order by intcol# asc
    call count cpu elapsed disk query current rows
    Parse 11 0.01 0.00 0 0 0 0
    Execute 14 0.01 0.00 0 0 0 0
    Fetch 14 0.01 0.00 0 45 0 0
    total 39 0.03 0.00 0 45 0 0
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    0 SORT ORDER BY (cr=3 pr=0 pw=0 time=254 us)
    0 TABLE ACCESS CLUSTER OBJ#(284) (cr=3 pr=0 pw=0 time=177 us)
    1 INDEX UNIQUE SCAN OBJ#(3) (cr=2 pr=0 pw=0 time=91 us)(object id 3)
    select col#,intcol#,ntab#
    from
    ntab$ where obj#=:1 order by intcol# asc
    call count cpu elapsed disk query current rows
    Parse 11 0.00 0.00 0 0 0 0
    Execute 14 0.00 0.00 0 0 0 0
    Fetch 14 0.00 0.00 0 14 0 0
    total 39 0.00 0.00 0 14 0 0
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    0 TABLE ACCESS BY INDEX ROWID OBJ#(351) (cr=1 pr=0 pw=0 time=144 us)
    0 INDEX RANGE SCAN OBJ#(353) (cr=1 pr=0 pw=0 time=124 us)(object id 353)
    select l.col#, l.intcol#, l.lobj#, l.ind#, l.ts#, l.file#, l.block#, l.chunk,
    l.pctversion$, l.flags, l.property, l.retention, l.freepools
    from
    lob$ l where l.obj# = :1 order by l.intcol# asc
    call count cpu elapsed disk query current rows
    Parse 14 0.00 0.00 0 0 0 0
    Execute 14 0.00 0.00 0 0 0 0
    Fetch 24 0.00 0.00 0 45 0 10
    total 52 0.00 0.01 0 45 0 10
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    2 SORT ORDER BY (cr=3 pr=0 pw=0 time=318 us)
    2 TABLE ACCESS CLUSTER LOB$ (cr=3 pr=0 pw=0 time=168 us)
    1 INDEX UNIQUE SCAN I_OBJ# (cr=2 pr=0 pw=0 time=95 us)(object id 3)
    select o.owner#,o.name,o.namespace,o.remoteowner,o.linkname,o.subname,
    o.dataobj#,o.flags
    from
    obj$ o where o.obj#=:1
    call count cpu elapsed disk query current rows
    Parse 7 0.00 0.00 0 0 0 0
    Execute 27 0.00 0.00 0 0 0 0
    Fetch 27 0.00 0.00 0 81 0 27
    total 61 0.00 0.01 0 81 0 27
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 2)
    Rows Row Source Operation
    2 TABLE ACCESS BY INDEX ROWID OBJ#(18) (cr=6 pr=0 pw=0 time=313 us)
    2 INDEX UNIQUE SCAN OBJ#(36) (cr=4 pr=0 pw=0 time=189 us)(object id 36)
    select col#,intcol#,reftyp,stabid,expctoid
    from
    refcon$ where obj#=:1 order by intcol# asc
    call count cpu elapsed disk query current rows
    Parse 11 0.00 0.00 0 0 0 0
    Execute 14 0.00 0.00 0 0 0 0
    Fetch 14 0.00 0.00 0 14 0 0
    total 39 0.00 0.00 0 14 0 0
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    0 TABLE ACCESS BY INDEX ROWID OBJ#(361) (cr=1 pr=0 pw=0 time=158 us)
    0 INDEX RANGE SCAN OBJ#(363) (cr=1 pr=0 pw=0 time=133 us)(object id 363)
    select col#,intcol#,charsetid,charsetform
    from
    col$ where obj#=:1 order by intcol# asc
    call count cpu elapsed disk query current rows
    Parse 11 0.01 0.00 0 0 0 0
    Execute 14 0.00 0.00 0 0 0 0
    Fetch 372 0.00 0.00 0 45 0 358
    total 397 0.01 0.01 0 45 0 358
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    9 SORT ORDER BY (cr=3 pr=0 pw=0 time=338 us)
    9 TABLE ACCESS CLUSTER OBJ#(21) (cr=3 pr=0 pw=0 time=219 us)
    1 INDEX UNIQUE SCAN OBJ#(3) (cr=2 pr=0 pw=0 time=93 us)(object id 3)
    select intcol#,type,flags,lobcol,objcol,extracol,schemaoid, elemnum
    from
    opqtype$ where obj# = :1 order by intcol# asc
    call count cpu elapsed disk query current rows
    Parse 11 0.00 0.00 0 0 0 0
    Execute 14 0.00 0.00 0 0 0 0
    Fetch 14 0.00 0.00 0 14 0 0
    total 39 0.00 0.00 0 14 0 0
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    0 TABLE ACCESS BY INDEX ROWID OBJ#(364) (cr=1 pr=0 pw=0 time=145 us)
    0 INDEX RANGE SCAN OBJ#(365) (cr=1 pr=0 pw=0 time=127 us)(object id 365)
    select pos#,intcol#,col#,spare1,bo#,spare2
    from
    icol$ where obj#=:1
    call count cpu elapsed disk query current rows
    Parse 11 0.01 0.00 0 0 0 0
    Execute 35 0.00 0.00 0 0 0 0
    Fetch 75 0.00 0.00 0 150 0 40
    total 121 0.01 0.01 0 150 0 40
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    3 TABLE ACCESS BY INDEX ROWID OBJ#(20) (cr=20 pr=0 pw=0 time=942 us)
    3 INDEX RANGE SCAN OBJ#(40) (cr=17 pr=0 pw=0 time=732 us)(object id 40)
    select metadata
    from
    kopm$ where name='DB_FDO'
    call count cpu elapsed disk query current rows
    Parse 1 0.01 0.01 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 0.00 0.00 0 2 0 1
    total 3 0.01 0.01 0 2 0 1
    Misses in library cache during parse: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    1 TABLE ACCESS BY INDEX ROWID KOPM$ (cr=2 pr=0 pw=0 time=140 us)
    1 INDEX UNIQUE SCAN I_KOPM1 (cr=1 pr=0 pw=0 time=83 us)(object id 350)
    select obj#,type#,ctime,mtime,stime,status,dataobj#,flags,oid$, spare1,
    spare2
    from
    obj$ where owner#=:1 and name=:2 and namespace=:3 and remoteowner is null
    and linkname is null and subname is null
    call count cpu elapsed disk query current rows
    Parse 9 0.00 0.00 0 0 0 0
    Execute 34 0.00 0.00 0 0 0 0
    Fetch 34 0.00 0.00 0 94 0 26
    total 77 0.00 0.01 0 94 0 26
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    1 TABLE ACCESS BY INDEX ROWID OBJ#(18) (cr=5 pr=0 pw=0 time=403 us)
    1 INDEX RANGE SCAN OBJ#(37) (cr=4 pr=0 pw=0 time=293 us)(object id 37)
    select node,owner,name
    from
    syn$ where obj#=:1
    call count cpu elapsed disk query current rows
    Parse 8 0.00 0.00 0 0 0 0
    Execute 10 0.00 0.00 0 0 0 0
    Fetch 10 0.00 0.00 0 30 0 10
    total 28 0.00 0.00 0 30 0 10
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    1 TABLE ACCESS BY INDEX ROWID OBJ#(61) (cr=3 pr=0 pw=0 time=164 us)
    1 INDEX UNIQUE SCAN OBJ#(100) (cr=2 pr=0 pw=0 time=97 us)(object id 100)
    select /*+ index(idl_sb4$ i_idl_sb41) +*/ piece#,length,piece
    from
    idl_sb4$ where obj#=:1 and part=:2 and version=:3 order by piece#
    call count cpu elapsed disk query current rows
    Parse 30 0.00 0.00 0 0 0 0
    Execute 30 0.01 0.00 0 0 0 0
    Fetch 82 0.01 0.00 0 216 0 52
    total 142 0.02 0.02 0 216 0 52
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    2 TABLE ACCESS BY INDEX ROWID IDL_SB4$ (cr=6 pr=0 pw=0 time=226 us)
    2 INDEX RANGE SCAN I_IDL_SB41 (cr=4 pr=0 pw=0 time=181 us)(object id 116)
    select /*+ index(idl_ub1$ i_idl_ub11) +*/ piece#,length,piece
    from
    idl_ub1$ where obj#=:1 and part=:2 and version=:3 order by piece#
    call count cpu elapsed disk query current rows
    Parse 30 0.01 0.00 0 0 0 0
    Execute 30 0.02 0.00 0 0 0 0
    Fetch 58 0.01 0.00 0 149 0 30
    total 118 0.04 0.02 0 149 0 30
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    1 TABLE ACCESS BY INDEX ROWID IDL_UB1$ (cr=4 pr=0 pw=0 time=222 us)
    1 INDEX RANGE SCAN I_IDL_UB11 (cr=3 pr=0 pw=0 time=164 us)(object id 113)
    select /*+ index(idl_char$ i_idl_char1) +*/ piece#,length,piece
    from
    idl_char$ where obj#=:1 and part=:2 and version=:3 order by piece#
    call count cpu elapsed disk query current rows
    Parse 30 0.00 0.00 0 0 0 0
    Execute 30 0.00 0.00 0 0 0 0
    Fetch 55 0.01 0.00 0 135 0 25
    total 115 0.01 0.01 0 135 0 25
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    1 TABLE ACCESS BY INDEX ROWID IDL_CHAR$ (cr=4 pr=0 pw=0 time=233 us)
    1 INDEX RANGE SCAN I_IDL_CHAR1 (cr=3 pr=0 pw=0 time=168 us)(object id 114)
    select /*+ index(idl_ub2$ i_idl_ub21) +*/ piece#,length,piece
    from
    idl_ub2$ where obj#=:1 and part=:2 and version=:3 order by piece#
    call count cpu elapsed disk query current rows
    Parse 30 0.02 0.00 0 0 0 0
    Execute 30 0.02 0.00 0 0 0 0
    Fetch 56 0.00 0.00 0 190 0 51
    total 116 0.04 0.02 0 190 0 51
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    0 TABLE ACCESS BY INDEX ROWID IDL_UB2$ (cr=0 pr=0 pw=0 time=0 us)
    0 INDEX RANGE SCAN I_IDL_UB21 (cr=0 pr=0 pw=0 time=0 us)(object id 115)
    select audit$,properties
    from
    type_misc$ where obj#=:1
    call count cpu elapsed disk query current rows
    Parse 16 0.01 0.01 0 0 0 0
    Execute 16 0.01 0.00 0 0 0 0
    Fetch 16 0.00 0.00 0 48 0 16
    total 48 0.02 0.03 0 48 0 16
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    0 TABLE ACCESS CLUSTER TYPE_MISC$ (cr=0 pr=0 pw=0 time=0 us)
    0 INDEX UNIQUE SCAN I_OBJ# (cr=0 pr=0 pw=0 time=0 us)(object id 3)
    select source
    from
    source$ where obj#=:1 order by line
    call count cpu elapsed disk query current rows
    Parse 4 0.01 0.00 0 0 0 0
    Execute 4 0.02 0.01 0 0 0 0
    Fetch 4 0.00 0.00 0 16 0 30
    total 12 0.03 0.02 0 16 0 30
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    2 TABLE ACCESS BY INDEX ROWID SOURCE$ (cr=4 pr=0 pw=0 time=244 us)
    2 INDEX RANGE SCAN I_SOURCE1 (cr=3 pr=0 pw=0 time=161 us)(object id 112)
    select obj#
    from
    oid$ where user#=:1 and oid$=:2
    call count cpu elapsed disk query current rows
    Parse 2 0.01 0.01 0 0 0 0
    Execute 6 0.02 0.02 0 0 0 0
    Fetch 6 0.00 0.00 0 18 0 6
    total 14 0.03 0.03 0 18 0 6
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    1 TABLE ACCESS BY INDEX ROWID OBJ#(291) (cr=3 pr=0 pw=0 time=165 us)
    1 INDEX UNIQUE SCAN OBJ#(292) (cr=2 pr=0 pw=0 time=105 us)(object id 292)
    select con#,obj#,rcon#,enabled,nvl(defer,0)
    from
    cdef$ where robj#=:1
    call count cpu elapsed disk query current rows
    Parse 6 0.00 0.00 0 0 0 0
    Execute 10 0.00 0.00 0 0 0 0
    Fetch 11 0.01 0.00 0 12 0 1
    total 27 0.01 0.00 0 12 0 1
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    select con#,type#,condlength,intcols,robj#,rcon#,match#,refact,nvl(enabled,0),
    rowid,cols,nvl(defer,0),mtime,nvl(spare1,0)
    from
    cdef$ where obj#=:1
    call count cpu elapsed disk query current rows
    Parse 6 0.00 0.00 0 0 0 0
    Execute 10 0.00 0.00 0 0 0 0
    Fetch 35 0.00 0.00 0 51 0 25
    total 51 0.00 0.00 0 51 0 25
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    select intcol#,nvl(pos#,0),col#,nvl(spare1,0)
    from
    ccol$ where con#=:1
    call count cpu elapsed disk query current rows
    Parse 4 0.00 0.00 0 0 0 0
    Execute 25 0.00 0.00 0 0 0 0
    Fetch 52 0.01 0.00 0 104 0 27
    total 81 0.01 0.00 0 104 0 27
    Misses in library cache during parse: 0
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    select u.name, o.name, a.interface_version#
    from
    association$ a, user$ u, obj$ o where a.obj# = :1
    and a.property = :2
    and a.statstype# = o.obj# and
    u.user# = o.owner#
    call count cpu elapsed disk query current rows
    Parse 6 0.02 0.01 0 0 0 0
    Execute 6 0.02 0.01 0 0 0 0
    Fetch 6 0.00 0.00 0 38 0 4
    total 18 0.04 0.02 0 38 0 4
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 1)
    Rows Row Source Operation
    0 NESTED LOOPS (cr=3 pr=0 pw=0 time=300 us)
    0 NESTED LOOPS (cr=3 pr=0 pw=0 time=288 us)
    0 TABLE ACCESS FULL ASSOCIATION$ (cr=3 pr=0 pw=0 time=280 us)
    0 TABLE ACCESS BY INDEX ROWID OBJ$ (cr=0 pr=0 pw=0 time=0 us)
    0 INDEX UNIQUE SCAN I_OBJ1 (cr=0 pr=0 pw=0 time=0 us)(object id 36)
    0 TABLE ACCESS CLUSTER USER$ (cr=0 pr=0 pw=0 time=0 us)
    0 INDEX UNIQUE SCAN I_USER# (cr=0 pr=0 pw=0 time=0 us)(object id 11)
    select count(*)
    FROM
    pt_source a, trj_tmp_buf b, TABLE (SDO_JOIN('PT_SOURCE', 'SHAPE',
    'TRJ_TMP_BUF', 'SHAPE', 'mask=ANYINTERACT')) c, pollution_source d WHERE
    c.rowid1 = a.rowid AND c.rowid2 = b.rowid and d.id=a.id
    call count cpu elapsed disk query current rows
    Parse 1 0.25 0.21 0 165 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 0.25 0.21 0 165 0 0
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 58 (APPDEV)
    Rows Execution Plan
    0 SELECT STATEMENT MODE: ALL_ROWS
    0 SORT (AGGREGATE)
    0 HASH JOIN
    0 INDEX MODE: ANALYZED (FAST FULL SCAN) OF 'SYS_C005072'
    (INDEX (UNIQUE))
    0 NESTED LOOPS
    0 HASH JOIN
    0 INDEX MODE: ANALYZED (FULL SCAN) OF 'SYS_C005098'
    (INDEX (UNIQUE))
    0 COLLECTION ITERATOR (PICKLER FETCH) OF 'SDO_JOIN'
    0 TABLE ACCESS MODE: ANALYZED (BY USER ROWID) OF
    'PT_SOURCE' (TABLE)
    SELECT USER
    FROM
    DUAL
    call count cpu elapsed disk query current rows
    Parse 2 0.01 0.00 0 0 0 0
    Execute 2 0.00 0.00 0 0 0 0
    Fetch 2 0.00 0.00 0 0 0 2
    total 6 0.01 0.00 0 0 0 2
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 58 (APPDEV) (recursive depth: 1)
    Rows Execution Plan
    0 SELECT STATEMENT MODE: ALL_ROWS
    0 FAST DUAL
    SELECT INSTR(:B1 , '.')
    FROM
    DUAL
    call count cpu elapsed disk query current rows
    Parse 2 0.02 0.01 0 0 0 0
    Execute 2 0.00 0.00 0 0 0 0
    Fetch 2 0.00 0.00 0 0 0 2
    total 6 0.02 0.01 0 0 0 2
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 58 (APPDEV) (recursive depth: 1)
    Rows Execution Plan
    0 SELECT STATEMENT MODE: ALL_ROWS
    0 FAST DUAL
    select cols,audit$,textlength,intcols,property,flags,rowid
    from
    view$ where obj#=:1
    call count cpu elapsed disk query current rows
    Parse 7 0.00 0.00 0 0 0 0
    Execute 7 0.00 0.00 0 0 0 0
    Fetch 7 0.00 0.00 0 21 0 7
    total 21 0.00 0.01 0 21 0 7
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 2)
    Rows Row Source Operation
    1 TABLE ACCESS BY INDEX ROWID OBJ#(62) (cr=3 pr=0 pw=0 time=168 us)
    1 INDEX UNIQUE SCAN OBJ#(98) (cr=2 pr=0 pw=0 time=106 us)(object id 98)
    select text
    from
    view$ where rowid=:1
    call count cpu elapsed disk query current rows
    Parse 12 0.04 0.01 0 0 0 0
    Execute 12 0.01 0.00 0 0 0 0
    Fetch 12 0.00 0.00 0 24 0 12
    total 36 0.05 0.02 0 24 0 12
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 2)
    Rows Row Source Operation
    0 TABLE ACCESS BY USER ROWID VIEW$ (cr=0 pr=0 pw=0 time=0 us)
    SELECT index_owner, index_name
    from
    all_ind_columns WHERE table_name = 'PT_SOURCE' and column_name = 'SHAPE'
    and table_owner = 'APPDEV'
    call count cpu elapsed disk query current rows
    Parse 1 0.17 0.17 0 3 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 0.00 0.00 0 43 0 1
    total 3 0.17 0.17 0 46 0 1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 58 (APPDEV) (recursive depth: 1)
    error during execute of EXPLAIN PLAN statement
    ORA-01039: insufficient privileges on underlying objects of the view
    parse error offset: 100
    SELECT index_owner, index_name
    from
    all_ind_columns WHERE table_name = 'TRJ_TMP_BUF' and column_name = 'SHAPE'
    and table_owner = 'APPDEV'
    call count cpu elapsed disk query current rows
    Parse 1 0.15 0.14 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 0.00 0.00 0 38 0 1
    total 3 0.15 0.14 0 38 0 1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 58 (APPDEV) (recursive depth: 1)
    error during execute of EXPLAIN PLAN statement
    ORA-01039: insufficient privileges on underlying objects of the view
    parse error offset: 100
    SELECT sdo_rtree_height
    from
    all_sdo_index_metadata WHERE sdo_index_name = 'PT_SPATIAL_IDX' and
    sdo_index_owner = 'APPDEV'
    call count cpu elapsed disk query current rows
    Parse 1 0.22 0.19 0 51 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 0.00 0.00 0 24 0 1
    total 3 0.22 0.19 0 75 0 1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 58 (APPDEV) (recursive depth: 1)
    error during execute of EXPLAIN PLAN statement
    ORA-01039: insufficient privileges on underlying objects of the view
    parse error offset: 93
    SELECT sdo_rtree_height
    from
    all_sdo_index_metadata WHERE sdo_index_name = 'TRJ_TMP_BUF_SPT_IDX' and
    sdo_index_owner = 'APPDEV'
    call count cpu elapsed disk query current rows
    Parse 1 0.09 0.08 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 0.00 0.00 0 24 0 1
    total 3 0.09 0.08 0 24 0 1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 58 (APPDEV) (recursive depth: 1)
    error during execute of EXPLAIN PLAN statement
    ORA-01039: insufficient privileges on underlying objects of the view
    parse error offset: 93
    select numbind, nextbindnum, property
    from
    operator$ where obj#=:1
    call count cpu elapsed disk query current rows
    Parse 2 0.01 0.00 0 0 0 0
    Execute 2 0.02 0.01 0 0 0 0
    Fetch 2 0.00 0.00 0 4 0 2
    total 6 0.03 0.02 0 4 0 2
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 2)
    Rows Row Source Operation
    1 TABLE ACCESS BY INDEX ROWID OPERATOR$ (cr=2 pr=0 pw=0 time=138 us)
    1 INDEX UNIQUE SCAN OPER1 (cr=1 pr=0 pw=0 time=81 us)(object id 369)
    select bind#, functionname, property, returnschema, returntype, impschema,
    imptype
    from
    opbinding$ where obj# = :1
    call count cpu elapsed disk query current rows
    Parse 2 0.01 0.01 0 21 0 0
    Execute 2 0.03 0.01 0 0 0 0
    Fetch 4 0.00 0.00 0 6 0 2
    total 8 0.04 0.02 0 27 0 2
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 2)
    Rows Row Source Operation
    1 TABLE ACCESS BY INDEX ROWID OPBINDING$ (cr=3 pr=0 pw=0 time=198 us)
    1 INDEX RANGE SCAN OPBIND1 (cr=2 pr=0 pw=0 time=196 us)(object id 371)
    select position, type
    from
    oparg$ where obj#=:1 and bind#=:2 order by position
    call count cpu elapsed disk query current rows
    Parse 2 0.01 0.01 0 0 0 0
    Execute 2 0.02 0.01 0 0 0 0
    Fetch 8 0.00 0.00 0 4 0 6
    total 12 0.03 0.03 0 4 0 6
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 2)
    Rows Row Source Operation
    3 SORT ORDER BY (cr=2 pr=0 pw=0 time=343 us)
    3 TABLE ACCESS BY INDEX ROWID OPARG$ (cr=2 pr=0 pw=0 time=215 us)
    3 INDEX RANGE SCAN OPARG1 (cr=1 pr=0 pw=0 time=127 us)(object id 375)
    select obj#,implobj#,property, interface_version#
    from
    indtypes$ where obj#=:1
    call count cpu elapsed disk query current rows
    Parse 1 0.01 0.00 0 0 0 0
    Execute 1 0.01 0.00 0 0 0 0
    Fetch 1 0.00 0.00 0 3 0 1
    total 3 0.02 0.01 0 3 0 1
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 2)
    Rows Row Source Operation
    1 TABLE ACCESS FULL OBJ#(376) (cr=3 pr=0 pw=0 time=242 us)
    select obj#,oper#,bind#,property,filt_nam,filt_sch, filt_typ
    from
    indop$ where obj#=:1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 49 0.00 0.00 0 51 0 48
    total 51 0.00 0.01 0 51 0 48
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 2)
    Rows Row Source Operation
    48 TABLE ACCESS FULL OBJ#(377) (cr=51 pr=0 pw=0 time=239 us)
    declare
    rstr varchar2(4000);
    begin
    :1 := "MDSYS"."SDO_INDEX_METHOD_10I".ODCIINDEXREWRITE(SYS.ODCIINDEXINFO('APPDEV', 'TRJ_TMP_BUF_SPT_IDX',
    SYS.ODCICOLINFOLIST(SYS.ODCICOLINFO('APPDEV', 'TRJ_TMP_BUF', '"SHAPE"', 'SDO_GEOMETRY', 'MDSYS', NULL)),
    NULL, 0, 0),
    SYS.ODCIINDEXINFO('APPDEV', 'PT_SPATIAL_IDX',
    SYS.ODCICOLINFOLIST(SYS.ODCICOLINFO('APPDEV', 'PT_SOURCE', '"SHAPE"', 'SDO_GEOMETRY', 'MDSYS', NULL)),
    NULL, 0, 0),
    'B', 'A', SYS.ODCIPREDINFO('MDSYS', 'SDO_RELATE', NULL, 13), SYS.ODCIQUERYINFO(2, NULL),
    'TRUE', 'TRUE', 'querytype=window mask=ANYINTERACT', rstr, SYS.ODCIENV(0, 0, 0, 24));
    :2 := rstr;
    end;
    call count cpu elapsed disk query current rows
    Parse 1 0.01 0.00 0 0 0 0
    Execute 1 0.14 0.18 0 360 0 1
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 0.15 0.19 0 360 0 1
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 36 (MDSYS) (recursive depth: 2)
    select audit$
    from
    library$ where obj#=:1
    call count cpu elapsed disk query current rows
    Parse 1 0.01 0.00 0 0 0 0
    Execute 1 0.02 0.01 0 0 0 0
    Fetch 1 0.00 0.00 0 3 0 1
    total 3 0.03 0.02 0 3 0 1
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 3)
    Rows Row Source Operation
    1 TABLE ACCESS CLUSTER LIBRARY$ (cr=3 pr=0 pw=0 time=202 us)
    1 INDEX UNIQUE SCAN I_OBJ# (cr=2 pr=0 pw=0 time=73 us)(object id 3)
    SELECT sdo_diminfo, nvl(sdo_srid,-1)
    FROM
    SDO_GEOM_METADATA_TABLE WHERE SDO_OWNER = 'APPDEV' AND SDO_TABLE_NAME =
    UPPER('TRJ_TMP_BUF') AND '"'||SDO_COLUMN_NAME||'"' = '"SHAPE"'
    call count cpu elapsed disk query current rows
    Parse 1 0.04 0.05 0 6 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 0.00 0.00 0 2 0 1
    total 3 0.04 0.05 0 8 0 1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 36 (MDSYS) (recursive depth: 3)
    Rows Row Source Operation
    0 TABLE ACCESS BY INDEX ROWID SDO_GEOM_METADATA_TABLE (cr=0 pr=0 pw=0 time=0 us)
    0 INDEX RANGE SCAN SDO_GEOM_IDX (cr=0 pr=0 pw=0 time=0 us)(object id 41168)
    error during execute of EXPLAIN PLAN statement
    ORA-00942: table or view does not exist
    parse error offset: 107
    SELECT sdo_diminfo, nvl(sdo_srid,-1)
    FROM
    SDO_GEOM_METADATA_TABLE WHERE SDO_OWNER = 'APPDEV' AND SDO_TABLE_NAME =
    UPPER('PT_SOURCE') AND '"'||SDO_COLUMN_NAME||'"' = '"SHAPE"'
    call count cpu elapsed disk query current rows
    Parse 1 0.03 0.03 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 0.00 0.00 0 2 0 1
    total 3 0.03 0.03 0 2 0 1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 36 (MDSYS) (recursive depth: 3)
    Rows Row Source Operation
    0 TABLE ACCESS BY INDEX ROWID SDO_GEOM_METADATA_TABLE (cr=0 pr=0 pw=0 time=0 us)
    0 INDEX RANGE SCAN SDO_GEOM_IDX (cr=0 pr=0 pw=0 time=0 us)(object id 41168)
    error during execute of EXPLAIN PLAN statement
    ORA-00942: table or view does not exist
    parse error offset: 107
    SELECT nvl(sdo_level,0), nvl(sdo_numtiles,0), nvl(sdo_maxlevel, 0),
    sdo_index_table, sdo_index_primary, sdo_index_type, nvl(sdo_rtree_height, 0)
    , nvl(sdo_rtree_num_nodes, 0), nvl(sdo_rtree_dimensionality, 0),
    nvl(sdo_rtree_fanout, 0), nvl(sdo_rtree_root, 'EMPTY'),
    nvl(sdo_rtree_seq_name, 'DEFAULT'), sdo_index_partition,
    nvl(sdo_partitioned, 0), nvl(sdo_layer_gtype, 'DEFAULT'),
    nvl(sdo_index_dims, 0), nvl(sdo_rtree_pctfree, 10), nvl(sdo_rtree_quality,
    0), nvl(sdo_index_version, 0), nvl(sdo_tablespace, 'DEFAULT'),
    nvl(sdo_index_geodetic, 'FALSE'), sdo_index_status
    FROM
    sdo_index_metadata_table WHERE sdo_index_owner = 'APPDEV' and sdo_index_name
    = 'TRJ_TMP_BUF_SPT_IDX' ORDER BY SDO_INDEX_PRIMARY
    call count cpu elapsed disk query current rows
    Parse 1 0.04 0.03 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 2 0.00 0.00 0 2 0 1
    total 4 0.04 0.03 0 2 0 1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 36 (MDSYS) (recursive depth: 3)
    Rows Row Source Operation
    1 SORT ORDER BY (cr=2 pr=0 pw=0 time=366 us)
    1 TABLE ACCESS BY INDEX ROWID SDO_INDEX_METADATA_TABLE (cr=2 pr=0 pw=0 time=216 us)
    1 INDEX RANGE SCAN SDO_IDX_MDATA_IDX (cr=1 pr=0 pw=0 time=136 us)(object id 49332)
    error during execute of EXPLAIN PLAN statement
    ORA-00942: table or view does not exist
    parse error offset: 639
    SELECT nvl(sdo_level,0), nvl(sdo_numtiles,0), nvl(sdo_maxlevel, 0),
    sdo_index_table, sdo_index_primary, sdo_index_type, nvl(sdo_rtree_height, 0)
    , nvl(sdo_rtree_num_nodes, 0), nvl(sdo_rtree_dimensionality, 0),
    nvl(sdo_rtree_fanout, 0), nvl(sdo_rtree_root, 'EMPTY'),
    nvl(sdo_rtree_seq_name, 'DEFAULT'), sdo_index_partition,
    nvl(sdo_partitioned, 0), nvl(sdo_layer_gtype, 'DEFAULT'),
    nvl(sdo_index_dims, 0), nvl(sdo_rtree_pctfree, 10), nvl(sdo_rtree_quality,
    0), nvl(sdo_index_version, 0), nvl(sdo_tablespace, 'DEFAULT'),
    nvl(sdo_index_geodetic, 'FALSE'), sdo_index_status
    FROM
    sdo_index_metadata_table WHERE sdo_index_owner = 'APPDEV' and sdo_index_name
    = 'PT_SPATIAL_IDX' ORDER BY SDO_INDEX_PRIMARY
    call count cpu elapsed disk query current rows
    Parse 1 0.03 0.02 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 2 0.00 0.00 0 2 0 1
    total 4 0.03 0.02 0 2 0 1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 36 (MDSYS) (recursive depth: 3)
    Rows Row Source Operation
    1 SORT ORDER BY (cr=2 pr=0 pw=0 time=388 us)
    1 TABLE ACCESS BY INDEX ROWID SDO_INDEX_METADATA_TABLE (cr=2 pr=0 pw=0 time=236 us)
    1 INDEX RANGE SCAN SDO_IDX_MDATA_IDX (cr=1 pr=0 pw=0 time=138 us)(object id 49332)
    error during execute of EXPLAIN PLAN statement
    ORA-00942: table or view does not exist
    parse error offset: 639
    declare
    cost sys.ODCICost := sys.ODCICost(NULL, NULL, NULL, NULL);
    obj0 "MDSYS"."SDO_GEOMETRY" := "MDSYS"."SDO_GEOMETRY"(NULL, NULL, NULL, NULL, NULL);
    obj1 "MDSYS"."SDO_GEOMETRY" := "MDSYS"."SDO_GEOMETRY"(NULL, NULL, NULL, NULL, NULL);
    begin
    :1 := "MDSYS"."SDO_STATISTICS".ODCIStatsFunctionCost(
    sys.ODCIFuncInfo('MDSYS',
    'SDO_3GL',
    'RELATE',
    2),
    cost,
    sys.ODCIARGDESCLIST(sys.ODCIARGDESC(2, 'TRJ_TMP_BUF', 'APPDEV', '"SHAPE"', NULL, NULL, NULL), sys.ODCIARGDESC(2, 'PT_SOURCE', 'APPDEV', '"SHAPE"', NULL, NULL, NULL), sys.ODCIARGDESC(3, NULL, NULL, NULL, NULL, NULL, NULL))
    , obj0, obj1, :5,
    sys.ODCIENV(:6,:7,:8,:9));
    if cost.CPUCost IS NULL then
    :2 := -1;
    else
    :2 := cost.CPUCost;
    end if;
    if cost.IOCost IS NULL then
    :3 := -1;
    else
    :3 := cost.IOCost;
    end if;
    if cost.NetworkCost IS NULL then
    :4 := -1;
    else
    :4 := cost.NetworkCost;
    end if;
    exception
    when others then
    raise;
    end;
    call count cpu elapsed disk query current rows
    Parse 2 0.01 0.00 0 0 0 0
    Execute 2 0.09 0.10 0 228 0 2
    Fetch 0 0.00 0.00 0 0 0 0
    total 4 0.10 0.11 0 228 0 2
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 58 (APPDEV) (recursive depth: 2)
    declare
    sel number;
    obj0 "MDSYS"."SDO_GEOMETRY" := "MDSYS"."SDO_GEOMETRY"(NULL, NULL, NULL, NULL, NULL);
    obj1 "MDSYS"."SDO_GEOMETRY" := "MDSYS"."SDO_GEOMETRY"(NULL, NULL, NULL, NULL, NULL);
    begin
    :1 := "MDSYS"."SDO_STATISTICS".ODCIStatsSelectivity(
    sys.ODCIPREDINFO('MDSYS',
    'SDO_3GL',
    'RELATE',
    173),
    sel,
    sys.ODCIARGDESCLIST(sys.ODCIARGDESC(3, NULL, NULL, NULL, NULL, NULL, NULL), sys.ODCIARGDESC(3, NULL, NULL, NULL, NULL, NULL, NULL), sys.ODCIARGDESC(2, 'TRJ_TMP_BUF', 'APPDEV', '"SHAPE"', NULL, NULL, NULL), sys.ODCIARGDESC(2, 'PT_SOURCE', 'APPDEV', '"SHAPE"', NULL, NULL, NULL), sys.ODCIARGDESC(3, NULL, NULL, NULL, NULL, NULL, NULL)),
    :3,
    :4
    , obj0, obj1, :5,
    sys.ODCIENV(:6,:7,:8,:9));
    if sel IS NULL then
    :2 := -1;
    else
    :2 := sel;
    end if;
    exception
    when others then
    raise;
    end;
    call count cpu elapsed disk query current rows
    Parse 1 0.01 0.01 0 0 0 0
    Execute 1 0.06 0.05 0 180 0 1
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 0.07 0.06 0 180 0 1
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 58 (APPDEV) (recursive depth: 2)
    select a.default_cpu_cost, a.default_io_cost
    from
    association$ a where a.obj# = :1
    and a.property = :2
    call count cpu elapsed disk query current rows
    Parse 1 0.01 0.00 0 0 0 0
    Execute 1 0.01 0.01 0 0 0 0
    Fetch 1 0.00 0.00 0 3 0 0
    total 3 0.02 0.02 0 3 0 0
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 2)
    Rows Row Source Operation
    0 TABLE ACCESS FULL ASSOCIATION$ (cr=3 pr=0 pw=0 time=208 us)
    declare
    cost sys.ODCICost := sys.ODCICost(NULL, NULL, NULL, NULL);
    obj1 "MDSYS"."SDO_GEOMETRY" := "MDSYS"."SDO_GEOMETRY"(NULL, NULL, NULL, NULL, NULL);
    obj2 "MDSYS"."SDO_GEOMETRY" := "MDSYS"."SDO_GEOMETRY"(NULL, NULL, NULL, NULL, NULL);
    begin
    :1 := "MDSYS"."SDO_STATISTICS".ODCIStatsIndexCost(
    sys.ODCIINDEXINFO('APPDEV',
    'TRJ_TMP_BUF_SPT_IDX',
    sys.ODCICOLINFOLIST(sys.ODCICOLINFO('APPDEV', 'TRJ_TMP_BUF', '"SHAPE"', 'SDO_GEOMETRY', 'MDSYS', NULL)),
    NULL,
    0,
    0),
    1.00000000,
    cost,
    sys.ODCIQUERYINFO(2,
    NULL),
    sys.ODCIPREDINFO('MDSYS',
    'SDO_RTREE_RELATE',
    NULL,
    141),
    sys.ODCIARGDESCLIST(sys.ODCIARGDESC(3, NULL, NULL, NULL, NULL, NULL, NULL), sys.ODCIARGDESC(3, NULL, NULL, NULL, NULL, NULL, NULL), sys.ODCIARGDESC(2, 'TRJ_TMP_BUF', 'APPDEV', '"SHAPE"', NULL, NULL, NULL), sys.ODCIARGDESC(2, 'PT_SOURCE', 'APPDEV', '"SHAPE"', NULL, NULL, NULL), sys.ODCIARGDESC(3, NULL, NULL, NULL, NULL, NULL, NULL)),
    :6,
    :7
    , obj2, :8,
    sys.ODCIENV(:9,:10,:11,:12));
    if cost.CPUCost IS NULL then
    :2 := -1;
    else
    :2 := cost.CPUCost;
    end if;
    if cost.IOCost IS NULL then
    :3 := -1;
    else
    :3 := cost.IOCost;
    end if;
    if cost.NetworkCost IS NULL then
    :4 := -1;
    else
    :4 := cost.NetworkCost;
    end if;
    :5 := cost.IndexCostInfo;
    exception
    when others then
    raise;
    end;
    call count cpu elapsed disk query current rows
    Parse 1 0.01 0.01 0 0 0 0
    Execute 0 0.00 0.00 0 0 0 0
    Fetch 0 0.00 0.00 0 0 0 0
    total 1 0.01 0.01 0 0 0 0
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 58 (APPDEV) (recursive depth: 2)
    SELECT /*+ MERGE USE_NL(b) */ a.rowid, b.rowid
    from
    PT_SOURCE a, TRJ_TMP_BUF b WHERE sdo_relate(b.SHAPE, a.SHAPE, 'querytype=
    window mask=ANYINTERACT')= 'TRUE'
    call count cpu elapsed disk query current rows
    Parse 1 0.30 0.30 0 894 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 0 0.00 0.00 0 0 0 0
    total 2 0.30 0.30 0 894 0 0
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 58 (APPDEV) (recursive depth: 1)
    Rows Execution Plan
    0 SELECT STATEMENT MODE: ALL_ROWS
    0 NESTED LOOPS
    0 TABLE ACCESS MODE: ANALYZED (FULL) OF 'TRJ_TMP_BUF' (TABLE)
    0 TABLE ACCESS MODE: ANALYZED (FULL) OF 'PT_SOURCE' (TABLE)
    SELECT DIMINFO
    FROM
    ALL_SDO_GEOM_METADATA WHERE OWNER = 'APPDEV' AND TABLE_NAME = 'TRJ_TMP_BUF'
    AND COLUMN_NAME = 'SHAPE'
    call count cpu elapsed disk query current rows
    Parse 1 0.50 0.51 0 9 0 0
    Execute 1960 1.79 1.62 0 0 0 0
    Fetch 1960 8.38 8.13 0 43120 0 1960
    total 3921 10.67 10.27 0 43129 0 1960
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 58 (APPDEV) (recursive depth: 2)
    error during execute of EXPLAIN PLAN statement
    ORA-01039: insufficient privileges on underlying objects of the view
    parse error offset: 84
    SELECT signature, nhash, sqlarea_hash, last_used, inuse_features, flags,
    modified, incarnation
    FROM
    sql$ WHERE signature = :1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.01 0.02 0 0 0 0
    Fetch 1 0.00 0.00 0 2 0 1
    total 3 0.01 0.02 0 2 0 1
    Misses in library cache during parse: 1
    Misses in library cache during execute: 1
    Optimizer mode: CHOOSE
    Parsing user id: SYS (recursive depth: 3)
    Rows Row Source Operation
    1 TABLE ACCESS BY INDEX ROWID SQL$ (cr=2 pr=0 pw=0 time=162 us)
    1 INDEX UNIQUE SCAN I_SQL$SIGNATURE (cr=1 pr=0 pw=0 time=104 us)(object id 453)
    SELECT category
    FROM
    sqlprof$ WHERE signature = :1
    call count cpu e

  • Inner Join in oracle 10g

    Is it possible to use inner join in oracle 10g?

    SQL> select ename, dname
      2  from emp inner join dept
      3  on emp.deptno=dept.deptno;
    ENAME      DNAME
    SMITH      RESEARCH
    ALLEN      SALES
    WARD       SALES
    JONES      RESEARCH
    MARTIN     SALES
    BLAKE      SALES
    CLARK      ACCOUNTING
    SCOTT      RESEARCH
    KING       ACCOUNTING
    TURNER     SALES
    ADAMS      RESEARCH
    ENAME      DNAME
    JAMES      SALES
    FORD       RESEARCH
    MILLER     ACCOUNTING
    14 rows selected.
    SQL>

  • How to provide joins between oracle tables and sql server tables

    Hi,
    I have a requirement that i need to generate a report form two different data base. i.e Oracle and Sql Server.
    how to provide joins between oracle tables and sql server tables ? Any help on this
    Regards,
    Malli

    user10675696 wrote:
    I have a requirement that i need to generate a report form two different data base. i.e Oracle and Sql Server. Bad idea most times. Heterogeneous joins do not exactly scale and performance can be severely degraded by network speed and b/w availability. And there is nothing you can do in the application and database layers to address performance issue at the network level in this case - your code's performance is simply at the mercy of network performance. With a single glaring fact - network performance is continually degrading. All the time. Always. Until it is upgraded. When the performance degradation starts all over again.
    If the tables are not small (few 1000 rows each) and row volumes static, I would not consider doing a heterogeneous join. Instead I would rather go for a materialised view on the Oracle side, use a proper table and index structure, and do a local database join.

  • Join the Oracle Commerce Special Interest Group (SIG)!

    Oracle Retail User Group (ORUG) is expanding to build the Oracle Commerce Special Interest Group (SIG).
    The Oracle Commerce SIG is run by customers for customers, and offers you a venue to share best practices, tips & tricks, as well as interact with our product management team on latest product functionality. The group will host quarterly webcast plus an annual in-person event tied to one of the premier Oracle conferences.
    Enjoy exclusive benefits and product direction input reserved just for our members. Register to join the Oracle Commerce Special Interest Group today!
    https://www.surveymonkey.com/s/commerce-sig

    bump

  • Spatial Join on Topology feature layers

    I would like to be able to do a "spatial join" on topolgy feature layers. With sdo_geometry layers a spatial join finds ALL specified spatial interactions between complete layers. I would like to know if this is possible using topology feature layers, or if this functionality may be coming in the future along with (hopefully) sdo_topo_nn, sdo_topo_nn_distance, and sdo_topo_within_distance....?
    Alden

    Hi,
    updating millions of records could lock your resource and other users may have trouble connecting or reading data.
    In some cases, variable table is your friend, insert the data you needed to a variable table before issuing the update.
    with that, you may need to have (nolock) on each table. eg. 
    [LegislativeMapData2014].[dbo].[CONGRESS_2014] (nolock)
    Regards,
    gioVhan
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • How do u write a LEFT JOIN in Oracle Developer Forms 6i?

    I have 2 tables:PERSDET and EMP_MEDICAL_LTA
    PERSDET has EMP_ID,EMP_NAME n some other fields.
    EMP_MEDICAL_LTA has EMP_ID,FIELD1,FIELD2 n some other fields
    EMP_ID is the common field between these 2 tables.
    My requirement is to display all the EMP_NAME,that is-EMP_NAME which have field1 and field2 entries, as well as EMP_NAME which donot have field1 and field2 entries. I thought of using a LEFT join for this operation. The query I used is as follows:
    SELECT PERSDET.emp_id,PERSDET.emp_name,EMP_MEDICAL_LTA.field1,EMP_MEDICAL_LTA.field2 into emp_id,emp_name,m,l FROM
    PERSDET LEFT JOIN EMP_MEDICAL_LTA ON PERSDET.emp_id=EMP_MEDICAL_LTA.EMP_ID
    where …<some other joining conditions>;
    This query worked perfectly fine when I tried it running on the SQL prompt, but when I wrote it in a cursor in Oracle Forms 6i, it gave an error on the “LEFT” keyword!
    Is there any substitute for LEFT JOIN in Oracle Forms 6i???
    Please help!
    Thanks!

    hi,
    yes it is very much possible. and you query willbe as follows;
    SELECT PERSDET.emp_id,PERSDET.emp_name,EMP_MEDICAL_LTA.field1,EMP_MEDICAL_LTA.field2 into emp_id,emp_name,m,l FROM
    PERSDET where PERSDET.emp_id=EMP_MEDICAL_LTA.EMP_ID(+)
    where …<some other joining conditions>;
    yse, you just have to use (+) symble on the side where the join condition is not fullfilled. the 2 possibilites for your qury is PERSDET.emp_id=EMP_MEDICAL_LTA.EMP_ID(+)
    PERSDET.emp_id(+)=EMP_MEDICAL_LTA.EMP_ID
    you can execute both and suit your self.
    MohibMaan.

  • Java Spatial API documentation Oracle 9.2

    Where can I find the documentation for the Oracle 9.2 Spatial Java API?

    I have written a Java stored proc for converting GML to sdo_geometry in Oracle 10:
        oracle.spatial.util.GML gml = new oracle.spatial.util.GML();
        oracle.spatial.geometry.JGeometry geometry = gml.fromNodeToGeometry(node); Now I want to do the same in Oracle 9 but I can't even find any documentation. Is it possible to use Java types like JGeometry in Oracle 9 in a Java stored proc?

  • Large pages in Windows / Oracle

    Hi,
    Has anyone here tried to activate large pages in Windows/Oracle environment?
    ORA_LPENABLE = 1
    Does SAP support this?
    VMware pushes towards large pages.
    BR,
    Samuli Kaisanlahti

    Hi,
    Never tested it, but what I can confirm is that, at this moment, it is not supported in an SAP environment.
    Br,
    Javier

  • Performance Tuning - remove hash join

    Hi Every one,
    Can some one help in tuning below query, i have hash join taking around 84%, 
    SELECT
    PlanId
    ,ReplacementPlanId
    FROM
    ( SELECT
    pl.PlanId
    ,xpl.PlanId ReplacementPlanId
    ,ROW_NUMBER() OVER(PARTITION BY pl.PlanId ORDER BY xpl.PlanId) RN
    FROM [dbo].[Plan] pl
    JOIN [dbo].[Plan] xpl
    ON pl.PPlanId = xpl.PPlanId
    AND pl.Name = xpl.Name
    WHERE
    pl.SDate > (CONVERT(CHAR(10),DATEADD(M,-12,GETDATE()),120)) AND
    xpl.Live = 1
    AND pl.TypeId = 7
    AND xpl.TypeId = 7
    ) p
    WHERE RN = 1
    Thanks in advance

    Can you show an execution plan of the query? Is that possible to rewrite the query as 
    Sorry cannot test it right now
    SELECT
    PlanId
    ,ReplacementPlanId
    FROM
    (SELECT PlanId,Name,SDate,TypeId FROM [dbo].[Plan]) pl
    CROSS APPLY 
     SELECT TOP (1) TypeId ,Live FROM [Plan] xpl
     WHERE  pl.PPlanId = xpl.PPlanId
    AND pl.Name = xpl.Name
    ) AS Der
    WHERE pl.SDate > (CONVERT(CHAR(10),DATEADD(M,-12,GETDATE()),120)) AND  
    Der.Live = 1
    AND pl.TypeId = 7
    AND Der.TypeId = 7
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Tuning large query

    Hello,
    I have a query that will produce about 3M rows. The main problem is that when I execute the explain plan for it and see the explain results, I see that the estimate time total is about 999 hours.
    Also all joins are displayed as "full scan", I understand that the "full scan" comes because of the issue that all the records in joined tables are needed in the total resultset and optimizer does not use any indexes there...
    I have query similar to this example:
    select
    sub.field1,
    sub.field2,
    sub.field3,
    case
    when something > 1 then ...
    else ....
    end something_more
    from (
    select
    field1,
    field2,
    field3,
    (select something from sometable where sometable.field=table1.field) AS something
    from table1
    left join table2 on (...)
    left join table3 on (...)
    where ...
    What my drive optimizer crazy there? Or maybe it is useful to use some kind of optimizer hint?

    Post back some of the requested information, formatted with code tags, from these threads
    [How to post a tuning request|http://forums.oracle.com/forums/post!reply.jspa?messageID=3877933]
    [When your query takes too long|http://forums.oracle.com/forums/thread.jspa?threadID=501834]

  • Spatial & XML in Oracle 9.0.1

    Can We insert into Spatial - Geometry column of Oracle9i table using XSU?
    If so, please provide me the DTD a spatial column? It would be great if I get an example of the same.
    Regards,
    Easwar

    XSU currently doesn't have special handling for it? Would you help make sure if JDBC treat this like any other ADT? If not and you'd like XSU to support it. Please contact your Oracle support to file enhancement request.

  • How to use OUTER JOIN in Oracle Answers Filters?

    Hi, I need to have a filter on an 'Oracle Answers' report.
    The query from the NQQuery.log appears as below. (I have simplified the SELECT clause here for easy reading)
    SELECT t692.enquiry_business_route AS c1,
    t692.enquiry_id AS c11, t913.YEAR AS c12,
    t913.full_date AS c13, t666.surname AS c14,
    t666.post_code AS c15, t855.company_name AS c16,
    t983.notes AS c30
    FROM
    mkt_dw_enev_enhi_dim t983,
    mkt_dw_key_partner_dim t855,
    mkt_dw_event_type_dim t821,
    mkt_dw_customer_dim t666,
    mkt_dw_time_dim t913,
    mkt_dw_enquiry_event_fact t692
    WHERE (
    t692.enquiry_id = t983.enqu_id
    AND t666.customer_dim_key = t692.customer_dim_key
    AND t692.event_date_time_key = t913.time_dim_key
    AND TRUNC(t983.event_date)= t913.FULL_DATE
    AND t692.event_type = t821.event_type_dim_key
    AND t692.key_partner_dim_key = t855.key_partner_dim_key
    AND t821.event_type_category = 'RECEIVE_FEE'
    AND t913.YEAR = 2009
    and t692.enquiry_id = 535986
    For the following two lines I would like to have the OUTER JOIN.
    AND t692.event_type = t821.event_type_dim_key(+)
    AND t821.event_type_category(+) = 'RECEIVE_FEE' (THIS IS THE FILTER CONDITION, AT THE MOMENT IT DOESN'T WORK WITH OUTER JOIN SYMBOL)
    Please could you let me know the best way of achieving the above.
    Thanks
    Srikanth

    In the BMM layer in the join condition you will be able to specify the join to be (left, right or full outer join).
    You can even add the required table in the LTS(logical table source) and also specify a left, right or full outer join there as well.
    There is an interesting work around as mentioned in the below blog to get to the Outer join results with out changing anything in rpd but in Answers.
    http://obiee101.blogspot.com/2008/11/obiee-outerjoin-workaround.html
    Hope it helps
    Thanks
    prash

Maybe you are looking for

  • EPM 11.1.2 - wallet file errors trying to start foundation services.

    Running EPM 11.1.2 in a distributed environment. Middle tier is on linux REHL 5 VM, sql server database. Essbase servers are all linux REHL 5 servers. We have faced several challenges getting the environment up and stablized. Most recently after seve

  • Problem with a patch solution

    Hi. I have a problem. when made patch of the solution. I was to make change in a web service and save and active. When i tried make assemble and download customer/specific solution the changes not work because i don't see some fields I added in the w

  • Mobile Audio Voltage

    I have an old Sound Feeder that I used in the car to play my CDs. Jacks into the lighter socket. It has three output selections: 3-4.5V, 6V and 9V. Will 9V work for the iPod?

  • Apache Error Log after update from 2.0 to 2.2.1

    Yesterday, I upgraded from 2.0 to 2.2.1. This morning some problems - very few - are happening with the users trying to save their work. Not allways but sometimes, they get a blank screen after trying to save the recored or they get the "Page can not

  • Routings List

    Has anyone written query to show routing lists. In a column format. Similiar to the information shown in CA51. Thank you