SDO_RELATE JOIN

Oracle9i Question: Has anyone anywhere ever actually seen this spatial operator use the spatial index from both the tables in the join?
(Full table scans just won't cut it.)
Any hints, help, sample SQL or other insights are greatly appreciated.
Thank you.

In Oracle9i it is recommended that window queries be used when doing a spatial join. In Oracle Spatial 10g a new pseudo-operator sdo_join is introduced which will further enhance performance of spatial joins.
In Oracle9i, lets say you want to get all of the city/county pairs. Using the sample tables used for the course, there are 195 cities, and 3230 counties.
To get all of the city/county pairs, I would write the query as follows:
select /*+ ordered */ a.city, b.county
from geod_cities a, geod_counties b
where sdo_relate(b.geom, a.location,
'querytype=window mask=anyinteract') = 'TRUE';
Some notes on the query:
1) Use the ordered hint, and put the table the window comes from (geometry2) first in the from clause.
2) Use the table with smaller cardinality as the window table (note that cities has 195 rows, counties has 3230 rows).
3) If both tables have the same cardinality, and one has polygons and the other is of some other type, use the polygon table as the window table to enable the largest number of optimizations within spatial.
Hope this helps.

Similar Messages

  • 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.

  • Not using Index when SDO_RELATE in Spatial Query is used in LEFT OUTER JOIN

    I want to know for every City (Point geometry) in which Municipality (Polygon geometry) it is.
    Some cities will not be covered by any municipality (as there is no data for it), so its municipality name should be blank in the result
    We have 4942 cities (point geometries)
    and 500 municipalities (polygon geometry)
    SELECT T1.NAME as City, T2.NAME as Municipality
    FROM CITY T1
    LEFT OUTER JOIN MUNICIPALITY T2 ON SDO_RELATE(T1.GEOM, T2.GEOM, 'MASK=ANYINTERACT') = 'TRUE'The explain plan for this query is:
    SELECT STATEMENT
      FILTER
        Filter Predicates
          MDSYS.SDO_RTREE_RELATE(T1.GEOM, T2.GEOM, 'mask=ANYINTERACT querytype=window ') = 'TRUE'
        MERGE JOIN
          TABLE ACCESS              CITY               FULL                            11
          BUFFER                                       SORT                        100605
              TABLE ACCESS          MUNICIPALITY       FULL                            20So the cost is in the BUFFER (whatever that is), it takes +2000 seconds to run this, it is not using the spatial index.
    And we are not getting all rows, but only the ones interacting with a municipality, e.g. 2436 rows.
    But I want all rows, including the ones not interacting with any Municipality.
    When we want only those cities that actually are in a municipality, I use a different query and it will use the index.
    SELECT T1.NAME as City, T2.NAME as Municipality
    FROM CITY T1, MUNICIPALITY T2
    WHERE SDO_RELATE(T1.GEOM, T2.GEOM, 'MASK=ANYINTERACT') = 'TRUE'I get (only) 2436 rows (as expected) in 5 seconds (it is fast) and the explain plan shows it is using the spatial index.
    But in this case, I am not getting any cities not inside any municipality (of course)
    SELECT STATEMENT
       NESTED LOOPS
          TABLE ACCESS                   MUNICIPALITY       FULL                22
          TABLE ACCESS                   CITY               BY INDEX ROWID      22
             DOMAIN INDEX                CITY_SDX                                0
                Access Predicates
                   MDSYS.SDO_RTREE_RELATE(T1.GEOM, T2.GEOM, 'mask=ANYINTERACT querytype=window ') = 'TRUE'I always thought a LEFT OUTER JOIN would return all rows from the Table, whatever happens in the next,
    but it seems the query has been rewritten so that it is now using a Filter Predicate in the end, which filters those geometries having no interaction.
    As an example I also do thing alphanumerically, I do get 4942 rows, including the ones which have no Municipality name.
    In this case the names must match, so its only for testing if the LEFT OUTER JOIN returns stuff correctly, which it does in this case.
    SELECT T1.NAME as City, T2.NAME as Municipality
    FROM CITY T1
    LEFT OUTER JOIN MUNICIPALITY T2 ON T1.NAME = T2.NAMEIs this an Oracle Spatial bug, e.g. not return 4942 rows, but only 2436 rows on the first query?
    Note all tests performed on Oracle 11g R2 (11.2.0.1.0)

    Patrick,
    Even so, your geoms in the relate were the wrong way around.
    Also, I don't recall you saying (or showing) that you wanted the municipality geometry returned. Still,
    no matter, easy to do.
    Here are some additional suggestions. I don't have your data so I have had to use some of my own.
    set serveroutput on timing on autotrace on
    SELECT T1.SPECIES as City,
           (SELECT T2.ADMIN_NAME FROM AUSTRALIAN_STATES T2 WHERE SDO_ANYINTERACT(T2.GEOM, SDO_GEOM.SDO_BUFFER(T1.GEOM,10000,0.5,'UNIT=M')) = 'TRUE') as Municipality,
           (SELECT T2.GEOM       FROM AUSTRALIAN_STATES T2 WHERE SDO_ANYINTERACT(T2.GEOM, SDO_GEOM.SDO_BUFFER(T1.GEOM,10000,0.5,'UNIT=M')) = 'TRUE') as geom
      FROM GUTDATA T1;
    762 rows selected
    Elapsed: 00:00:21.656
    Plan hash value: 2160035213
    | Id  | Operation                   | Name                       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |                            |   762 | 49530 |     5   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| AUSTRALIAN_STATES          |     1 |   115 |     0   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | AUSTRALIAN_STATES_GEOM_SPX |       |       |     0   (0)| 00:00:01 |
    |   3 |  TABLE ACCESS BY INDEX ROWID| AUSTRALIAN_STATES          |     1 |   115 |     0   (0)| 00:00:01 |
    |*  4 |   DOMAIN INDEX              | AUSTRALIAN_STATES_GEOM_SPX |       |       |     0   (0)| 00:00:01 |
    |   5 |  TABLE ACCESS FULL          | GUTDATA                    |   762 | 49530 |     5   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("MDSYS"."SDO_ANYINTERACT"("T2"."GEOM","SDO_GEOM"."SDO_BUFFER"(:B1,10000,0.5,'UNIT=M'))='TRUE')
       4 - access("MDSYS"."SDO_ANYINTERACT"("T2"."GEOM","SDO_GEOM"."SDO_BUFFER"(:B1,10000,0.5,'UNIT=M'))='TRUE')
       Statistics
                   7  user calls
               24576  physical read total bytes
                   0  physical write total bytes
                   0  spare statistic 3
                   0  commit cleanout failures: cannot pin
                   0  TBS Extension: bytes extended
                   0  total number of times SMON posted
                   0  SMON posted for undo segment recovery
                   0  SMON posted for dropping temp segment
                   0  segment prealloc tasksThe above can look messy as you add more (SELECT ...) attributes, but is is fast (though can't use in Materialized Views).
    /* The set of all cities not in municipalities */
    SELECT T1.SPECIES                 as City,
           cast(null as varchar2(42)) as municipality,
           cast(null as sdo_geometry) as geom
      FROM GUTDATA T1
    WHERE NOT EXISTS (SELECT 1
                         FROM AUSTRALIAN_STATES T2
                        WHERE SDO_ANYINTERACT(T2.GEOM, SDO_GEOM.SDO_BUFFER(T1.GEOM,10000,0.5,'UNIT=M')) = 'TRUE')
    UNION ALL
    /* The set of all cities in municipalities */
    SELECT T1.SPECIES    as City,
           T2.ADMIN_NAME as Municipality,
           T2.GEOM       as geom
      FROM GUTDATA T1
           INNER JOIN
           AUSTRALIAN_STATES T2 ON (SDO_ANYINTERACT(T2.GEOM, SDO_GEOM.SDO_BUFFER(T1.GEOM,10000,0.5,'UNIT=M')) = 'TRUE');
    762 rows selected
    Elapsed: 00:00:59.953
    Plan hash value: 2854682795
    | Id  | Operation           | Name                       | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT    |                            |    99 | 13450 |    38  (87)| 00:00:01 |
    |   1 |  UNION-ALL          |                            |       |       |            |          |
    |*  2 |   FILTER            |                            |       |       |            |          |
    |   3 |    TABLE ACCESS FULL| GUTDATA                    |   762 | 49530 |     5   (0)| 00:00:01 |
    |*  4 |    DOMAIN INDEX     | AUSTRALIAN_STATES_GEOM_SPX |       |       |     0   (0)| 00:00:01 |
    |   5 |   NESTED LOOPS      |                            |    61 | 10980 |    33   (0)| 00:00:01 |
    |   6 |    TABLE ACCESS FULL| AUSTRALIAN_STATES          |     8 |   920 |     3   (0)| 00:00:01 |
    |*  7 |    TABLE ACCESS FULL| GUTDATA                    |     8 |   520 |     4   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter( NOT EXISTS (SELECT 0 FROM "AUSTRALIAN_STATES" "T2" WHERE "MDSYS"."SDO_ANYINTERACT"("T2"."GEOM","SDO_GEOM"."SDO_BUFFER"(:B1,10000,0.5,'UNIT=M'))='TRUE'))
       4 - access("MDSYS"."SDO_ANYINTERACT"("T2"."GEOM","SDO_GEOM"."SDO_BUFFER"(:B1,10000,0.5,'UNIT=M'))='TRUE')
       7 - filter("MDSYS"."SDO_ANYINTERACT"("T2"."GEOM","SDO_GEOM"."SDO_BUFFER"("T1"."GEOM",10000,0.5,'UNIT=M'))='TRUE')
       Statistics
                   7  user calls
              131072  physical read total bytes
                   0  physical write total bytes
                   0  spare statistic 3
                   0  commit cleanout failures: cannot pin
                   0  TBS Extension: bytes extended
                   0  total number of times SMON posted
                   0  SMON posted for undo segment recovery
                   0  SMON posted for dropping temp segment
                   0  segment prealloc tasksMuch slower but Materialized View friendly.
    This one is a bit more "natural" but still slower than the first.
    set serveroutput on timing on autotrace on
    /* The set of all cities in municipalities */
    WITH municipal_cities As (
      SELECT T1.ID         as City,
             T2.ADMIN_NAME as Municipality,
             T2.GEOM       as geom
        FROM GUTDATA T1
             INNER JOIN
             AUSTRALIAN_STATES T2 ON (SDO_ANYINTERACT(T2.GEOM, SDO_GEOM.SDO_BUFFER(T1.GEOM,10000,0.5,'UNIT=M')) = 'TRUE')
    SELECT T1.ID           as City,
           T2.Municipality as Municipality,
           T2.GEOM         as geom
      FROM GUTDATA          T1
           LEFT OUTER JOIN
           municipal_cities T2
           ON (T2.CITY = T1.ID);
    762 rows selected
    Elapsed: 00:00:50.228
    Plan hash value: 745978991
    | Id  | Operation             | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT      |                   |   762 | 44196 |    36   (3)| 00:00:01 |
    |*  1 |  HASH JOIN RIGHT OUTER|                   |   762 | 44196 |    36   (3)| 00:00:01 |
    |   2 |   VIEW                |                   |    61 |  3294 |    33   (0)| 00:00:01 |
    |   3 |    NESTED LOOPS       |                   |    61 | 10980 |    33   (0)| 00:00:01 |
    |   4 |     TABLE ACCESS FULL | AUSTRALIAN_STATES |     8 |   920 |     3   (0)| 00:00:01 |
    |*  5 |     TABLE ACCESS FULL | GUTDATA           |     8 |   520 |     4   (0)| 00:00:01 |
    |   6 |   INDEX FAST FULL SCAN| GUTDATA_ID_PK     |   762 |  3048 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - access("T2"."CITY"(+)="T1"."ID")
       5 - filter("MDSYS"."SDO_ANYINTERACT"("T2"."GEOM","SDO_GEOM"."SDO_BUFFER"("T1"."GEOM",10000,0.5,'UNIT=M'))='TRUE')
       Statistics
                   7  user calls
               49152  physical read total bytes
                   0  physical write total bytes
                   0  spare statistic 3
                   0  commit cleanout failures: cannot pin
                   0  TBS Extension: bytes extended
                   0  total number of times SMON posted
                   0  SMON posted for undo segment recovery
                   0  SMON posted for dropping temp segment
                   0  segment prealloc tasksFinally, the Pièce de résistance: trick the LEFT OUTER JOIN operator...
    set serveroutput on timing on autotrace on
    SELECT T1.SPECIES    as City,
           T2.ADMIN_NAME as Municipality,
           T2.GEOM       as geom
      FROM GUTDATA           T1
           LEFT OUTER JOIN
           AUSTRALIAN_STATES T2
           ON (t2.admin_name = to_char(t1.ID) OR
               SDO_ANYINTERACT(T2.GEOM, SDO_GEOM.SDO_BUFFER(T1.GEOM,10000,0.5,'UNIT=M')) = 'TRUE');
    762 rows selected
    Elapsed: 00:00:50.273
    Plan hash value: 158854308
    | Id  | Operation           | Name              | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT    |                   |   762 | 92964 |  2294   (1)| 00:00:28 |
    |   1 |  NESTED LOOPS OUTER |                   |   762 | 92964 |  2294   (1)| 00:00:28 |
    |   2 |   TABLE ACCESS FULL | GUTDATA           |   762 | 49530 |     5   (0)| 00:00:01 |
    |   3 |   VIEW              |                   |     1 |    57 |     3   (0)| 00:00:01 |
    |*  4 |    TABLE ACCESS FULL| AUSTRALIAN_STATES |     1 |   115 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       4 - filter("T2"."ADMIN_NAME"=TO_CHAR("T1"."ID") OR
                  "MDSYS"."SDO_ANYINTERACT"("T2"."GEOM","SDO_GEOM"."SDO_BUFFER"("T1"."GEOM",10000,0.5,'UNIT=M'))='TRUE')
       Statistics
                   7  user calls
                   0  physical read total bytes
                   0  physical write total bytes
                   0  spare statistic 3
                   0  commit cleanout failures: cannot pin
                   0  TBS Extension: bytes extended
                   0  total number of times SMON posted
                   0  SMON posted for undo segment recovery
                   0  SMON posted for dropping temp segment
                   0  segment prealloc tasksTry these combinations to see what works for you.
    Interestingly, for me, the following returns absolutely nothing.
    SELECT T1.SPECIES    as City,
           T2.ADMIN_NAME as Municipality
      FROM GUTDATA           T1
           LEFT OUTER JOIN
           AUSTRALIAN_STATES T2
           ON (SDO_ANYINTERACT(T2.GEOM, SDO_GEOM.SDO_BUFFER(T1.GEOM,10000,0.5,'UNIT=M')) = 'TRUE')
    MINUS
    SELECT T1.SPECIES    as City,
           T2.ADMIN_NAME as Municipality
      FROM GUTDATA           T1
           LEFT OUTER JOIN
           AUSTRALIAN_STATES T2
           ON (t2.admin_name =  to_char(t1.ID) OR
               SDO_ANYINTERACT(T2.GEOM, SDO_GEOM.SDO_BUFFER(T1.GEOM,10000,0.5,'UNIT=M')) = 'TRUE');(I leave it to you to see if you can see why as the LEFT OUTER JOIN seems to be working correctly for me but I am not going to dedicate time to detailed checking of results.)
    Note all tests performed on Oracle 11g R2 (11.2.0.1.0)
    If you get the answer you want: mark the post as answered to assign points.
    regards
    Simon

  • Can SDO_RELATE be used to join more than 2 tables?

    I'm trying to run a query like this:
    SELECT zip, sum(view1.column1), sum(view2.column2)
    FROM view1, view2, ZIP_CODES
    WHERE SDO_RELATE(view1.geoloc, ZIP_CODES.geoloc, 'mask=INSIDE')='TRUE'
    AND SDO_RELATE(view2.geoloc, ZIP_CODES.geoloc, 'mask=INSIDE')='TRUE'
    GROUP BY zip;
    but get "column ambiguously defined" error. Investigation pointed that error starts to occur right after adding second SDO_RELATE statement. See that all columns are fully qualified. The question is - can I ever run a query which joins 3 tables like this, or should I have a subquery which joins 2 of them, then join that subquery with ZIP_CODES once again to get zip code region, and only then join with second view using SDO_RELATE?

    Below, decribe of three dummy tables and the query on them.
    The output result (the sum) is a "non-sense" (in my case), but the query has worked.
    The geometry of my_tab1 is a POINT, the other two geometries are POLYGON.
    hope this help, best regard
    Carl
    SQL> desc my_tab1
    Name Null? Type
    ID_TAB NOT NULL NUMBER(10)
    PARCEL_CODE NOT NULL CHAR(5)
    GEOMETRY MDSYS.SDO_GEOMETRY
    SQL> desc my_tab2
    Name Null? Type
    ID_TAB NUMBER(10)
    PARCEL_CODE NOT NULL CHAR(5)
    AREA2 NUMBER(11,2)
    GEOMETRY MDSYS.SDO_GEOMETRY
    SQL> desc my_tab3
    Name Null? Type
    ID_TAB NUMBER(10)
    PARCEL_CODE NOT NULL CHAR(5)
    PARCEL_PROG NOT NULL NUMBER(5)
    AREA3 NUMBER(11,2)
    GEOMETRY MDSYS.SDO_GEOMETRY
    SQL> SELECT my_tab1.parcel_code, sum(my_tab2.area2), sum(my_tab3.area3)
    2 FROM my_tab1, my_tab2, my_tab3
    3 WHERE SDO_RELATE(my_tab2.geometry, my_tab1.geometry, 'mask=CONTAINS')='TRUE'
    4 AND SDO_RELATE(my_tab3.geometry, my_tab1.geometry, 'mask=CONTAINS')='TRUE'
    5 GROUP BY my_tab1.parcel_code;
    PARCE SUM(MY_TAB2.AREA2) SUM(MY_TAB3.AREA3)
    00025 11528.38 8839
    00090 2966.01 2966
    00120 679.77 679.77
    00130 3961.89 3962
    00132 2866.47 2866.47
    00204 6996 6949.04
    00213 8256.02 8255.62
    00214 2767.81 2767.81
    00230 2014.15 2014.15
    00232 378.63 378.63
    00005 4563.64 4563.64
    00020 1044.14 1044
    00024 11485.02 11485
    00079 709.6 709.6
    00084 2373.58 1831.28
    00106 12518.92 10199
    00116 3210.12 3210.12
    00127 2693.7 2693.7
    00128 6222.39 6170.82
    00137 2278.09 2278.09
    00160 18556.94 36495
    00166 16220.71 32373
    00217 46.95 1870
    00241 76167.45 73044.87
    00243 76167.45 73044.87
    00046 1837.22 1701.27
    ....

  • ORA-03232 Error on Spatial Join

    I am trying to run the following query. The tablesnames are pretty self explanitory.
    SELECT c.cnty,COUNTY(a.id)
    FROM county c,addr_points a
    WHERE SDO_RELATE(a.geoloc,c.geoloc,
    'mask = ANYINTERACT
    querytype = JOIN') = TRUE
    GROUP BY c.cnty;
    and am getting
    ORA-03232: unable to allocate an extent of 14 blocks from tablespace 2
    There is no such tablespace in our database, so we assumed it ment filename, which points to our rollback segments. These seem to be plenty large. We also not getting any alert logs that reflect this error. The docs on the error say to increase the default NEXT value on the tablespace, which we did. The current value is 5mb which is much larger than 14 blocks (block size is 8k).
    Any suggestions?
    Thanks
    null

    We got this to work, but we did it
    with a querytype=WINDOW instead of a JOIN.
    SELECT /*+ ORDERED */ c.cnty,COUNTY(a.id)
    FROM county c,
    addr_points a
    WHERE SDO_RELATE(a.geoloc,c.geoloc,
    'mask = ANYINTERACT querytype = WINDOW
    LAYER_GTYPE=POINT') = 'TRUE'
    GROUP BY c.cnty;
    ** A FEW NOTES **
    The ordered by hint is very important
    if you have more than one window
    getting passed into the second parameter
    of RELATE.
    Also when you use the ORDERED hint, it is
    important to make the table the windows
    are coming from listed first in the
    FROM clause.
    *** We are still looking into why
    the group by did not work with
    querytype = JOIN
    Will post something soon.
    Thanks.
    Dan
    null

  • 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

  • Problem with sdo_relate returning unexpected results

    I am having a problem with an oracle spatial query not returning what I feel is an appropriate result.
    I have a bounding box that has 6 points from a table that should be inside it. There are several hundred points total in this table. I perform the following query and oracle returns only 4 points, well 5 but we will get to that later, within the area of the search.
    SQL> Select feature_id
    From city_points A
    where (MDSYS.SDO_RELATE(A.GEOM, mdsys.sdo_geometry(2003, 8307, NULL, mdsys.sdo_elem_info_array(1,1003,1), mdsys.sdo_ordinate_array(-101.8417,-52.8083,-23.8417,-52.8083,-23.8417,-13.8083,-101.8417,-13.8083,101.8417,-52.8083)), 'mask=ANYINTERACT querytype=join') = 'TRUE');
    I used a different application to perform the same type of query. The difference is that the application does the spatial query, not oracle. Further the application gets all of the points and performs this query on the client. What the application returns is correct both visually and spatially.
    Two of the points not returned in the oracle spatial query are 300km inside the bounding box. This far exceeds the .5 m tolerance used in our decimal degrees data set (SRID 8307).
    I have experienced this problem on 9.2.0.1. I then patched that instance to 9.2.0.7 and duplicated the problem. I then exported the data and imported into a 10g release 1 database and again duplicated the problem. I have tried to re-index the data to no avail.
    I have also tried different querytypes also yielding less than expected results.
    The data looks like this:
    243
    SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-58.45, -34.6, NULL),NULL, NULL)
    254
    SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-56.18333, -34.883334, NULL), NULL, NULL)
    377
    SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-70.666671, -33.449999, NULL), NULL, NULL)
    385
    SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-68.149999, -16.5, NULL), NULL, NULL)
    388
    SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-47.916667, -15.783333, NULL), NULL, NULL)
    427
    SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-57.640066, -25.270295, NULL), NULL, NULL)
    The number is the id field, the rest is the geometry.
    The oracle spatial query above only returns id #s 359, 377,243,254,427
    There are five returned records. The extra value is outside the bounding area. So it should not have been returned at all. It is all too strange.
    I have seen this with different geometry types (points lines and area) as well.
    If anyone has suggestions, I would appreciate your comments.
    Thanks,
    John

    John,,
    What you are seeing is the behavior you should expect in the geodetic space.
    When you have a very long line connecting from longitude -101 to -23, that line
    does not follow the same latitude value.
    Since these points are in southern hemisphere, the line connecting them
    will curve downward (this is the great circle line).
    If you really want a line connecting with constant latitude, you should
    use the MBR type for the window geometry which densifies the
    lines along constant latitude before passing it into relate.
    SDO_GEOMETRY(2003, 8307, NULL,
    sdo_elem_info_array(1,1003,3),
    sdo_ordinate_array(-101.8417,-52.8083, 23.8417,-13.8083))
    siva

  • SDO_RELATE - EQUAL MASK - Different results on the same query

    Hello.
    I'm trying to find all spatial duplication in the point layer (using certain tolerance). That layer has q-tree spatial index and appropriate tolerance in the user_sdo_geom_metadata table (let's say 1 meter). I have SDO_VERSION=9.2.0.5.0.
    To perform that I use SDO_RELATE operator with EQUAL mask (I know that actually I can use other operators but lets consider EQUAL):
    SELECT /*+ ordered */t1.OBJECTID, /*+ ordered */t2.OBJECTID from points_table t1, points_table t2 WHERE t1.OBJECTID < t2.OBJECTID
    AND sdo_relate (t2.shape, t1.shape, 'mask=EQUAL querytype = JOIN') = 'TRUE'
    The problem is:
    If I create Q-tree index using SDO_LEVEL=8 query takes 10 minutes and returns lets say 1000 dup events
    If I create Q-tree index using SDO_LEVEL=10 query takes 20 seconds and returns lets say 996 dup events
    I'm confusing about that - Why the results are depend from SDO_LEVEL? For me it is more important then performanse.
    Those missed duplication events are really duplication events (point closer to each other than 1 meter) and SDO_DISTANSE for those particlar poins returns 0. It is correct, but SDO_RELATE monitors that those points are not equal.
    So how can I rely on the SDO_RELATE function? What SDO_LEVEL need I use to get correct results? I choosed Q-tree indexes because of performance I didn't get success to get result using R-tree indexes on big datasets at all.
    Regarding polylines:
    I suppose that I can get similar problem and for polylines (I’m also using same query to find dups polylines).
    Sometimes SDO_RELATE finds polylines which ones are not really equal in the specified tolerance (1 meter). All cases that I saw – it was simple segments which ones share only one vertex but the other ends are spatially disjoint more that 3 meters. Why SDO_RELATE finds such cases as EQUAL?
    Thank you very much in advance.

    Thank you Siva for advice.
    I've tried R-tree indexes and got reasonable performance on the tables with ~20k rows.
    But when I try to ran that query on the table (points) with 250k rows it takes forever :(.
    1) Create index:
    Create index nodes_idx on nodes(SHAPE) indextype is mdsys.spatial_index parameters ('LAYER_GTYPE=POINT initial=10m next=5m sdo_rtr_pctfree=10 pctincrease=0');
    /* actually 'initial=10m next=5m sdo_rtr_pctfree=10 pctincrease=0' options only decreased slightly performance */
    2) Execute query:
    SELECT /*+ ordered */t1.OBJECTID, /*+ ordered */t2.OBJECTID
    from nodes t1, nodes t2 WHERE t1.OBJECTID < t2.OBJECTID AND
    sdo_relate (t2.shape, t1.shape, 'mask=EQUAL querytype = WINDOW') = 'TRUE'
    Plan Explanation:
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 150M | 1095G| 505M|
    | 1 | NESTED LOOPS | | 150M| 1095G| 505M |
    | 2 | TABLE ACCESS FULL | NODES | 548K | 2043M| 411 |
    | 3 | TABLE ACCESS BY INDEX ROWID| NODES | 274 | 1047K| 505M|
    | 4 | DOMAIN INDEX | NODES_IDX | 27416 | | |
    As far as I understand, oracle reserved for that query 1095G of memory?! Is it really necessary for that simple query and how can it be possible?
    Regards, Denis.
    Message was edited by:
    Tenek

  • Sdo_relate: combined masks

    Hi,
    I would like to execute a sdo_relate operation with a combined mask like (CONTAINS+COVERS+OVERLAPBDYINTERSECT)
    but it gives me not all results (I checked
    it with sdo_geom.relate). Furthermore when I
    swap the masks in the parenthesis it gives
    me no results at all.
    I think I have seen an information somewhere
    which said that this is a known bug.
    If this is a bug is there a patch available
    for it?
    I'm working with 8.1.7.
    Joerg

    Hi,
    the solution I am using is as follows:
    SELECT x.*
    FROM (SELECT sdo_geom.relate(a.geo, m.diminfo, 'determine', b.geo, m.diminfo) rel,
    FROM a, b, user_sdo_geo_metadata m
    WHERE mdsys.sdo_relate(a.geo,b.geo,
    'MASK=ANYINTERACT QUERYTYPE=JOIN') = 'TRUE'
    ...) x
    WHERE x.rel != 'TOUCH'
    This finds all objects which have common area. I use a relate operator with the ANYINTERACT mask to find all object which
    have a spatial relationship. Then I determine
    the relationship with the relate function. In
    the surrounding SELECT I filter out all objects
    with a 'TOUCH' relationship.
    For me this is much faster than the Query
    with a UNION.
    Anyway, this is just a workaround.
    Joerg

  • Mdsys.sdo_relate Problem

    Hi!
    I'va got two Tables, one of them ("kante") has a Geometry - Column in it and a Quad - Tree Index is
    Created, the other one ("kabelabschnitt") is linked to "kante" via a foreign key.
    This Query is very fast:
    SELECT k.* FROM kante k
    where sdo_relate(geom, mdsys.sdo_geometry(2003,NULL,NULL, mdsys.sdo_elem_info_array(1,1003,3), mdsys.sdo_ordinate_array(34520, 253535, 34621, 253606)), 'mask=ANYINTERACT querytype=window') = 'TRUE';
    But this takes about 20 s:
    SELECT k.*, ka.* FROM kante k, kabelabschnitt ka
    where ka.id_ka = k.id_kante
    and sdo_relate(geom, mdsys.sdo_geometry(2003,NULL,NULL, mdsys.sdo_elem_info_array(1,1003,3), mdsys.sdo_ordinate_array(34520, 253535, 34621, 253606)), 'mask=ANYINTERACT querytype=window') = 'TRUE';
    Can anynone tell me why??
    Thanx in advance,
    J

    Hi,
    It could be slower because the optimizer is choosing to use an index associated
    with the join key between the tables instead of the spatial index.
    Try adding the /*+ no_index (, index_name) */ hint, i.e.
    SELECT /*+ no_index (K name_of_id_kante_index) k.*, ka.*
    FROM kante k, kabelabschnitt ka
    where ka.id_ka = k.id_kante
    and sdo_relate(geom, mdsys.sdo_geometry(2003,NULL,NULL,
    mdsys.sdo_elem_info_array(1,1003,3),
    mdsys.sdo_ordinate_array(34520, 253535, 34621, 253606)),
    'mask=ANYINTERACT querytype=window') = 'TRUE';
    Hope this helps,
    Dan

  • Ques on SDO_RELATE with mask as "TOUCH

    A Question on "SDO_RELATE" with mask as "TOUCH".
    We do a SDO_RELATE Operation on two SDO Layer, to find all those polygons, which comes from different SDO Layer and share a common edge.
    We using "SDO_RELATE(t2.geom,t1.geom,'mask=TOUCH querytype=JOIN')='TRUE'", it found what we needed , however at the same time , those polygons from two different sdo table which share only a common point is also included in the selection. How to limited selection to those only share a common edge.
    Richard Lee

    You might try intersecting the two geometries that touch. If a point geometry is returned then you can eliminate it.
    The touch mask itself is working correctly - it won't discriminate between touch at a point, and touch along an edge.
    Hope this helps.

  • Slow SDO_RELATE operation on a spatial view

    Hi Folks,
    I need some help to understand what's going on with a spatial query that is taking so long to be executed (about 7 minutes).
    I have a spatial view as below:
    create or replace view v_lote_fiscal_relac as
    select
    lf.objectid,lf.numbloco,lf.setor,lf.quarteirao,lf.origem,lf.tipo,lf.nome,lf.superquadra,lf.quadra,lf.area,lf.observacao,lf.motivo,lf.data,lf.matricula,
    vlf.idf_lote,vlf.ind_tipo_lote,vlf.num_lote,vlf.num_seq_lote,vlf.num_setor,vlf.num_quarteirao,vlf.mtr_area_real,vlf.des_tipo_categoria,
    lf.geom
    from
    GEOSMFAGP.Lote_Fiscal lf, IMO_VW_LOTE_FISCAL@POAGEO vlf
    where
    retorna_num_lote(lf.numbloco) = vlf.num_lote AND
    retorna_num_seq_lote(lf.numbloco) = vlf.num_seq_lote;
    The functions retorna_num_lote and retorna_num_seq_lote just do a substr to extract information from lf.numbloco column
    This is the spatial query created by a mapping application
    SELECT
    OBJECTID
    FROM
    GEOPONTO.V_LOTE_FISCAL_RELAC T
    WHERE
    SDO_RELATE(T.GEOM,
    SDO_GEOMETRY(2003,1010101,NULL,
    SDO_ELEM_INFO_ARRAY(1,1003,1),
    SDO_ORDINATE_ARRAY(180514.7833451195,1663508.6932339652,
    180514.84948680276,1663504.0633161366,
    180517.6274375,1663503.9971744534,
    180517.69357918325,1663508.4948089155,
    180514.7833451195,1663508.6932339652)), 'mask=ANYINTERACT') = 'TRUE'
    Please, correct me if I'm wrong, but it looks like the query will first get all the records that satisfy the where clause and then apply the spatial filter on this resultset.
    How can it be improved?
    I did some tests using SQL Developer (SQL Profiler) and it was possible to create a better execution plan to this query. The time was reduced to 4 seconds.
    But the SQL Profile seems to have effect only to the query analyzed. I mean, if a change the sdo_geometry parameter, the query takes 7 minutes again.
    Any ideas?
    Regards,
    Luis

    Hi Stefan,
    Please, see below the Explain Plan that I mentioned and the SQL Profiler command that makes the query be executed very fast.
    *1- Original*
    Plan hash value: 2780585567
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Inst |IN-OUT|
    | 0 | SELECT STATEMENT | | 4808 | 1596K | 25 (0)| 00:00:01 | | |
    | 1 | NESTED LOOPS | | 4808 | 1596K| 25 (0)| 00:00:01 | | |
    | 2 | REMOTE | IMO_VW_LOTE_FISCAL | 25553 | 648K | 25 (0)| 00:00:01 | POAGEO | R->S |
    |* 3 | TABLE ACCESS BY INDEX ROWID| LOTE_FISCAL | 1 | 314 | 25 (0)| 00:00:01 | | |
    |* 4 | DOMAIN INDEX | XSPLOTE_FISCAL_GEO | | | 0 (0)| 00:00:01 | | |
    uery Block Name / Object Alias (identified by operation id):
    1 - SEL$F5BB74E1
    2 - SEL$F5BB74E1 / VLF@SEL$2
    3 - SEL$F5BB74E1 / LF@SEL$2
    4 - SEL$F5BB74E1 / LF@SEL$2
    Predicate Information (identified by operation id):
    3 - filter("VLF"."NUM_LOTE"="RETORNA_NUM_LOTE"("LF"."NUMBLOCO") AND
    "VLF"."NUM_SEQ_LOTE"="RETORNA_NUM_SEQ_LOTE"("LF"."NUMBLOCO"))
    4 - access("MDSYS"."SDO_RELATE"("LF"."GEOM","MDSYS"."SDO_GEOMETRY"(2003,1010101,NULL,"SDO_ELEM_INFO_ARRA
    Y"(1,1003,1),"SDO_ORDINATE_ARRAY"(180514.7833451195,1663508.6932339652,180514.84948680276,1663504.063316136
    6,180517.6274375,1663503.9971744534,180517.69357918325,1663508.4948089155,180514.7833451195,1663508.6932339
    652)),'mask=ANYINTERACT')='TRUE')
    *2- Using SQL Profile*
    Plan hash value: 3617866586
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Inst |IN-OUT|
    | 0 | SELECT STATEMENT | | 4808 | 1596K| 485 (1) | 00:00:06 | | |
    |* 1 | HASH JOIN | | 4808 | 1596K| 485 (1) | 00:00:06 | | |
    | 2 | TABLE ACCESS BY INDEX ROWID| LOTE_FISCAL | 1882 | 577K| 459 (1) | 00:00:06 | | |
    |* 3 | DOMAIN INDEX | XSPLOTE_FISCAL_GEO | | | 0 (0) | 00:00:01 | | |
    | 4 | REMOTE | IMO_VW_LOTE_FISCAL | 25553 | 648K| 25 (0) | 00:00:01 | POAGEO | R->S |
    uery Block Name / Object Alias (identified by operation id):
    1 - SEL$F5BB74E1
    2 - SEL$F5BB74E1 / LF@SEL$2
    3 - SEL$F5BB74E1 / LF@SEL$2
    4 - SEL$F5BB74E1 / VLF@SEL$2
    Predicate Information (identified by operation id):
    1 - access("VLF"."NUM_LOTE"="RETORNA_NUM_LOTE"("LF"."NUMBLOCO") AND
    "VLF"."NUM_SEQ_LOTE"="RETORNA_NUM_SEQ_LOTE"("LF"."NUMBLOCO"))
    3 - access("MDSYS"."SDO_RELATE"("LF"."GEOM","MDSYS"."SDO_GEOMETRY"(2003,1010101,NULL,"SDO_ELEM_INFO_ARRA
    Y"(1,1003,1),"SDO_ORDINATE_ARRAY"(180514.7833451195,1663508.6932339652,180514.84948680276,1663504.063316136
    6,180517.6274375,1663503.9971744534,180517.69357918325,1663508.4948089155,180514.7833451195,1663508.6932339
    652)),'mask=ANYINTERACT')='TRUE')
    Recommendation (estimated benefit: 99.96%)
    - Consider this SQL Profile:.
    execute dbms_sqltune.accept_sql_profile(task_name => 'staName68255',
    task_owner => 'GEOPONTO', replace => TRUE);
    After the execution o the command above, the same query is executed in 3 seconds.
    P.S: I Cannot change the view, the column is indexed and SDO_FILTER will not work for me, because I need an exact match.
    Regards,
    Luis

  • Help! Create Table with SDO_RELATE query ignores indexes!

    Hi, I have a SQL statement like:
    select ...
    from a, b where sdo_relate(a.loc,b.loc,'querytype=join mask=anyinteract');
    When I run this as is, it runs quickly, <10 seconds, and doing an expalin on it shows it is using the spatial indexes.
    However if I try:
    create table tabl as <select statement>
    or
    insert into tab1 <select statement>
    then it takes over 30 minutes. Examining the trace file shows:
    Rows Execution Plan
    0 CREATE TABLE STATEMENT GOAL: CHOOSE
    0 LOAD AS SELECT
    0 NESTED LOOPS
    0 TABLE ACCESS (FULL) OF 'AC1'
    0 TABLE ACCESS (FULL) OF 'AC2'
    I've tried using querytype=WINDOW, I've tried optimizer_mode=RULE and CHOOSE, but nothing forces these create/insert statements to work effectively!
    Is this a bug, a documented limitation or is there something I'm missing?
    On Oracle 8.1.7, tried on both Linux and Sun Solaris.
    Thanks,
    Andrew

    Andrew,
    This is a bug in the optimizer and extensible
    indexing for Oracle 8i.
    This is fixed in 9i.
    Sorry, I don't have a better answer for
    this problem.
    null

  • IF Statement in Join Line

    Is it possible to use a IF statement (i.e. CASE, DECODE) in the Join Line?
    I need create a query that depending on the value of a column it will determine if I use a column A or column B in my join statement. I was thinking something like the following:
    Select a.Value1, a.Value2, b.ColumnA, b.ColumnB
    FROM Table1 a
    INNER JOIN Table2 b ON a.Value2 = (if b.ColumnZ='Dept' then b.ColumnA else b.ColumnB END)
    Oracle Version 10g
    OS Windows XP
    Thanks in advance!

    Hi,
    Remember what a CASE expression does: it returns a single value in one of the SQL data types (such as VARCHAR2, NUMBER or DATE).
    Each THEN (or ELSE) clause of a CASE expression references something that the CASE expression might return, so after each THEN (or ELSE) keyword there must be a single value in one of the SQL data types.
    So you can't say:
    case tdsi.level_code
         when  'L'  then  tdsid.privilege_code = tdlm.location_code
         when  'R'  then  tdsid.privilege_code = tdlm.region_code
         when  'C'  then  tdsid.privilege_code = tdlm.country_code
    endWhat is the data type being returned? "tdsid.privilege_code = tdlm.location_code" is not a single value in any of the SQL data types.
    If location_code, region_code, country_code and privilege_code all have the same data type, then you can do something like this:
    join      dirpipe.dirpipe_location_map      tdlm      on      case tdsi.level_code
                                            when 'L' then tdlm.location_code
                                            when 'R' then tdlm.region_code
                                            when 'C' then tdlm.country_code
                                       end     = tdsid.privilege_code

  • Is not null and null join

    Hi, I am trying to properly display a list of tasks for a project however without a join to the project number (which I was aware of) and the employee table, I get over 500 results.
    The task can be created without a employee assigned to it so therefore the page does not require the field to be filled in.
    Here is the SQL code, any does anyone have any ideas?
    select
        pd.pk_proj_detail_id    "Task Number",
        pd.task_title           "Task Title",
        pd.DETAIL_STATUS        "Task Status",
        pm.name                 "Associated Project",
        pps.last_name||', '||pps.first_name||', '||pps.middle_initial||'.' "Assigned Employee",
        pd.TRACKIT_NUMBER       "TrackIt! Number",
        pd.CREATEBY_DATE        "Date Entered",
        pd.DATE_BEGIN           "Date Began",
        pd.ESTIMATED_DATE       "Estimated Completion Date",
        pd.DATE_END             "Date Completed"
    from
        PROTRAC_DETAIL pd,
        protrac_master pm,
        cobr.vw_pps_payroll pps,
        resources r
    where
        pd.fk_proj_master_id = pm.PK_PROJ_MASTER_ID
        and r.fk_master_id = pm.PK_PROJ_MASTER_ID
        and (r.emp_id = pps.emple_no
            or r.emp_id is null)

    It's 10g r2 with Application Express 3.1.0.00.32
    This is the tasks (detail) table
    ALTER TABLE PROTRAC_DETAIL
    DROP PRIMARY KEY CASCADE;
    DROP TABLE PROTRAC_DETAIL CASCADE CONSTRAINTS;
    CREATE TABLE PROTRAC_DETAIL
      PK_PROJ_DETAIL_ID      NUMBER                 NOT NULL,
      FK_PROJ_MASTER_ID      NUMBER,
      TRACKIT_NUMBER         NUMBER,
      DETAIL_DESCRIPTION     VARCHAR2(4000 CHAR),
      DETAIL_STATUS          VARCHAR2(19 CHAR),
      DETAIL_STATUS_COMMENT  VARCHAR2(4000 CHAR),
      DATE_BEGIN             DATE,
      DATE_END               DATE,
      ESTIMATED_DATE         DATE,
      CREATEBY_DATE          DATE,
      CREATEBY_USER          VARCHAR2(50 CHAR),
      LASTMOD_DATE           DATE,
      LASTMOD_USER           VARCHAR2(50 CHAR),
      TASK_TITLE             VARCHAR2(100 CHAR)
    TABLESPACE DEVPROTRAC_DATA
    PCTUSED    0
    PCTFREE    10
    INITRANS   1
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       2147483645
                PCTINCREASE      0
                BUFFER_POOL      DEFAULT
    CREATE UNIQUE INDEX PROTRAC_DETAIL_PK ON PROTRAC_DETAIL
    (PK_PROJ_DETAIL_ID)
    TABLESPACE DEVPROTRAC_DATA
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       2147483645
                PCTINCREASE      0
                BUFFER_POOL      DEFAULT
    CREATE OR REPLACE TRIGGER BUI_PROTRAC_DETAIL
    before insert or update
    on PROTRAC_DETAIL
    referencing new as New old as Old
    for each row
    begin
        if inserting then
            select users_seq.nextval, sysdate, apex_application.g_user
                into :new.pk_proj_detail_id, :new.createby_date, :new.createby_user
                from dual;
        elsif updating then
            select sysdate, apex_application.g_user
                into :new.lastmod_date, :new.lastmod_user
                from dual;
        end if;
    end;
    SHOW ERRORS;
    ALTER TABLE PROTRAC_DETAIL ADD (
      CONSTRAINT PROTRAC_DETAIL_PK
    PRIMARY KEY
    (PK_PROJ_DETAIL_ID)
        USING INDEX
        TABLESPACE DEVPROTRAC_DATA
        PCTFREE    10
        INITRANS   2
        MAXTRANS   255
        STORAGE    (
                    INITIAL          64K
                    MINEXTENTS       1
                    MAXEXTENTS       2147483645
                    PCTINCREASE      0
    ALTER TABLE PROTRAC_DETAIL ADD (
      CONSTRAINT PROTRAC_DETAIL_NUM
    FOREIGN KEY (FK_PROJ_MASTER_ID)
    REFERENCES PROTRAC_MASTER (PK_PROJ_MASTER_ID));
    ALTER TABLE DEVPROTRAC.RESOURCES ADD (
      FOREIGN KEY (FK_DETAIL_ID)
    REFERENCES DEVPROTRAC.PROTRAC_DETAIL (PK_PROJ_DETAIL_ID));
    SET DEFINE OFF;
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (34, 24, NULL, 'test', 'Queued',
        NULL, NULL, NULL, NULL, TO_DATE('10/30/2008 13:37:01', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', TO_DATE('11/03/2008 15:19:35', 'MM/DD/YYYY HH24:MI:SS'), NULL, 'bananana');
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (41, 40, NULL, '2354234', 'Queued',
        NULL, NULL, NULL, NULL, TO_DATE('10/31/2008 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', TO_DATE('11/03/2008 13:52:02', 'MM/DD/YYYY HH24:MI:SS'), 'LREDMOND', 'I can type on the keyboarddf');
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (49, 32, 78888, 'one day fishsticks will walk on the moon.', 'Queued',
        'waiting for fishsticks.', NULL, NULL, NULL, TO_DATE('11/03/2008 11:28:11', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', NULL, NULL, 'Fix the keyboard');
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (50, 38, NULL, 'dfdfdfdfdfdfdfdfdf', 'Queued',
        NULL, NULL, NULL, NULL, TO_DATE('11/03/2008 12:03:06', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', TO_DATE('11/03/2008 15:19:44', 'MM/DD/YYYY HH24:MI:SS'), NULL, 'resreeeeeeeeee');
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (33, 31, NULL, 'Make sure the bananas are fresh', 'Queued',
        NULL, NULL, NULL, NULL, TO_DATE('10/29/2008 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', TO_DATE('11/03/2008 15:19:52', 'MM/DD/YYYY HH24:MI:SS'), NULL, 'e543563465');
    Insert into PROTRAC_DETAIL
       (PK_PROJ_DETAIL_ID, FK_PROJ_MASTER_ID, TRACKIT_NUMBER, DETAIL_DESCRIPTION, DETAIL_STATUS,
        DETAIL_STATUS_COMMENT, DATE_BEGIN, DATE_END, ESTIMATED_DATE, CREATEBY_DATE,
        CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, TASK_TITLE)
    Values
       (48, 37, NULL, 'guitar heros! yay', 'Queued',
        NULL, NULL, NULL, NULL, TO_DATE('11/03/2008 11:26:06', 'MM/DD/YYYY HH24:MI:SS'),
        'LREDMOND', TO_DATE('11/03/2008 15:19:57', 'MM/DD/YYYY HH24:MI:SS'), NULL, '34444444444444543etfg');
    COMMIT;This is for the resources table:
    ALTER TABLE RESOURCES
    DROP PRIMARY KEY CASCADE;
    DROP TABLE RESOURCES CASCADE CONSTRAINTS;
    CREATE TABLE RESOURCES
      PK_RESOURCES_ID   NUMBER,
      FK_DETAIL_ID      NUMBER,
      EMP_ID            NUMBER,
      RESOURCE_STATUS   VARCHAR2(8 CHAR),
      RESOURCE_COMMENT  VARCHAR2(4000 CHAR),
      CREATEBY_DATE     DATE,
      CREATEBY_USER     VARCHAR2(50 CHAR),
      LASTMOD_DATE      DATE,
      LASTMOD_USER      VARCHAR2(50 CHAR),
      FK_MASTER_ID      NUMBER
    TABLESPACE DEVPROTRAC_DATA
    PCTUSED    0
    PCTFREE    10
    INITRANS   1
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       2147483645
                PCTINCREASE      0
                BUFFER_POOL      DEFAULT
    CREATE UNIQUE INDEX RESOURCES_PK ON RESOURCES
    (PK_RESOURCES_ID)
    TABLESPACE DEVPROTRAC_DATA
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
                INITIAL          64K
                MINEXTENTS       1
                MAXEXTENTS       2147483645
                PCTINCREASE      0
                BUFFER_POOL      DEFAULT
    CREATE OR REPLACE TRIGGER BUI_RESOURCES
    before insert or update
    on RESOURCES
    referencing new as New old as Old
    for each row
    begin
        if inserting then
            select users_seq.nextval, sysdate, apex_application.g_user
                into :new.pk_resources_id, :new.createby_date, :new.createby_user
                from dual;
        elsif updating then
            select sysdate, apex_application.g_user
                into :new.lastmod_date, :new.lastmod_user
                from dual;
        end if;
    end;
    SHOW ERRORS;
    ALTER TABLE RESOURCES ADD (
      CONSTRAINT RESOURCES_PK
    PRIMARY KEY
    (PK_RESOURCES_ID)
        USING INDEX
        TABLESPACE DEVPROTRAC_DATA
        PCTFREE    10
        INITRANS   2
        MAXTRANS   255
        STORAGE    (
                    INITIAL          64K
                    MINEXTENTS       1
                    MAXEXTENTS       2147483645
                    PCTINCREASE      0
    ALTER TABLE RESOURCES ADD (
      FOREIGN KEY (FK_DETAIL_ID)
    REFERENCES PROTRAC_DETAIL (PK_PROJ_DETAIL_ID),
      FOREIGN KEY (FK_MASTER_ID)
    REFERENCES PROTRAC_MASTER (PK_PROJ_MASTER_ID));
    SET DEFINE OFF;
    Insert into RESOURCES
       (PK_RESOURCES_ID, FK_DETAIL_ID, EMP_ID, RESOURCE_STATUS, RESOURCE_COMMENT,
        CREATEBY_DATE, CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, FK_MASTER_ID)
    Values
       (53, 50, 356654, 'Active', NULL,
        TO_DATE('11/04/2008 09:32:06', 'MM/DD/YYYY HH24:MI:SS'), 'LREDMOND', NULL, NULL, NULL);
    Insert into RESOURCES
       (PK_RESOURCES_ID, FK_DETAIL_ID, EMP_ID, RESOURCE_STATUS, RESOURCE_COMMENT,
        CREATEBY_DATE, CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, FK_MASTER_ID)
    Values
       (51, 41, 447250, 'Active', 'No Sure.',
        TO_DATE('11/03/2008 14:23:11', 'MM/DD/YYYY HH24:MI:SS'), NULL, TO_DATE('11/04/2008 09:00:04', 'MM/DD/YYYY HH24:MI:SS'), NULL, 40);
    Insert into RESOURCES
       (PK_RESOURCES_ID, FK_DETAIL_ID, EMP_ID, RESOURCE_STATUS, RESOURCE_COMMENT,
        CREATEBY_DATE, CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, FK_MASTER_ID)
    Values
       (54, 50, 323829, 'Active', NULL,
        TO_DATE('11/04/2008 10:26:08', 'MM/DD/YYYY HH24:MI:SS'), 'LREDMOND', NULL, NULL, 38);
    Insert into RESOURCES
       (PK_RESOURCES_ID, FK_DETAIL_ID, EMP_ID, RESOURCE_STATUS, RESOURCE_COMMENT,
        CREATEBY_DATE, CREATEBY_USER, LASTMOD_DATE, LASTMOD_USER, FK_MASTER_ID)
    Values
       (52, 33, 8915, 'Active', 'get to work',
        TO_DATE('11/03/2008 15:20:18', 'MM/DD/YYYY HH24:MI:SS'), 'LREDMOND', TO_DATE('11/03/2008 15:35:10', 'MM/DD/YYYY HH24:MI:SS'), NULL, NULL);
    COMMIT;The results I want is everything above regardless of emp_id assigned (if any). Without the r.emp_id = pps.emple_no join, the query will generate 234234239482304234 results.
    Hope this helps.
    Edited by: leland on Nov 4, 2008 12:56 PM

Maybe you are looking for

  • How do I display PDF document as single pages on iPad?

    Hi, I have a company catalogue in PDF format, 20 pages long. We use Issuu to allow customer to view the catalogue on their PCs and mobile devices. In Issuu you can customise the embed widget to show single pages, and this works fine when viewing the

  • Safari not playing Quicktime from new website, all other browsers can

    Hi, I have a new web site being created. The developer has most of it done but has not been able to get the quicktime movies working correctly. The movies, animations, and panos, can be selected and play from Firefox on the MAC and PC, and IE on the

  • Adobe media encoder hangs using macbook pro yosemitie & CS6

    i cannot crunch a premiere pro project using adobe media encoder....the media encoder starts crunching normally but hangs at random .... i get the following clue in the activity monitor....PProheadless (not responding) also unable to create ISO image

  • So many bugs (Iphone 6. IOS 8.0.2)

    I'd like to list the bugs I've faced, when used my iPhone 6: 1) Bluetooth isn't working 2) Wi Fi isn't working properly (wi fi button isn't working/cannot find any network/freezes after connecting/speed changes from fast to low) 3) Battery drain (tim

  • Operations on XML file

    Hi, Is there any API in flex, that allows us to do operations on a XML file, like, adding new tags, searching for a particular tag, modifying a particular tag(s)  deleting a particular tag(s) etc.