Inline views

Hi all

I have a query that uses inline views and it fails with unable to extend temp error space, space initially temp has 30 GB of space, it went to 50 GB then it also fails.

If I replace views in line with a view, other than maintaining the opinion, will there be disadvantages as performance.

Earlier my opinion inline has some data only, now has increased from 15 to 20 times.


Thank you
Rambeau

You have WITH the clause or a sort of query rewrite when optimizer decides to materialise the subquery is possible. Another possibility there is ORDER BY or GROUP BY using the sorting and sorting is not too big, only to sort in memory but also runs out of disk space (tempdb) .c as others already so noted, planning to post request and execution.

SY.

Tags: Database

Similar Questions

  • Select "ordinate inline-view" - the output orders or not?

    Request always generates data ordered by "T1.col3"?
    select * from (select col1 from T1 where col2=10 order by Col3 desc ) where ROWNUM <= 5;
    As you can see I ordered in line-view, then I select data from this view inline with external selection. It is ensured that the data is output now as he was ordered inside inline-wiew? Can watch tests that Yes, the data seem to be ordered as order is defined inline-notice. I understand inline-view is as something static snapshot, area, where the data are well classified, and if I now running on such thing an external "select * from"-clause, then he should get out of the well-ordered way, because I don't join what anyone or to do something else, I simply by selecting all the lines in one ordered in line-view. "» Am I right or not?

    (Oracle 10g, Solaris OS)


    ---

    The example data:
    with T as
    (select 1 as col1, 10 as col2, 106 as col3 from dual union all
    select 5 as col1, 10 as col2, 100 as col3 from dual union all
    select 6 as col1, 10 as col2, 104 as col3 from dual union all
    select 3 as col1, 10 as col2, 101 as col3 from dual union all
    select 4 as col1, 10 as col2, 105 as col3 from dual union all
    select 2 as col1, 10 as col2, 103 as col3 from dual)
    select * from (select col1 from T where col2=10 order by Col3 desc ) where ROWNUM <= 5;
    Edited by: CharlesRoos the 10.12.2010 15:49

    Hello

    CharlesRoos wrote:
    The following query always generates data by "T1.col3"?

    select * from (select col1 from T1 where col2=10 order by Col3 desc ) where ROWNUM <= 5;
    

    The output will contain the 5rows with 5 larger values for Col3.
    These 5 rows not necessarily appears in order. Add an ORDER BY clause in the main query if you need ensure that.

    Maybe it's that, on your version of Oracle and your platform, the main request happen to keep the agenda constantly. This is exactly the kind of thing that stops working when you move to another version or another platform. If you want the end result in good standing, to use an ORDER BY clause in the main query.

  • Need help with query SQL Inline views + Group

    Hello gurus,

    I would really appreciate your time and effort on this application. I have the following data set.

    Reference_No---Check_Number---Check_Date---description---Invoice_Number---Invoice_Type---Paid_Amount---Vendor_Number
    1234567 11223 - 05/07/2008 -paid for cleaning- 44345563-I-* 20.00 *---19
    1234567 11223 - 05/07/2008 - 44345563 -a--10,00---19 ofbad quality adjustment
    7654321 11223 - 05/07/2008 - setting the last billing cycle - 23543556 - A - 50.00 - 19
    4653456 11223 - 05/07/2008 - paid for cleaning - 35654765 - I - 30, 00-19

    Please ignore '-' added for clarity

    I'm writing a paid_amount based on Reference_No, Check_Number, Payment_Date, Invoice_Number, aggregate query Invoice_Type, Vendor_Number and display description with Invoice_type 'I' when there are multiple records with the same Reference_No, Check_Number, Payment_Date, Invoice_Type, Invoice_Number, Vendor_Number. When there are no more records I want to display the respective Description.

    The query should return the following data set

    Reference_No---Check_Number---Check_Date---description---Invoice_Number---Invoice_Type---Paid_Amount---Vendor_Number
    1234567 11223 - 05/07/2008 -paid for cleaning- 44345563-I-* 10.00 *---19
    7654321 11223 - 05/07/2008 - setting the last billing cycle - 23543556 - A - 50.00 - 19
    4653456 11223 - 05/07/2008 - paid for cleaning - 35654765 - I - 30, 00-19
    Here's my query. I'm a little lost.

    Select b., A.sequence_id, A.check_date, A.check_number, A.invoice_number, A.amount, A.vendor_number
    de)
    Select sequence_id, check_number, check_date, invoice_number, sum (paid_amount) sum, vendor_number
    of the INVOICE
    Sequence_id group check_date, check_number, invoice_number, vendor_number
    ) A, B OF INVOICE
    where A.sequence_id = B.sequence_id


    Thank you
    Nick

    It seems that this is a duplicate thread - correct me if I am wrong in this case->

    Need help with query SQL Inline views + Group

    Kind regards.

    LOULOU.

  • Correlated Inline view Possible?

    Is a "inline in correlation" generally not used, and even less is not not possible at all in oracle? It seems oracle sql can do a lot, and over the years has been updates with different functions, but a couple of old books that I am reading the mention that they are not possible. I also tried some on my own, but it seems illogical to me and still less possible.

    Perhaps you mean side view in 12 c?

  • WITH the clause as inline view

    I m using oracle DB 11.2.0.2.0
    I have a question about usage WITH the clause which made a temporary transformation (Materializing) automatically.
    I want the query to operate as a point of view WITH clause online because the transactions table materailizing would kill performance.
    I m able to see the transformation of the temporary table in the explain output plan.
    Have we not all suspicion to stop the transformation of Temp table?

    Here is an example of the sample
    I have the query union multi (2 requests), couple of table is common to all the union queries. the request should not be materialized. It must operate as a point of view common inline.

    WITH ORDERS AS
    (SELECT h.order_number,
    l.line_number,
    l.line_id
    order_headers h, order_lines l)
    SELECT...
    COMMANDS, X, Y
    WHERE THE...
    UNION ALL
    SELECT...
    ORDERS, A, B, C
    WHERE THE...

    Try this...

    WITH ORDERS AS
    (SELECT /*+ inline */ h.order_number,
    l.line_number,
    l.line_id
    from order_headers h, order_lines l)
    ...
    

    To achieve the opposite effect, you can use SELECT / * + materialize * /.

    However, keep in mind that these tips are undocumented, so use them at your own risk. If you think that Oracle is to choose a bad execution plan, you must sign a deal with Oracle Support to see if this is a bug.

    Kind regards
    Bob

  • Prepares the query via the Inline view

    Pls help to prepare a query i can extract the following data through view inline (IE, except using the UNION):

    1. the SELLER who works in deptno # 30
    2. the MANAGER working in deptno # 20

    Department # 30 both SELLER and MANAGER work same Department # 20 both SELLER and MANAGER work.

    I want to go get sole MANAGER of Department # 20 and only the SELLER in Department 30.


    I can retrieve the desired data above by 'UNION' but I don't know if the above data can be searched other than 'The UNION' as INLINE mode.
    INSERT INTO EMP
    VALUES
    (7369,'SMITH','CLERK',7902,'WEDNESDAY, DECEMBER 17, 1980',800,NULL,20)
    /
    INSERT INTO EMP
    VALUES
    (7499,'ALLEN','SALESMAN',7698,'FRIDAY, FEBRUARY 20, 1981',1600,300,30)
    /
    INSERT INTO EMP
    VALUES
    (7521,'WARD','SALESMAN',7698,'SUNDAY, FEBRUARY 22, 1981',1250,500,30)
    /
    INSERT INTO EMP
    VALUES
    (7566,'JONES','MANAGER',7839,'THURSDAY, APRIL 02, 1981',2975,NULL,20)
    /
    INSERT INTO EMP
    VALUES
    (7654,'MARTIN','SALESMAN',7698,'MONDAY, SEPTEMBER 28, 1981',1250,1400,30)
    /
    INSERT INTO EMP
    VALUES
    (7698,'BLAKE','MANAGER',7839,'FRIDAY, MAY 01, 1981',2850,NULL,30)
    /
    INSERT INTO EMP
    VALUES
    (7782,'CLARK','MANAGER',7839,'TUESDAY, JUNE 09, 1981',2450,NULL,10)
    /
    INSERT INTO EMP
    VALUES
    (7788,'SCOTT','ANALYST',7566,'SUNDAY, APRIL 19, 1987',3000,NULL,20)
    /
    INSERT INTO EMP
    VALUES
    (7839,'KING','PRESIDENT',NULL,'TUESDAY, NOVEMBER 17, 1981',5000,NULL,10)
    /
    INSERT INTO EMP
    VALUES
    (7844,'TURNER','SALESMAN',7698,'TUESDAY, SEPTEMBER 08, 1981',1500,0,30)
    /
    INSERT INTO EMP
    VALUES
    (7876,'ADAMS','CLERK',7788,'SATURDAY, MAY 23, 1987',1100,NULL,20)
    /
    INSERT INTO EMP
    VALUES
    (7900,'JAMES','CLERK',7698,'THURSDAY, DECEMBER 03, 1981',950,NULL,30)
    /
    INSERT INTO EMP
    VALUES
    (7902,'FORD','ANALYST',7566,'THURSDAY, DECEMBER 03, 1981',3000,NULL,20)
    /
    INSERT INTO EMP
    VALUES
    (7934,'MILLER','CLERK',7782,'SATURDAY, JANUARY 23, 1982',1300,NULL,10)
    /
    INSERT INTO EMP
    VALUES
    (100,'SALAM','SALESMAN',7698,'FRIDAY, FEBRUARY 20, 1981',1600,300,20)
    /
    INSERT INTO EMP
    VALUES
    (101,'KARIN','SALESMAN',7698,'SATURDAY, FEBRUARY 21, 1981',1250,500,20)
    /
    INSERT INTO EMP
    VALUES
    (102,'RAFIQ','SALESMAN',7698,'SATURDAY, FEBRUARY 20, 1988',1250,1400,20)
    /
    INSERT INTO EMP
    VALUES
    (103,'JABBAR','SALESMAN',7698,'WEDNESDAY, FEBRUARY 20, 1980',1500,0,20)
    /
    INSERT INTO EMP
    VALUES
    (500,'RAHIM','MANAGER',7839,'THURSDAY, DECEMBER 16, 1971',2975,NULL,20)
    /
    Thank you.

    Sharif

    Published by: user13094274 on May 8, 2010 06:49

    Am I wrong?

  • SQL/XML and Inline views

    I learn just XQuery and SQL/XML and believe that SQL/XML that will work best for my current need.

    Is it possible to do to the line and subqueries in SQL/XML, everything as we often use in SQL? The data that I will need at least two views inline who stand in the FROM of the SQL statement.

    In principle, this should be possible, but you need to develop a little more, so far it's a pretty general question. The preferred method of 10.2(.0.3.0) and would be XQuery, if only it is much more powerful than "SQL/XML", while dealing with XML data.

  • Table 2 join vs inline view join to another table

    Hi, I was wondering if it makes a difference of 2 tables to join directly vs join of a table to a view online. I ran a few tests of my own and looked like to explain plans. The costs appear to be identical between each method. But, I was wondering if there are situations where a method should be used on the other.

    Using Oracle version 11.2.0.2.0

    The tables are as follows.

    Table1 (varchar2 (20) col1, col2 number)
    Table2 (col1 number, col2, col3 number)

    insert into table1 values ('test1', 1).
    insert into table1 values ('test', 2)
    insert into table2 values (1, 2, 4)
    insert into table2 values (2, 2, 4)


    Here is an example that I use.

    Select a.col1, b.col3
    FROM table1, table2 b
    where a.col2 = b.col2
    and a.col1 = 'test '.

    Select a.col1, b.col3
    FROM table1, (select col2, col3 from table2) b
    where a.col2 = b.col2
    and a.col1 = 'test '.

    Published by: arizona9952 on December 29, 2012 12:49

    Hello

    arizona9952 wrote:
    Hi, I was wondering if it makes a difference of 2 tables to join directly vs join of a table to a view online. I ran a few tests of my own and looked like to explain plans. The costs appear to be identical between each method.

    About efficiency, it does not matter that you use. The online display will not necessarily be performed first. The optimizer chooses what it thinks is the best plan anyway.

    But, I was wondering if there are situations where a method should be used on the other. Here is an example that I use.

    Select a.col1, b.col3
    FROM table1, table2 b
    where a.col2 = b.col2
    and a.col1 = 'test '.

    Select a.col1, b.col3
    FROM table1, (select col2, col3 from table2) b
    where a.col2 = b.col2
    and a.col1 = 'test '.

    I can't imagine any situation where the choice between these two issues. But consder the query below:

    SELECT  a.col1
    ,      b.col3
    FROM     table1 a
    ,      (          -- Begin in-line view b
             SELECT  col2
             ,          col3
         --  ,         ROWNUM     AS r_n
             FROM    table2
             WHERE   col2_type     = 'NUMBER'
         ) b               -- End in-line view B
    WHERE     a.col2     = TO_NUMBER (b.col2)
    AND     a.col1      = 'test'
    ;
    

    Suppose table2.col2 is a VARCHAR2 and table2.col2_type correctly identifies if col2 can be converted to a NUMBER. The above query might get conversion errors, because the optimzer may decide to join first and evaluate the WHERE col2_type = 'NUMBER' later condition, how to make sure that doesn't happen is different depending on whether you use a subquery or not. If you use a sub0 query (such as display online above) you can add a reference to ROWNUM in the subquery, as displayed if commnet line.

  • ORA-01733-virtual column not allowed here - insert using inline view

    Does anyone know why I get ORA-01733-virtual column not allowed here

    SQL > select * from v version $;

    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL release 11.1.0.6.0 - Production
    CORE 11.1.0.6.0 Production
    AMT for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production



    -no error without the WITH CHECK option

    SQL > INSERT INTO
    2 (SELECT
    3 location_id,
    4 city
    5 l.country_id
    6 OF country c, localities, regions r l
    7 where l.country_id = c.country_id
    8 and c.region_id = r.region_id
    9 and r.region_name = 'Asia')
    10 VALUES (5500, 'Common Wansdworth', 'UK');

    1 line of creation.

    SQL > rollback;

    Complete restoration.


    -error with WITH CHECK OPTION


    SQL > INSERT INTO
    2 (SELECT
    3 location_id,
    4 city
    5 l.country_id
    6 OF country c, localities, regions r l
    7 where l.country_id = c.country_id
    8 and c.region_id = r.region_id
    9 and r.region_name = 'Asia' WITH CHECK OPTION)
    10 VALUES (5500, 'Common Wansdworth', 'UK');
    INSERT INTO
    *
    ERROR on line 1:
    ORA-01733: virtual column not allowed here




    I was expecting

    ORA-01402: discovers the violation of where WITH CHECK OPTION clause

    for the second. Am I missing here?

    Coskan wrote:
    Randolf

    Thanks a lot for the update of this old question
    After reading the link, I think I should ignore this error and accept him as ORA-01402

    The information that you have asked me to check me do not have an understanding of the different error types.

    Coskan,

    I didn't know this is an old thread that somehow got updated by someone else.

    Regarding your question: you're right that the output of the script is not really that useful.

    I have just run on 10.2.0.4 and in general, it seems that the output of USER_UPDATABLE_COLUMNS is incorrect regarding the views of join using the WITH CHECK OPTION.

    For example although the location_id from the TEST_V_2 column appears as non-editable (probably because of the rule that "the columns used in the join expression" cannot be modified in a join view when you use the WITH CHECK OPTION) I can run successfully your insert if statement I choose a location_id less than 2000.

    It seems that summed up the difference if you join more than two tables, you'll always get the error "ORA-01733" when you try to insert in the join with the enabled OPTION CHECK view. For example to add a third table TEST_V_2 which does not change the original view, but simply joined meaning for example COUNTRIES to LOCATIONS, will show the same behavior to throw an ORA-01733, however it works fine when the omission of the WITH CHECK OPTION.

    So overall, I tend to say it is really a limitation of the implementation and it is not actually an ORA-01402 but looks like Oracle is simply trying to tell you: Amendment No. INSERT in this possible view. Updates however seem to work, at least I can find some examples of work.

    There seems to be other restrictions of implementation with the WITH CHECK OPTION in place even when the only membership as two tables, for example when trying to join the COUNTRIES and PLACES but by selecting only in PLACES and by using a filter on the COUNTRY_ID predicate fails with ORA-01733 when this predicate is applied to the COUNTRY. COUNTRY_ID but it works if this predicate is applied to PLACES. COUNTRY_ID.

    I could imagine that Oracle has quietly added some of these restrictions with each patch set due to the angle of the case/adverse reactions encountered. I saw this for other features, too.

    Kind regards
    Randolf

    Oracle related blog stuff:
    http://Oracle-Randolf.blogspot.com/

    SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676 /.
    http://sourceforge.NET/projects/SQLT-pp/

  • Question about a view inline or function within SQL

    Hi all


    I would like to know if using a view inline with a sql query is better or a call of function within the sql query is preferable.

    When I check the plan explained in both cases I see no difference in the cost.

    Appreciate your valuable suggestions on this.


    Thank you
    Maddy K.

    A function of a query will be worse than an inline view, given the context of switching between SQL and PL/SQL engines.

    See http://asktom.oracle.com/pls/apex/f?p=100:11:0:P11_QUESTION_ID:60122715103602
    Bonus http://www.oracle.com/technetwork/database/features/plsql/overview/doing-sql-from-plsql-129775.pdf

  • ORA-01445: cannot select ROWID, or sample, a view of join without key - preserved table form w/report and LOV

    I create a page "Form on a Table with Report" (APEX 5). Table I has 3 columns: cat_key, item_value, item_description. The cat_key is a foreign key in a table with columns cat_key, cat_value. I created the report and everything works fine.  The page of the report shows my domain cat_key in number, so I want it instead to display the cat_value. I change the field cat_key to a text based on LOV, select my LOV and now when I view the page of report I get the "'ORA-01445: cannot select ROWID from where sample, a join without key preserved table view ' error." The report uses the ROWID as a link to the edit page field.

    If I use the same tables and even shared LOV in a report page interactive, it works fine.

    What I am doing wrong?

    This is a limitation of the IR Apex will rewrite your query to a query that includes the lookup table and the columns. So now you have actually created a query on an inline view, which causes the error. You can see the query apex created when running in debug mode. APEX will join the table of choice with your primary table. For example from one of my IR:

    Select 'ID '...

    "MSL". "" HIS_COUNTRIES "=> my primary table

    ) ) b,

    (select rv_meaning d, rv_low_value r

    of msl_ref_codes_table

    where rv_domain = "JOHN".

    ) L1 = > query My LOV Lookup

    ...

    So, if possible, base your reports and forms on the real primary key, no rowid.

    You can also write the IR query with the search yourself:

    Select T1.rowid...

    of primary_table T1

    look_table L1

    ...

  • generate the view in line with the values of the 'sequence' 0.36

    I want my query to join inline view that has values of 0.36, what is the best way to create this inline-view?
    My initial solution would be:
    SELECT LEVEL RESULT FROM Dual CONNECT BY LEVEL < 37
    union
    select 0 from dual
    order by 1
    I want to write the query that returns the same values as this query, I showed.

    CharlesRoos wrote:
    I want my query to join inline view that has values of 0.36, what is the best way to create this inline-view?
    My initial solution would be:

    SELECT LEVEL RESULT FROM Dual CONNECT BY LEVEL < 37
    union
    select 0 from dual
    order by 1
    

    I want to write the query that returns the same values as this query, I showed.

    SELECT (LEVEL - 1) RESULT FROM Dual CONNECT BY LEVEL <= 37 ;
    

    Published by: user503699 on October 29, 2010 14:20

  • DELETE FROM inline-notice

    I read on 'DELETE FROM inline-view' here:

    http://Stanford.edu/dept/ITSS/docs/Oracle/10G/server.101/b10759/statements_8005.htm

    But I don't see in the documentation how are the rules when inline-view represents a JOIN between tables, how the database is then?

    Example:
    delete from (select * from a, b, c where a.b_id = b.id and b.c_id= c.id or soemthing);
    How, in this example, we can now what table is deleted - a, b or c?

    You can delete only a table.

    Tables: (id - primary key for each table)
    T1 (id, name)
    T2 (id, t1_id, name)
    T3 (id, t2_id, name)

    Foreign key constraints:
    fk_t2_t1 (T2.t1_id-> T1.id)
    fk_t3_t2 (T3.t2_id-> T2.id)

    DELETE FROM (select t1.name n1, t2.name n2, t3.name n3 from mytab t1, mytab2 t2, mytab3 t3 where t1.id = t2.t1_id and t2.id = t3.t2_id) t
    WHERE t.n1 = 'value' /* t.n2 = 'value' or t.n3 = 'value' */
    

    Only in the table T3 or deleted rows.

  • Materialized view takes to refresh

    On Oracle 11 g 2, I created a fast refresh materialized on the validation view
    CREATE MATERIALIZED VIEW mv_case
    PARALLEL BUILD IMMEDIATE REFRESH FAST ON COMMIT ENABLE QUERY REWRITE AS
    SELECT p.jperson_id,offense_id,CASE_SENTENCE_DATE,court_ref,CASE_COURT_ORI,
      c.CASE_VERDICT_DATE,CASE_DOCKET,c.CASE_EXPUNGED,c.jcase_id,cc.CYCLEID_ID,
      p.rowid p_rowid,xc.rowid xc_rowid,c.rowid c_rowid,cxo.rowid cxo_rowid,cc.rowid cc_row_id
    FROM jperson p,jperson_x_jcase xc,jcase c,jcase_x_offense cxo,jcase_x_cycleid cc
    where p.jperson_id = xc.jperson_id(+) and xc.jcase_id = c.jcase_id(+) 
      and c.jcase_id = cxo.jcase_id(+) and c.jcase_id=cc.jcase_id;
    create index idx_mv_case_pid on mv_case(jperson_id);
    ALTER TABLE mv_case ADD (CONSTRAINT PK_MV_CASE PRIMARY KEY(jcase_id,offense_id)) ;
    create index idx_mv_case_p_rowid on mv_case(p_rowid);
    create index idx_mv_case_xc_rowid on mv_case(xc_rowid);
    create index idx_mv_case_c_rowid on mv_case(c_rowid);
    create index idx_mv_case_cxo_rowid on mv_case(cxo_rowid);
    create index idx_mv_case_cc_rowid on mv_case(cc_row_id);
    I inserted a single line into one of the main table
    insert into jcase_x_offense (offense_id,jcase_id) values ('test_row3','test_row3');
    commit;
    The tooks to commit a fairly long. I looked in the trace file and the actual insertion took 0.01 seconds but the internel DML took most of the time. I copy the TKPROF output that is relevant for the internal DML below
    INSERT INTO QAPF.MV_CASE SELECT /*+ NO_MERGE(JV$) */ 
      MAS$4.JPERSON_ID,JV$.OFFENSE_ID,MAS$2.CASE_SENTENCE_DATE,
      MAS$2.COURT_REF,MAS$2.CASE_COURT_ORI,MAS$2.CASE_VERDICT_DATE,
      MAS$2.CASE_DOCKET,MAS$2.CASE_EXPUNGED,MAS$2.JCASE_ID,
      MAS$0.CYCLEID_ID,MAS$4.ROWID,MAS$3.ROWID,MAS$2.ROWID,JV$.RID$,
      MAS$0.ROWID 
      FROM ( SELECT MAS$.ROWID RID$  ,  MAS$.*  FROM  QAPF.JCASE_X_OFFENSE MAS$ WHERE ROWID IN 
              (SELECT  /*+ HASH_SJ */ CHARTOROWID(MAS$.M_ROW$$) RID$ 
               FROM QAPF.MLOG$_JCASE_X_OFFENSE MAS$ WHERE MAS$.XID$$ = :1 )) JV$,
      JCASE_X_CYCLEID AS OF SNAPSHOT(:B_SCN)  MAS$0, JCASE AS OF SNAPSHOT(:B_SCN)  MAS$2, 
      JPERSON_X_JCASE AS OF SNAPSHOT(:B_SCN)  MAS$3, JPERSON AS OF SNAPSHOT(:B_SCN)  MAS$4 
      WHERE (MAS$4.JPERSON_ID=MAS$3.JPERSON_ID(+) 
      AND MAS$3.JCASE_ID=MAS$2.JCASE_ID(+) 
      AND MAS$2.JCASE_ID=JV$.JCASE_ID(+) 
      AND MAS$2.JCASE_ID=MAS$0.JCASE_ID) 
      AND NOT EXISTS ( 
        SELECT 1 FROM QAPF.MV_CASE SNA2$ 
        WHERE (SNA2$.P_ROWID = MAS$4.ROWID) 
        AND (SNA2$.XC_ROWID = MAS$3.ROWID OR MAS$3.ROWID IS NULL ) 
        AND (SNA2$.C_ROWID = MAS$2.ROWID OR MAS$2.ROWID IS NULL ) 
        AND (SNA2$.CC_ROW_ID = MAS$0.ROWID OR MAS$0.ROWID IS NULL ) 
        AND JV$.RID$ IS NULL) 
      AND NOT EXISTS ( 
        SELECT 1  FROM JCASE_X_OFFENSE MAS_INNER$, JCASE AS OF SNAPSHOT(:B_SCN)  MAS_OUTER$ 
        WHERE MAS$2.ROWID = MAS_OUTER$.ROWID AND JV$.RID$ IS NULL 
        AND MAS_OUTER$.JCASE_ID=MAS_INNER$.JCASE_ID)
    
    call     count       cpu    elapsed       disk      query    current        rows
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1     99.51     364.87     377012   17412972          1           0
    Fetch        0      0.00       0.00          0          0          0           0
    ------- ------  -------- ---------- ---------- ---------- ----------  ----------
    total        2     99.51     364.87     377012   17412972          1           0
    
    Rows     Row Source Operation
    -------  ---------------------------------------------------
          0  LOAD TABLE CONVENTIONAL  (cr=17412968 pr=377012 pw=120527 time=0 us)
          0   FILTER  (cr=17412968 pr=377012 pw=120527 time=0 us)
    3363837    HASH JOIN RIGHT OUTER (cr=264914 pr=280254 pw=120527 time=35845080 us cost=299444 size=1029332286 card=3363831)
          1     VIEW  (cr=112490 pr=180864 pw=119722 time=0 us cost=30743 size=78 card=1)
          1      HASH JOIN SEMI (cr=112490 pr=180864 pw=119722 time=0 us cost=72627 size=208 card=1)
    11354346       TABLE ACCESS FULL JCASE_X_OFFENSE (cr=112488 pr=112447 pw=0 time=4814838 us cost=30703 size=749386770 card=11354345)
          1       TABLE ACCESS BY INDEX ROWID MLOG$_JCASE_X_OFFENSE (cr=2 pr=0 pw=0 time=0 us cost=1 size=142 card=1)
          1        INDEX RANGE SCAN IDX_MLOG$_XID_JCASE_X_OFFENSE (cr=1 pr=0 pw=0 time=0 us cost=1 size=0 card=1)(object id 98375)
    3363837     HASH JOIN  (cr=152424 pr=99390 pw=805 time=29973970 us cost=268690 size=766953468 card=3363831)
    2994042      INDEX FAST FULL SCAN JPERSON_I0 (cr=18134 pr=0 pw=0 time=772990 us cost=17450 size=134731845 card=2994041)(object id 83738)
    3363837      HASH JOIN  (cr=134290 pr=99390 pw=805 time=25292580 us cost=212128 size=615581073 card=3363831)
    3363837       HASH JOIN  (cr=69008 pr=34127 pw=805 time=4750330 us cost=101637 size=393568929 card=3363837)
    3363837        TABLE ACCESS FULL JCASE_X_CYCLEID (cr=33337 pr=33322 pw=0 time=2942460 us cost=33569 size=222013242 card=3363837)
    6586646        TABLE ACCESS FULL JCASE (cr=35671 pr=0 pw=0 time=1584102 us cost=35988 size=335918895 card=6586645)
    6586635       TABLE ACCESS FULL JPERSON_X_JCASE (cr=65282 pr=65263 pw=0 time=5446686 us cost=65632 size=434717844 card=6586634)
    3363837    FILTER  (cr=17148054 pr=96758 pw=0 time=0 us)
    3363837     MAT_VIEW ACCESS BY INDEX ROWID MV_CASE (cr=17148054 pr=96758 pw=0 time=0 us cost=7 size=40 card=1)
    32464070      INDEX RANGE SCAN IDX_MV_CASE_P_ROWID (cr=4489770 pr=15250 pw=0 time=19576798 us cost=3 size=0 card=7)(object id 98467)
          0    FILTER  (cr=0 pr=0 pw=0 time=0 us)
          0     NESTED LOOPS  (cr=0 pr=0 pw=0 time=0 us cost=4 size=78 card=1)
          0      TABLE ACCESS BY USER ROWID JCASE (cr=0 pr=0 pw=0 time=0 us cost=1 size=45 card=1)
          0      INDEX RANGE SCAN JCASE_X_OFFENSE_I0 (cr=0 pr=0 pw=0 time=0 us cost=3 size=33 card=1)(object id 83623)
    Issues related to the:
    (1) what are the objects as JCASE OF SNAPSHOT(:B_SCN)? Can I index? I tried to access it, but received the error
    Select * from SNAPSHOT(:B_SCN) JCASE;
    ORA-08187: snapshot expression not allowed here
    08187 00000 - "expression of unauthorized snapshot here.
    * Cause: An expression that uses snapshot AS of a specified when not allowed.
    * Action: Do not use the ACE OF the clause

    (2) in the inline view more trees, he used ROWID in where clause. I tried to create an index on the ROWID and error
    create index idx_jcase_offense_rid on JCASE_X_OFFENSE (rowid)
    *
    ERROR on line 1:
    ORA-00904: invalid identifier

    Note: I checked that I have the index of all the areas in which all the clauses contained in the DML except rowid.

    Thanks for help.

    1 apparently Oracle Flashback technology is used when no newspaper materialized view have been implemented

    2 rowid is the external representation of the physical location of a line. The rowid points to a file and a block and a rowid in this block.
    The nodes of an index comprised of a key and the corresponding rowid.
    As a rowid is never stored, you also can't index.

    Your performance issue is the result of outerjoining all tables.
    It is a design error. Outer joins always lead to table scan complete and joins of hash for obvious reasons.

    As your MV is a MV complex is not a candidate for FAST REFRESH ON COMMIT.

    ---------------
    Sybrand Bakker
    Senior Oracle DBA

  • View regarding

    Hello

    Would be happy if someone clarifies the question below.

    Oracle version: 10g

    1. I created a complex view (say it would return records 10million).
    2. this view contains certain structures such as inline view in it (so I guess
    in the plan to explain it it can be broken down to the base tables)
    2. I use this view in a select as below

    Select * from (thisview)
    where thisview.empno = 12
    and... (a condition more)

    In this scenario, my doubt is that would this be to retrieve all the records and filter
    It helps the terms specified in the select statement?

    Please let us know if some can help me in this regard.

    Kind regards

    Hello
    Explain the plan will be the same for inline views. In fact if you use any view it is considered inline seen by Oracle.

    SQL> select * FROM
      2  ( select * from Employees)
      3  WHERE first_name='XXX';
    
    no rows selected
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 2285394972
    
    -----------------------------------------------------------------------------------------
    | Id  | Operation                   | Name      | Rows  | Bytes | Cost (%CPU)| Time     |
    -----------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |           |     1 |    68 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMPLOYEES |     1 |    68 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | EMP_IDX   |     1 |       |     1   (0)| 00:00:01 |
    -----------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       2 - access("EMPLOYEES"."FIRST_NAME"='XXX')
    
    Statistics
    ----------------------------------------------------------
              8  recursive calls
              0  db block gets
              3  consistent gets
              0  physical reads
              0  redo size
            874  bytes sent via SQL*Net to client
            373  bytes received via SQL*Net from client
              1  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              0  rows processed
    
    SQL>
    

    PS: You can download Oracle and start using it.

    http://www.Oracle.com/technology/software/products/database/index.html

    Kind regards
    Avinash

Maybe you are looking for