View is very slow.

Hi All,
I have a view which has 15 select statement using union. It's a complex view.
create or replace view v1 (c1,c2,c3)
as
select c1,c2,c3 from t1,t20,t30,t40 where ...............
union
select c1,c2,c3 from t2,t3,t4,t5 where ...............
union
select c1,c2,c3 from t15,t16,t,17 where ...............
If I run the select statement on its own its very quick, records are retrieved in milli seconds.
select c1,c2,c3 from t1,t20,t30,t40 where c1 = xyz
union
select c1,c2,c3 from t2,t3,t4,t5 where c1 = xyz
union
select c1,c2,c3 from t15,t16,t,17 where c1 = xyz
but If I run the same selects through a view then it takes 10 min.
select * from v1 where c1 = xyz
Can someone tell me whats the difference,why the view is so slow as its the same sql in a view and if there is a work around.I have to make this view run faster as its used in Oracle forms.
Thanks.
V.

I tried doing UNION ALL and ran the same query it made no difference. It took still 10 min, which means whether its union or union all oracle is not able to push the predicate inside the various sub queries . Thanks Rob.
Any other solutions ?
I think I may have to take the select statments from the view and create the form based on the proecudure using the select statements.
V.

Similar Messages

  • Report Viewer is very slow at first time

    Hi,
    We are facing very slow when loading the reports.For any search it is taking more time to load the reports.We are thinking issue is due to report viewer control and we are using report viewer control version 10.0.0.0.Could you please let us know how to resolve
    this issue.
    Thanks,
    Vijay

    How big id the query?  How much memory does the server have? It is possible that an execution plan/data pages of the query was thrown from the cache and SQL Server needs to compile/read the data from disk again.
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • New Google maps street view is very slow in FF 31.2.0 on Linux (RHEL 6.3)

    The new google streetview (which does not use Flash) is unusable and renders very slow starting with pixelated images that progressively build. The slowness is not present in FF30.0 on Windows.
    It seems to be an issue in Linux Mint as well: http://forums.linuxmint.com/viewtopic.php?f=47&t=180542
    It seems to be quite common on the google map forums: https://productforums.google.com/forum/#!topic/maps/rWUCllpDDSE
    There seems to be bug open already: https://bugzilla.mozilla.org/show_bug.cgi?id=697443
    But why does FF30.0 on windows work O.K but not FF31.2.0 on Linux?
    * ICA Plugin (Linux) Version 12.1.8.250715 (/opt/Citrix/ICAClient/wfica)
    * Shockwave Flash 11.2 r202
    * The IcedTea-Web Plugin executes Java applets.
    * The Totem 2.28.6 plugin handles video and audio streams.
    * DivX Web Player version 1.4.0.233
    * nspluginwrapper is a cross-platform NPAPI plugin viewer, in particular for linux/i386 plugins.This beta software is available under the terms of the GNU General Public License.
    * This plug-in detects the presence of iTunes when opening iTunes Store URLs in a web page with Firefox.
    * Add Block Plus
    * Firebug

    fixed with this method:
    http://bbs.archlinux.org/viewtopic.php?pid=319710

  • Oracle query / view performing very slow.

    Hello,
    I had created a view in my application for example
    CREATE OR REPLACE VIEW EmpTransfer
    ( EMPID,EMPNAME,EMPMANAGER,EMPDOB,EMPTRANSFER)
    AS
    SELECT EMPID,EMPNAME,EMPMANAGER,EMPDOB,EMPTRANSFER
    FROM EMP ;
    After couple of months if we changed a columnname in the table EMP and added a new column.
    We changed column name EMPTRANSFER to OldEMPTRANSFER and added a new column as NEWEMPTRANSFER.
    The indexes were recreated on OldEMPTRANSFER and new index is creatd on NEWEMPTRANSFER column.
    the view is again recreated.
    CREATE OR REPLACE VIEW EmpTransfer
    ( EMPID,EMPNAME,EMPMANAGER,EMPDOB,OldEMPTRANSFER,NEWEMPTRANSFER )
    AS
    SELECT EMPID,EMPNAME,EMPMANAGER,EMPDOB,OldEMPTRANSFER ,NEWEMPTRANSFER
    FROM EMP ;
    This view is working as expected but some times this view is working very slow.
    The performance of this view is randomly slow.
    Is it possible that column name change will cause slowness...?

    What's the explain plans for both before and after the column change? It could possibly be running slow the first time because of a hard parse due to the query change, which will remain until it's in the shared_pool.
    Edited by: DaleyB on 07-Oct-2009 04:53

  • View creation very slow - not materialized view

    I have a view creation script which is running in a fraction of a second in the dev environment but takes over an hour to run in the test environment.
    The test environment is off-site, so I have no direct access to it. It does have a lot more data in than dev, but this is not a materialised view so as far as I understood it the amount of data in the system shouldn't affect the time to create the view.
    I haven't been able to find any information on what can make this happen. In the development environment I can be querying the view (or can lock it directly), and am still able to run the CREATE OR REPLACE statement without any performance impact. The view does contain function calls and is created with the FORCE keyword, but I can't find any evidence that this should affect the speed of creation.
    I am running Oracle 10g (10.2.0.4.0) on Solaris in both dev and test environments.
    Any ideas on what could be causing this are very welcome.
    CREATE OR REPLACE FORCE VIEW DB_OWNER.PER$AGE
    SYSTEM,
    LOCATION,
    EVENT_START,
    SURNAME,
    DOB_STRING,
    DESCRIPTION,
    GENDER,
    OLD_ID,
    URN,
    COMBINED_SCORE,
    LOAD_DATETIME,
    AGE,
    EVENTDATE_FROM,
    EVENTDATE_TO,
    DETAILS,
    AOB
    AS
    SELECT /*+ leading(ad) */
    p.system,
    p.location,
    p.event_start,
    p.surname,
    CAST (
    NVL (
    NVL2 (
    p.dob,
    TO_CHAR (p.dob, 'dd/mm/yyyy'),
    TO_CHAR (
    p.apparent_age
    + ROUND ( (SYSDATE - p.created_datetime_from) / 365, 0))),
    0) AS VARCHAR2 (10))
    AS dob_string,
    p.description,
    p.gender,
    p.old_id,
    p.urn,
    NVL2 (
    p.dob,
    db_owner.app_age_score (p.dob, ssearch.get_target_age),
    db_owner.age_score (p.apparent_age,
    p.created_datetime_from,
    ssearch.get_target_age))
    AS combined_score,
    p.load_datetime,
    psd.age,
    psd.eventdate_from,
    psd.eventdate_to,
    e.details,
    NVL (e.aob, 'N/A') aob
    FROM db_owner.person p,
    db_owner.psd psd,
    db_owner.entity e
    WHERE p.db_key = psd.db_key
    AND psd.age IS NOT NULL
    AND e.system(+) = p.system
    AND p.system IN (SELECT internal_name
    FROM ops$tomcat.feed_details
    WHERE inSearchList = 'true')
    AND e.urn(+) = p.urn;

    Hi,
    Thanks for the response.
    Trying the same thing without the FORCE keyword made no difference, the view still takes a long time to compile and there are no compilation errors.
    On the development system, I have run a long-running query on the view and checked V$Access. This returns a record for the view, but I can still successfully run the CREATE OR REPLACE statement on the view in another session. This appears to show that a record in V$Access doesn't mean that the view can't be recompiled.
    On the test system there are no other sessions connected and no records for the view in V$Access.
    Does anyone have any other ideas?

  • Green in viewer and very slow

    My first couple of days with FCP X. I have 2 x major problems - that maybe related.
    The first problem is that it feels like it is slowed down by background rendering but when i check the background tasks everything is idle.
    Second as I scroll or play from either event browser or timeline a blank green image appears in the viewer - suspect that this maybe causd by the slowness. it has now got to a point where I cannot continue as almost at a complete halt. I hav equit and restated FCP and also restarted the computer - I have replaced finalcut.plist from the user library.
    I am using an iMac 27" - Jauary 2010 - 16 Gb ram. Hard disk external WD firewire 800.
    Does anyone have any ideas?

    Many many thanks - It was not until I read your reply that I remembered that the footage I was using was from a corrupt Card, that was not recognised by FCP 7 (or iMovie for that matter) and it had been extracted (some months ago) by a converter to H264.
    I converted it via Streamclip, this morning, before importing it again into FCP X and all is well.
    All the same I had asked FCP X to optimize it on original import. BUT it may not have completed that, as FCP X told me there were background operations in progress when It quit it to do a reboot. Now that might mean that FCP X does not continue to optimize when it restarts - must check that out.
    You have saved my bacon. Thanks

  • CS5.5 Live View is very slow compare to CS5?

    I have just installed a trial version of Dreamweaver CS5.5.
    I tried on the Live View. However, to my surprise, everything render in CS5.5 is extremely slow?
    It works great for me in CS5 but not CS5.5
    Any idea why?
    Cheers,
    Venn.

    Hi,
    I tried what you sayed, but without luck.
    I mostly experience trouble with jQuery effects.
    And yes i tried it with disabling my testing server(but normal i realy need this, because i build php based websites).
    Also i have the same problem with the inbuild templates.
    When i use jquery i experience this trouble the most.
    One of the websites where i experience the trouble: http://www.boevewebdesign.com
    Details of my testing server http://www.zend.com/en/products/server-ce/index
    My computer:
    windows 7 ulimate 32 bit
    core i7
    6 gb ram
    thanks

  • Create Materialized view is very slow

    Hi
    Please assist the pasted MV is taking more time(nearly 10hrs) to create, however the select query is executed fraction of seconds.
    CREATE MATERIALIZED VIEW ACOSQ2.CDVEDLCRD_MV
    PCTFREE 10
    PCTUSED 40
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    INITIAL 64 K
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    FREELISTS 1
    FREELIST GROUPS 1
    BUFFER_POOL DEFAULT)
    TABLESPACE ACOSDATA
    LOGGING
    NOCACHE
    NOPARALLEL
    USING INDEX PCTFREE 10
    INITRANS 2
    MAXTRANS 255
    STORAGE (
    BUFFER_POOL DEFAULT)
    REFRESH COMPLETE
    ON DEMAND
    START WITH TO_DATE('26-Mar-2008 00:00:00','dd-mon-yyyy hh24:mi:ss')
    NEXT SYSDATE+7
    WITH ROWID
    USING DEFAULT LOCAL ROLLBACK SEGMENT
    DISABLE QUERY REWRITE AS
    SELECT q.FORENAME,
    q.SURNAME,
    to_char(date_of_birth,'yyyymmdd') As Date_of_birth,
    nvl(gender,'U') As Gender,
    title,
    advac_points_bal,
    ead.e_comms_address As email,
    q.customer_number,
    max_crd.max_card_number As Card_Number,
    cd.card_check_digit ,
    cd.advcd_termntd_code,
    to_char( cd.latest_txn_date, 'YYYYMMDD') As Latest_Txn_Date,
    to_char( cdu.card_use_start_dt, 'YYYYMMDD') As Card_Use_Start_Dt,
    NVL((TRUNC(cd.ADVCD_TMNTD_TMSTMP) - TRUNC(TO_DATE((to_char(SYSDATE - ((TO_NUMBER(TO_CHAR(SYSDATE,'D')) - 1)+7),'DD-MON-YYYY')),'DD-MM-YYYY'))),0) As Diff_Advcd_TMNTD_TMSTMP,
    pos_ppt.total_pos_pts_pending,
    neg_ppt.total_neg_pts_pending,
    next_max_crd.next_max_card_number_dgt As Old_Card_Number_digit
    FROM cdvpersn q,
    cdveaddr ead,
    cdvacprs f,
    cdvadvac g,
    ( select customer_number, SUM(points_pending) AS total_pos_pts_pending
    from cdtppts
    where ppend_delete_code IS NULL
    and points_pending > 0
    group by customer_number ) pos_ppt,
    ( select customer_number, SUM(points_pending) AS total_neg_pts_pending
    from cdtppts
    where ppend_delete_code IS NULL
    and points_pending < 0
    group by customer_number ) neg_ppt,
    ( select adv_account_number, max(a.card_number) As max_card_number
    from cdvcard a, cdvcduse b
    where a.card_number = b.card_number
    and card_type_code <> 6
    group by adv_account_number ) max_crd,
    ( select a1.adv_account_number, max((a1.card_number * 10) + card_check_digit) As next_max_card_number_dgt
    from cdvcard a1, cdvcduse b1
    where a1.card_number = b1.card_number
    and card_type_code <> 6
    and a1.card_number <> ( select max(c1.card_number)
    from cdtcard c1
    where c1.adv_account_number = a1.adv_account_number
    group by adv_account_number ) next_max_crd,
    cdtcard cd,
    cdvcduse cdu
    WHERE ead.e_comms_code = 5
    AND q.customer_number between 1 and 7500000
    AND q.customer_number = ead.customer_number
    AND q.customer_number = f.customer_number
    AND g.adv_account_number = f.adv_account_number
    AND q.customer_number = pos_ppt.customer_number(+)
    AND q.customer_number = neg_ppt.customer_number(+)
    AND g.adv_account_number = max_crd.adv_account_number(+)
    AND g.adv_account_number = next_max_crd.adv_account_number(+)
    AND cd.card_number = max_crd.max_card_number
    AND cd.adv_account_number = g.adv_account_number
    AND cd.card_number = cdu.card_number;
    Rds
    Venkat

    Hi
    Please see the Execution plan
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=554097 Card=1 Bytes=
    229)
    1 0 TABLE ACCESS (BY GLOBAL INDEX ROWID) OF 'CDTCDUSE' (Cost=2
    Card=1 Bytes=14)
    2 1 NESTED LOOPS (Cost=554097 Card=1 Bytes=229)
    3 2 NESTED LOOPS (Cost=554095 Card=1 Bytes=215)
    4 3 HASH JOIN (OUTER) (Cost=554094 Card=1 Bytes=190)
    5 4 HASH JOIN (OUTER) (Cost=352970 Card=1 Bytes=164)
    6 5 NESTED LOOPS (Cost=15 Card=1 Bytes=138)
    7 6 NESTED LOOPS (Cost=14 Card=1 Bytes=128)
    8 7 HASH JOIN (OUTER) (Cost=12 Card=1 Bytes=116)
    9 8 HASH JOIN (OUTER) (Cost=8 Card=1 Bytes=90)
    10 9 NESTED LOOPS (Cost=4 Card=1 Bytes=64)
    11 10 TABLE ACCESS (BY GLOBAL INDEX ROWID) O
    F 'CDTEADDR' (Cost=3 Card=1 Bytes=28)
    12 11 INDEX (RANGE SCAN) OF 'CDTEADDR_PK'
    (UNIQUE) (Cost=2 Card=3)
    13 10 TABLE ACCESS (BY GLOBAL INDEX ROWID) O
    F 'CDTPERSN' (Cost=1 Card=1 Bytes=36)
    14 13 INDEX (UNIQUE SCAN) OF 'CDTPERSN_PK'
    (UNIQUE)
    15 9 VIEW (Cost=3 Card=1 Bytes=26)
    16 15 SORT (GROUP BY) (Cost=3 Card=1 Bytes=1
    3)
    17 16 TABLE ACCESS (BY INDEX ROWID) OF 'CD
    TPPTS' (Cost=3 Card=2 Bytes=26)
    18 17 INDEX (RANGE SCAN) OF 'CDX078ND_CD
    TPPTS' (NON-UNIQUE) (Cost=2 Card=2)
    19 8 VIEW (Cost=3 Card=1 Bytes=26)
    20 19 SORT (GROUP BY) (Cost=3 Card=1 Bytes=13)
    21 20 TABLE ACCESS (BY INDEX ROWID) OF 'CDTP
    PTS' (Cost=3 Card=1 Bytes=13)
    22 21 INDEX (RANGE SCAN) OF 'CDX078ND_CDTP
    PTS' (NON-UNIQUE) (Cost=2 Card=2)
    23 7 TABLE ACCESS (BY GLOBAL INDEX ROWID) OF 'CDT
    ACPRS' (Cost=2 Card=1 Bytes=12)
    24 23 INDEX (RANGE SCAN) OF 'CDX002ND_CDTACPRS'
    (NON-UNIQUE) (Cost=1 Card=1)
    25 6 TABLE ACCESS (BY GLOBAL INDEX ROWID) OF 'CDTAD
    VAC' (Cost=1 Card=1 Bytes=10)
    26 25 INDEX (UNIQUE SCAN) OF 'CDTADVAC_PK' (UNIQUE
    27 5 VIEW (Cost=352816 Card=29814005 Bytes=775164130)
    28 27 SORT (GROUP BY) (Cost=352816 Card=29814005 Byt
    es=1282002215)
    29 28 MERGE JOIN (Cost=352816 Card=29814005 Bytes=
    1282002215)
    30 29 SORT (JOIN) (Cost=215089 Card=29814006 Byt
    es=715536144)
    31 30 HASH JOIN (Cost=73165 Card=29814006 Byte
    s=715536144)
    32 31 INDEX (FAST FULL SCAN) OF 'CDTCDUSE_PK
    ' (UNIQUE) (Cost=4 Card=29814006 Bytes=268326054)
    33 31 PARTITION RANGE (ALL)
    34 33 TABLE ACCESS (FULL) OF 'CDTCARD' (Co
    st=40282 Card=39752004 Bytes=596280060)
    35 29 FILTER
    36 35 SORT (JOIN)
    37 36 VIEW OF 'VW_SQ_1' (Cost=826 Card=34324
    840 Bytes=652171960)
    38 37 SORT (GROUP BY) (Cost=826 Card=34324
    840 Bytes=411898080)
    39 38 TABLE ACCESS (BY GLOBAL INDEX ROWI
    D) OF 'CDTCARD' (Cost=826 Card=39752004 Bytes=477024048)
    40 39 INDEX (FULL SCAN) OF 'CDX012ND_C
    DTCARD' (NON-UNIQUE) (Cost=26 Card=39752004)
    41 4 VIEW (Cost=200985 Card=29814006 Bytes=775164156)
    42 41 SORT (GROUP BY) (Cost=200985 Card=29814006 Bytes
    =626094126)
    43 42 HASH JOIN (Cost=70569 Card=29814006 Bytes=6260
    94126)
    44 43 INDEX (FAST FULL SCAN) OF 'CDTCDUSE_PK' (UNI
    QUE) (Cost=4 Card=29814006 Bytes=268326054)
    45 43 PARTITION RANGE (ALL)
    46 45 TABLE ACCESS (FULL) OF 'CDTCARD' (Cost=402
    82 Card=39752004 Bytes=477024048)
    47 3 TABLE ACCESS (BY GLOBAL INDEX ROWID) OF 'CDTCARD' (C
    ost=1 Card=1 Bytes=25)
    48 47 INDEX (UNIQUE SCAN) OF 'CDTCARD_PK' (UNIQUE)
    49 2 INDEX (RANGE SCAN) OF 'CDTCDUSE_PK' (UNIQUE) (Cost=1 C
    ard=1)
    Statistics
    1300 recursive calls
    0 db block gets
    606 consistent gets
    46 physical reads
    0 redo size
    1429 bytes sent via SQL*Net to client
    1709 bytes received via SQL*Net from client
    1 SQL*Net roundtrips to/from client
    46 sorts (memory)
    0 sorts (disk)
    0 rows processed

  • Info View is Very Slow

    Hi ,
    I am connecting to my Client machine through VPN, I am able to login the infoview very fast , but when ever i am trying to Create a new webi document it is takeing lot of time , (i.e more than one hour to get java trust pop up) If i click on trust after that also it is taking too much time .I am able to open the existing report ana able to refresh also.
    Please let me know what to do.
    Thanks
    Santhosh V

    Hello jin,
    I check with my colleague from onsite there this is working fine with my login issue.
    If i want to work on i have to connect through VPN only,
    I want to know is there any problem with Java version, Plz guide me what to do?
    Thanks
    Santhosh V

  • Help viewer is very slow - 'Mac Help' questions never answer

    Does the Help function not work in OS 10.4.4? I can only get answers in some 3rd party applictions but not Mac Help.
    Anyone know why???

    Hello Terry,
    Try this...
    Help
    With thanks to Dr S
    Cheers
    Ian

  • Query can run in Oracle 10g but very slow in 11g

    Hi,
    We've just migrated to Oracle 11g and we noticed that some of our view are very slow (it takes seconds in 10g and takes 30 minutes in 11g), and the tables are using the local table.
    Do any of you face the same issue?
    This is our query:
    SELECT
    A.wellbore
    ,a.depth center
    ,d.MD maxbc
    ,d.XDELT xbc
    ,d.YDELT ybc
    ,e.MD minac
    ,e.XDELT xac
    ,e.YDELT yac
    from
    table_A d,table_A e, table_B a
    where a.wellbore = d.WELLBORE (+)
    and a.wellbore = e.WELLBORE(+)
    and d.MD = (select max(MD) from table_A b where b.MD < a.depth and
    d.wellBORE = b.wellBORE)
    and e.md = (select min(md) from table_A c where c.MD > a.depth and
    e.wellBORE = c.wellBORE);

    Thanks I will move to the correct one..
    Rafi,
    Build the Indexes and it is still slow. I am querying from a view from another database, which is in 10g instances.
    Moved: Query can run in Oracle 10g but very slow in 11g
    Edited by: 924400 on Apr 1, 2012 6:03 PM
    Edited by: 924400 on Apr 1, 2012 6:26 PM

  • Materialzied Refresh is very slow in oracle10g

    We are migrating our database from Oracle8i-->Oracle10g.
    But in dataware housing we are facing problem for refresh materialized view is very slow
    We change due to this below.
    1. exec DBMS_MVIEW.REFRESH('MVIEW,atomic_refresh => FALSE );
    Our two parameter are same as Oracle8i
    query_rewrite_enabled = TRUE
    query_rewrite_integrity = enforced
    Please suggest to make it fast
    Thanks
    Chetan

    ChetanS wrote:
    We are migrating our database from Oracle8i-->Oracle10g.
    But in dataware housing we are facing problem for refresh materialized view is very slow
    We change due to this below.
    1. exec DBMS_MVIEW.REFRESH('MVIEW,atomic_refresh => FALSE );
    Our two parameter are same as Oracle8i
    query_rewrite_enabled = TRUE
    query_rewrite_integrity = enforced
    Please suggest to make it fastChetan,
    depending on your MV definition it might not be the refresh DML but the query that is taking substantially longer than in your 8i environment. May be you want to compare the performance of your query by simply running a CTAS statement using the MV query to find out whether it's a DDL/DML/fast refresh issue or a query related performance issue.
    Do you use the FAST refresh method, i.e. do you have MV logs on the base tables or is this a complete refresh?
    Regards,
    Randolf
    Oracle related stuff blog:
    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/

  • Save Search Running Very Slow

    I have a custom page with a query Bean and have Simple, Advanced and View Panels enabled. My Search functionality works great, very fast. However, when I save a search... any search... no matter how small the resultset...When I go into the views panel... The views run VERY slow. The results do eventually come back, but it takes 3-5 minutes compared to 3-5 seconds when I run the same search from my search panels.
    Does anybody know what OAF does in the background of the Views Panel? Does it alter the SQL differently then when I simply run a search?
    Any help is much appreciated.

    I had the same problem when I setup a new computer this week. Here's what I had installed:
    Photoshop CS5
    Suitcase Fusion 3
    The problem was that when I was in Photoshop and used the "Save for Web" export screen, the dropdown menu for the different export types (JPG, PNG, GIF, etc) would take an extremely long time to update the preview of the graphic.
    After a few days of research , I found that Suitcase was conflicting with Photoshop. Here's how you fix the problem (or at least here's what I did with my situation):
    Open Suitcase
    Go to "Tools", click "Manage Plugins"
    Deactivate the Photoshop plugin
    This fixed the problem immediately and now my Photoshop" Save For Web" feature is working really fast. Hope this helps anyone else in the same boat.

  • Oracle 11G - Update is very slow on View

    I have big trouble with some Update query on Oracle 11G.
    I have a set of tables (5) of identical structures and a view that consists in an UNION ALL of the 5 tables.
    None of this table contains more than 20 000 rows.
    Let's call the view V_INTE_NE. Each of the basic table has a PRIMARY KEY defined on 3 NUMBERS(10,0) -> INTE_REF / NE_REF / INSTANCE.
    Now, I get 6 rows in another table and I want to update my view from the data of this small table (let's call it SMALL). This table has the 3 columns INTE_REF / NE_REF / INSTANCE.
    When I try to join the two tables :
    SELECT * FROM T_INTE_NE T2
    WHERE EXISTS ( SELECT 1 FROM SMALL T1 WHERE T2.INTE_REF = T1.INTEREF AND T2.NE_REF = T1.NEREF AND T2.INTE_INST = T1.INSTANCE )
    I get the 6 lines in 0.037 seconds
    When I try to update the view (I have an INSTEAD OF trigger that does nothing (just return for testing even without modifying anything), I execute the following query :
    UPDATE T_INTE_NE T2
    SET INTE_STATE = -11 WHERE
    EXISTS ( SELECT 1 FROM SMALL T1 WHERE T2.INTE_REF = T1.INTEREF AND T2.NE_REF = T1.NEREF AND T2.INTE_INST = T1.INSTANCE )
    The 6 rows are updated (at least TRIGGER is called) in 20 seconds.
    However, in the execution plan, I can't see where Oracle takes time to achieve the query :
    Plan hash value: 907176690
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | UPDATE STATEMENT | | 6 | 36870 | 153 (1)| 00:00:02 |
    | 1 | UPDATE | T_INTE_NE | | | | |
    |* 2 | HASH JOIN RIGHT SEMI | | 6 | 36870 | 153 (1)| 00:00:02 |
    | 3 | TABLE ACCESS FULL | SMALL | 6 | 234 | 9 (0)| 00:00:01 |
    | 4 | VIEW | T_INTE_NE | 6 | 36636 | 143 (0)| 00:00:02 |
    | 5 | VIEW | X_V_T_INTE_NE | 6 | 18636 | 143 (0)| 00:00:02 |
    | 6 | UNION-ALL | | | | | |
    | 7 | TABLE ACCESS FULL| SECNODE1_T_INTE_NE | 1 | 3106 | 60 (0)| 00:00:01 |
    | 8 | TABLE ACCESS FULL| SECNODE2_T_INTE_NE | 1 | 3106 | 60 (0)| 00:00:01 |
    | 9 | TABLE ACCESS FULL| SECNODE3_T_INTE_NE | 1 | 3106 | 2 (0)| 00:00:01 |
    | 10 | TABLE ACCESS FULL| SECNODE4_T_INTE_NE | 1 | 3106 | 2 (0)| 00:00:01 |
    | 11 | TABLE ACCESS FULL| SECNODE5_T_INTE_NE | 1 | 3106 | 2 (0)| 00:00:01 |
    | 12 | TABLE ACCESS FULL| SYS_T_INTE_NE | 1 | 3106 | 17 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - access("T2"."INTE_REF"="T1"."INTEREF" AND "T2"."NE_REF"="T1"."NEREF" AND
    "T2"."INTE_INST"="T1"."INSTANCE")
    Note
    - dynamic sampling used for this statement (level=2)
    Statistics
    3 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 tasks
    What could explain the difference ?
    I get exactly the same execution plan (when autotrace is ON).
    Furthermore, if I try to do the same update on each of the basic tables, I get the rows updated instantaneously.
    Is there any reason for avoiding this kind of query ?
    Any help would be greatly appreciated :-)
    Regards,
    Patrick

    Sorry for this, I lost myself in conjonctures and I didn't think I would have to explain the whole case.
    So, I wrote a small piece of PL/SQL that reproduces the same issue.
    It seems that my issue is not due to the UPDATE but to the use of the IN predicate.
    As you can see at the end of the script, I try to join the 2 tables using different technics.
    The first query is very fast, the second is very slow.
    I need the second one if I want to do any update.
    DROP TABLE Part1;
    DROP TABLE Part2;
    DROP TABLE Part3;
    DROP TABLE Part4;
    CREATE TABLE Part1 ( Key1 NUMBER(10, 0), Key2 NUMBER(10, 0), Key3 NUMBER(10, 0), PartId NUMBER(10, 0) DEFAULT( 1 ) NOT NULL, Data1 VARCHAR2(1000), X_Data2 VARCHAR2(2000) NULL, X_Data3 VARCHAR2(2000) NULL, CONSTRAINT PK_Part1 PRIMARY KEY( Key1, Key2, Key3 ) );
    CREATE TABLE Part2 ( Key1 NUMBER(10, 0), Key2 NUMBER(10, 0), Key3 NUMBER(10, 0), PartId NUMBER(10, 0) DEFAULT( 2 ) NOT NULL, Data1 VARCHAR2(1000), X_Data2 VARCHAR2(2000) NULL, X_Data3 VARCHAR2(2000) NULL, CONSTRAINT PK_Part2 PRIMARY KEY( Key1, Key2, Key3 ) );
    CREATE TABLE Part3 ( Key1 NUMBER(10, 0), Key2 NUMBER(10, 0), Key3 NUMBER(10, 0), PartId NUMBER(10, 0) DEFAULT( 3 ) NOT NULL, Data1 VARCHAR2(1000), X_Data2 VARCHAR2(2000) NULL, X_Data3 VARCHAR2(2000) NULL, CONSTRAINT PK_Part3 PRIMARY KEY( Key1, Key2, Key3 ) );
    CREATE TABLE Part4 ( Key1 NUMBER(10, 0), Key2 NUMBER(10, 0), Key3 NUMBER(10, 0), PartId NUMBER(10, 0) DEFAULT( 4 ) NOT NULL, Data1 VARCHAR2(1000), X_Data2 VARCHAR2(2000) NULL, X_Data3 VARCHAR2(2000) NULL, CONSTRAINT PK_Part4 PRIMARY KEY( Key1, Key2, Key3 ) );
    CREATE OR REPLACE FUNCTION Decrypt
    x_in IN VARCHAR2
    ) RETURN VARCHAR2
    AS
    x_out VARCHAR2(2000);
    BEGIN
    SELECT REVERSE( x_in ) INTO x_out FROM DUAL;
    RETURN ( x_out );
    END;
    CREATE OR REPLACE VIEW AllParts AS
    SELECT Key1, Key2, Key3, PartId, Data1, Decrypt( X_Data2 ) AS Data2, Decrypt( X_Data3 ) AS Data3 FROM Part1
    UNION ALL
    SELECT Key1, Key2, Key3, PartId, Data1, Decrypt( X_Data2 ) AS Data2, Decrypt( X_Data3 ) AS Data3 FROM Part2
    UNION ALL
    SELECT Key1, Key2, Key3, PartId, Data1, Decrypt( X_Data2 ) AS Data2, Decrypt( X_Data3 ) AS Data3 FROM Part3
    UNION ALL
    SELECT Key1, Key2, Key3, PartId, Data1, Decrypt( X_Data2 ) AS Data2, Decrypt( X_Data3 ) AS Data3 FROM Part4;
    DROP TABLE Small;
    CREATE TABLE Small ( Key1 NUMBER(10, 0), Key2 NUMBER(10, 0), Key3 NUMBER(10, 0), Data1 VARCHAR2(1000) );
    BEGIN
    DECLARE
    n_Key NUMBER(10, 0 ) := 0;
    BEGIN
    WHILE ( n_Key < 50000 )
    LOOP
    INSERT INTO Part1( Key1, Key2, Key3 )
    VALUES( n_Key, FLOOR( n_Key / 10 ), FLOOR( n_Key / 100 ) );
    INSERT INTO Part2( Key1, Key2, Key3 )
    VALUES( n_Key, FLOOR( n_Key / 10 ), FLOOR( n_Key / 100 ) );
    INSERT INTO Part3( Key1, Key2, Key3 )
    VALUES( n_Key, FLOOR( n_Key / 10 ), FLOOR( n_Key / 100 ) );
    INSERT INTO Part4( Key1, Key2, Key3 )
    VALUES( n_Key, FLOOR( n_Key / 10 ), FLOOR( n_Key / 100 ) );
    n_Key := n_Key + 1;
    END LOOP;
    INSERT INTO Small( Key1, Key2, Key3, Data1 ) VALUES ( 1000, 100, 10, 'Test 1000' );
    INSERT INTO Small( Key1, Key2, Key3, Data1 ) VALUES ( 3000, 300, 30, 'Test 3000' );
    INSERT INTO Small( Key1, Key2, Key3, Data1 ) VALUES ( 5000, 500, 50, 'Test 5000' );
    COMMIT;
    END;
    END;
    SELECT T2.*
    FROM Small T1, AllParts T2
    WHERE T2.Key1 = T1.Key1 AND T2.Key2 = T1.Key2 AND T2.Key3 = T1.Key3;
    SELECT T1.*
    FROM AllParts T1
    WHERE ( T1.Key1, T1.Key2, T1.Key3 ) IN ( SELECT T2.Key1, T2.Key2, T2.Key3 FROM Small T2 );

  • Materialized view refresh is very slow in production

    Hi,
    I am using Oracle 10.2.0.4.0 version and facing problem in Materialized view refresh in production.
    There is a set of Materialized views (15 Mviews) are refreshed through refresh group in production every week or adhoc basis. And for refreshing it is taking 5hrs. I have refreshed the same set of Materialized views multiple times in development environment through refresh group but it got refreshed within 3min. The structure of materialized base tables, type of materialized view refresh, materialized definition and volume of base tables are same between development and production. The production disk space also larger than development. But I am not sure why in production the refresh is very slow compare to development. As this is very critical can some one help on this?
    Thanks is advance.
    - Gopinath.

    Is it fast refresh Mviews? If yes, then check size of materialized view logs. Also check is any other mviews registered on those tables and not refreshing.
    select log_owner, master, log_table, REFRESH_method, version,
           owner, name as ragistered_snapshot, snapshot_site, current_snapshots last_refresh_time, sl.snapshot_id
    from dba_snapshot_logs sl,
         dba_registered_snapshots rs
    where sl.snapshot_id = rs.snapshot_id (+)
    order by 1,2,3 
    ;

Maybe you are looking for

  • VA01 BDC Session - Purchase requisition wiew not shown

    Hello Forum, I've a problem with a BDC session in ECC 6.0 about VA01. When I try to change the purchasing requisition data from the shcedule tab using the button identified from the BDC with the code "EIBB"  (the last one) the subsequent screen is no

  • Computer not recognizing quicktime

    Although I have found a few threads with the same problem, I have yet found a solution that works for my computer. I have downloaded the stand alone quicktime.....and that didn't work, I have tried uninstalling itunes and reinstalling....that didn't

  • Having trouble consolidating library to transfer files to Mac

    I want to use my ipod as a drive to transfer music files to my new Mac. Following the steps outlined it says to consolidate library. When I try and do this , I get this window "Copying Music Failed. The file name was invalid or too long." How do I fi

  • Problems with the width of my page created in adobe muse (scrolled)

    I have a little problem I get a small scroll (scrolled) in the page to move sideways and do not know how to remove it and do not know why I get and I spoil that little scroll whole layout of the page. Please watch this short video and live shows. Vid

  • 8/2/2012 - Flash Player 11.3 Update

    Today, Flash Player 11.3.300.270 for Windows was released to address a crash that was occurring in the Adobe Flash Player Update Service (FlashPlayerUpdateService.exe).  There are no other fixes or changes provided with this build.  This release is a