Performance on views

Hello All,
We noticed performance issue when tryi ng to select data from a view. Below is the detail on this view:
1. View Definition:
CREATE OR REPLACE FORCE VIEW baninst1.sgvacur (sgvacur_pidm,
                                               sgvacur_seqno,
                                               sgvacur_lmod_code,
                                               sgvacur_term_code,
                                               sgvacur_key_seqno,
                                               sgvacur_priority_no,
                                               sgvacur_roll_ind,
                                               sgvacur_cact_code,
                                               sgvacur_user_id,
                                               sgvacur_data_origin,
                                               sgvacur_activity_date,
                                               sgvacur_levl_code,
                                               sgvacur_coll_code,
                                               sgvacur_degc_code,
                                               sgvacur_term_code_ctlg,
                                               sgvacur_term_code_end,
                                               sgvacur_term_code_matric,
                                               sgvacur_term_code_admit,
                                               sgvacur_admt_code,
                                               sgvacur_camp_code,
                                               sgvacur_program,
                                               sgvacur_start_date,
                                               sgvacur_end_date,
                                               sgvacur_curr_rule,
                                               sgvacur_rolled_seqno,
                                               sgvacur_rowid,
                                               sgvacur_order,
                                               sgvacur_active_ind,
                                               sgvacur_stdn_rowid,
                                               sgvacur_stdn_term_code_eff,
                                               sgvacur_styp_code_stdn,
                                               sgvacur_site_code,
                                               sgvacur_rate_code,
                                               sgvacur_styp_code,
                                               sgvacur_leav_code,
                                               sgvacur_leav_from_date,
                                               sgvacur_leav_to_date,
                                               sgvacur_exp_grad_date,
                                               sgvacur_term_code_grad,
                                               sgvacur_acyr_code,
                                               sgvacur_appl_key_seqno,
                                               sgvacur_appl_seqno,
                                               sgvacur_majr_code_1,
                                               sgvacur_dept_code_1,
                                               sgvacur_curr_rule_majr_1,
                                               sgvacur_majr_code_2,
                                               sgvacur_curr_rule_majr_2,
                                               sgvacur_dept_code_2,
                                               sgvacur_majr_code_minr_1,
                                               sgvacur_curr_rule_minr_1,
                                               sgvacur_majr_code_minr_2,
                                               sgvacur_curr_rule_minr_2,
                                               sgvacur_majr_code_conc_1,
                                               sgvacur_curr_rule_conc_1,
                                               sgvacur_attach_majr_conc_1,
                                               sgvacur_majr_code_conc_2,
                                               sgvacur_curr_rule_conc_2,
                                               sgvacur_attach_majr_conc_2,
                                               sgvacur_majr_code_conc_3,
                                               sgvacur_curr_rule_conc_3,
                                               sgvacur_attach_majr_conc_3,
                                               sgvacur_majr_code_conc_4,
                                               sgvacur_curr_rule_conc_4,
                                               sgvacur_attach_majr_conc_4,
                                               sgvacur_majr_code_conc_5,
                                               sgvacur_curr_rule_conc_5,
                                               sgvacur_attach_majr_conc_5,
                                               sgvacur_majr_code_conc_6,
                                               sgvacur_curr_rule_conc_6,
                                               sgvacur_attach_majr_conc_6
AS
   SELECT sorlcur_pidm, sorlcur_seqno, sorlcur_lmod_code, sorlcur_term_code,
          sorlcur_key_seqno, sorlcur_priority_no, sorlcur_roll_ind,
          sorlcur_cact_code, sorlcur_user_id, sorlcur_data_origin,
          sorlcur_activity_date, sorlcur_levl_code, sorlcur_coll_code,
          sorlcur_degc_code, sorlcur_term_code_ctlg, sorlcur_term_code_end,
          sorlcur_term_code_matric, sorlcur_term_code_admit,
          sorlcur_admt_code, sorlcur_camp_code, sorlcur_program,
          sorlcur_start_date, sorlcur_end_date, sorlcur_curr_rule,
          sorlcur_rolled_seqno, sorlcur.ROWID,
          sb_curriculum.f_lcur_order (sgbstdn_pidm,
                                      sb_curriculum_str.f_learner,
                                      sorlcur_term_code,
                                      99,
                                      sorlcur.ROWID,
                                      sgbstdn_term_code_eff
          sobcact_active_ind, sgbstdn.ROWID, sgbstdn_term_code_eff,
          sgbstdn_styp_code, NVL (sorlcur_site_code, sgbstdn_site_code),
          NVL (sorlcur_rate_code, sgbstdn_rate_code), sorlcur_styp_code,
          NVL (sorlcur_leav_code, sgbstdn_leav_code),
          NVL (sorlcur_leav_from_date, sgbstdn_leav_from_date),
          NVL (sorlcur_leav_to_date, sgbstdn_leav_to_date),
          NVL (sorlcur_exp_grad_date, sgbstdn_exp_grad_date),
          NVL (sorlcur_term_code_grad, sgbstdn_term_code_grad),
          NVL (sorlcur_acyr_code, sgbstdn_acyr_code), sorlcur_appl_key_seqno,
          sorlcur_appl_seqno, prim_major.sorlfos_majr_code,
          prim_major.sorlfos_dept_code, prim_major.sorlfos_lfos_rule,
          sec_major.sorlfos_majr_code, sec_major.sorlfos_dept_code,
          sec_major.sorlfos_lfos_rule, prim_minor.sorlfos_majr_code,
          prim_minor.sorlfos_lfos_rule, sec_minor.sorlfos_majr_code,
          sec_minor.sorlfos_lfos_rule, prim_conc.sorlfos_majr_code,
          prim_conc.sorlfos_lfos_rule, prim_conc.sorlfos_majr_code_attach,
          sec_conc.sorlfos_majr_code, sec_conc.sorlfos_lfos_rule,
          sec_conc.sorlfos_majr_code_attach, third_conc.sorlfos_majr_code,
          third_conc.sorlfos_lfos_rule, third_conc.sorlfos_majr_code_attach,
          fourth_conc.sorlfos_majr_code, fourth_conc.sorlfos_lfos_rule,
          fourth_conc.sorlfos_majr_code_attach, fifth_conc.sorlfos_majr_code,
          fifth_conc.sorlfos_lfos_rule, fifth_conc.sorlfos_majr_code_attach,
          six_conc.sorlfos_majr_code, six_conc.sorlfos_lfos_rule,
          six_conc.sorlfos_majr_code_attach
     FROM sorlfos six_conc,
          sorlfos fifth_conc,
          sorlfos fourth_conc,
          sorlfos third_conc,
          sorlfos sec_conc,
          sorlfos prim_conc,
          sorlfos sec_minor,
          sorlfos prim_minor,
          sorlfos sec_major,
          sorlfos prim_major,
          sobcact,
          sorlcur,
          sgbstdn
    WHERE six_conc.ROWID(+) =
             soklcur.f_lfos_rowid (sorlcur_lmod_code,
                                   sorlcur_seqno,
                                   sb_fieldofstudy_str.f_concentration,
                                   sorlcur_pidm,
                                   sorlcur_term_code,
                                   NULL,
                                   6
      AND fifth_conc.ROWID(+) =
             soklcur.f_lfos_rowid (sorlcur_lmod_code,
                                   sorlcur_seqno,
                                   sb_fieldofstudy_str.f_concentration,
                                   sorlcur_pidm,
                                   sorlcur_term_code,
                                   NULL,
                                   5
      AND fourth_conc.ROWID(+) =
             soklcur.f_lfos_rowid (sorlcur_lmod_code,
                                   sorlcur_seqno,
                                   sb_fieldofstudy_str.f_concentration,
                                   sorlcur_pidm,
                                   sorlcur_term_code,
                                   NULL,
                                   4
      AND third_conc.ROWID(+) =
             soklcur.f_lfos_rowid (sorlcur_lmod_code,
                                   sorlcur_seqno,
                                   sb_fieldofstudy_str.f_concentration,
                                   sorlcur_pidm,
                                   sorlcur_term_code,
                                   NULL,
                                   3
      AND sec_conc.ROWID(+) =
             soklcur.f_lfos_rowid (sorlcur_lmod_code,
                                   sorlcur_seqno,
                                   sb_fieldofstudy_str.f_concentration,
                                   sorlcur_pidm,
                                   sorlcur_term_code,
                                   NULL,
                                   2
      AND prim_conc.ROWID(+) =
             soklcur.f_lfos_rowid (sorlcur_lmod_code,
                                   sorlcur_seqno,
                                   sb_fieldofstudy_str.f_concentration,
                                   sorlcur_pidm,
                                   sorlcur_term_code,
                                   NULL,
                                   1
      AND sec_minor.ROWID(+) =
             soklcur.f_lfos_rowid (sorlcur_lmod_code,
                                   sorlcur_seqno,
                                   sb_fieldofstudy_str.f_minor,
                                   sorlcur_pidm,
                                   sorlcur_term_code,
                                   NULL,
                                   2
      AND prim_minor.ROWID(+) =
             soklcur.f_lfos_rowid (sorlcur_lmod_code,
                                   sorlcur_seqno,
                                   sb_fieldofstudy_str.f_minor,
                                   sorlcur_pidm,
                                   sorlcur_term_code,
                                   NULL,
                                   1
      AND sec_major.ROWID(+) =
             soklcur.f_lfos_rowid (sorlcur_lmod_code,
                                   sorlcur_seqno,
                                   sb_fieldofstudy_str.f_major,
                                   sorlcur_pidm,
                                   sorlcur_term_code,
                                   NULL,
                                   2
      AND prim_major.ROWID =
             soklcur.f_lfos_rowid (sorlcur_lmod_code,
                                   sorlcur_seqno,
                                   sb_fieldofstudy_str.f_major,
                                   sorlcur_pidm,
                                   sorlcur_term_code,
                                   NULL,
                                   1
      AND sobcact_cact_code = sorlcur_cact_code
      AND sorlcur_lmod_code = sb_curriculum_str.f_learner
      AND sorlcur_pidm = sgbstdn_pidm;2. the execution plan when select * from SGVACUR;
SQL> @explain_SGVACUR.sql
Explained.
PLAN_TABLE_OUTPUT
| Id  | Operation                                | Name           | Rows  | Bytes |TempSpc| Cost (%CPU)|
|   0 | SELECT STATEMENT                         |                |     1 |   166 |       |    18E(100)|
|   1 |  SORT AGGREGATE                          |                |     1 |   166 |       |            |
|   2 |   MERGE JOIN                             |                |    18E|    15E|       |    18E(100)|
|   3 |    SORT JOIN                             |                |    18E|    15E|    15E|    18E(100)|
|   4 |     MERGE JOIN OUTER                     |                |    18E|    15E|       |    18E(100)|
|   5 |      SORT JOIN                           |                |    18E|    15E|    15E|    18E(100)|
|   6 |       MERGE JOIN OUTER                   |                |    18E|    15E|       |    18E(100)|
|   7 |        SORT JOIN                         |                |    18E|    15E|    15E|    18E(100)|
|   8 |         MERGE JOIN OUTER                 |                |    18E|    15E|       |    18E(100)|
|   9 |          SORT JOIN                       |                |    18E|    15E|    15E|    18E(100)|
|  10 |           MERGE JOIN OUTER               |                |    18E|    15E|       |    18E(100)|
|  11 |            SORT JOIN                     |                |    18E|    15E|    15E|    18E(100)|
|  12 |             MERGE JOIN OUTER             |                |    18E|    15E|       |    18E(100)|
|  13 |              SORT JOIN                   |                |    18E|    15E|    15E|   629P(100)|
|  14 |               MERGE JOIN OUTER           |                |    18E|    15E|       |    19P(100)|
|  15 |                SORT JOIN                 |                |   269P|    15E|    15E|    51T(100)|
|  16 |                 MERGE JOIN OUTER         |                |   269P|    15E|       |  1920G(100)|
|  17 |                  SORT JOIN               |                |    27T|  1722T|  3768T|  5369M (76)|
|  18 |                   HASH JOIN RIGHT OUTER  |                |    27T|  1722T|    22M|   201M (96)|
|  19 |                    INDEX FAST FULL SCAN  | PK_SORLFOS     |   994K|    11M|       |  1049   (2)|
|  20 |                    HASH JOIN OUTER       |                |  2722M|   147G|    15M| 24972  (79)|
|  21 |                     HASH JOIN            |                |   273K|    12M|  3808K|  2648   (5)|
|  22 |                      INDEX FAST FULL SCAN| IDX$$_AE220001 |   228K|  1118K|       |   167   (2)|
|  23 |                      HASH JOIN           |                |   143K|  5765K|       |  1928   (6)|
|  24 |                       INDEX FULL SCAN    | PK_SOBCACT     |     4 |    36 |       |     1   (0)|
|  25 |                       TABLE ACCESS FULL  | SORLCUR        |   143K|  4499K|       |  1926   (6)|
|  26 |                     INDEX FAST FULL SCAN | PK_SORLFOS     |   994K|    11M|       |  1049   (2)|
|  27 |                  SORT JOIN               |                |   994K|    11M|    38M|  5624   (2)|
|  28 |                   INDEX FAST FULL SCAN   | PK_SORLFOS     |   994K|    11M|       |  1049   (2)|
|  29 |                SORT JOIN                 |                |   994K|    11M|    38M|  5624   (2)|
|  30 |                 INDEX FAST FULL SCAN     | PK_SORLFOS     |   994K|    11M|       |  1049   (2)|
|  31 |              SORT JOIN                   |                |   994K|    11M|    38M|  5624   (2)|
|  32 |               INDEX FAST FULL SCAN       | PK_SORLFOS     |   994K|    11M|       |  1049   (2)|
|  33 |            SORT JOIN                     |                |   994K|    11M|    38M|  5624   (2)|
|  34 |             INDEX FAST FULL SCAN         | PK_SORLFOS     |   994K|    11M|       |  1049   (2)|
|  35 |          SORT JOIN                       |                |   994K|    11M|    38M|  5624   (2)|
|  36 |           INDEX FAST FULL SCAN           | PK_SORLFOS     |   994K|    11M|       |  1049   (2)|
|  37 |        SORT JOIN                         |                |   994K|    11M|    38M|  5624   (2)|
|  38 |         INDEX FAST FULL SCAN             | PK_SORLFOS     |   994K|    11M|       |  1049   (2)|
|  39 |      SORT JOIN                           |                |   994K|    11M|    38M|  5624   (2)|
|  40 |       INDEX FAST FULL SCAN               | PK_SORLFOS     |   994K|    11M|       |  1049   (2)|
|  41 |    SORT JOIN                             |                |   994K|    11M|    38M|  5624   (2)|
|  42 |     INDEX FAST FULL SCAN                 | PK_SORLFOS     |   994K|    11M|       |  1049   (2)|
--------------------------------------------------------------------------------------------------------3. Doe anyone have any thoughts and suggestion as to how to speed up the view performance?
Your input is greatly appreciated! Thanks!

riedelme wrote:
jgarry wrote:
riedelme wrote:
Only four tables... there is a severe problem with implementation of relational design, if any such design was even done.
Techincially, only 4 different tables, but lots of repeat usage as logical other tables reading the same tables many times. Whatever.
The problem lies deep, and I don't mean in code.No argument! I'm still with Tanel on the functions, thoughI'm wondering if the MV suggestion really isn't a joke, but actually a reasonable suggestion. You guys are a lot better on these issues than me, so I'm curious if this is a reasonable argument:
There are several self-outer-joins. This implies too much denormilization (assuming there was normalized design to begin with, given the fact of this kind of design, I'm ignoring my gut feel it was all just thrown together). So what happens? The rows are added physically near to each other in blocks, since they are added at the same time. This has the effect of making a kind of sparse file - when the database gathers blocks on each run through the full table scan, it is only getting those that satisfy the condition of that part of the query, actually using multiblock reads to grab lots of blocks that mostly don't have the data needed. Then it has to do it again over the same blocks for the next outer join part. And etc. for all those outer joins.
Now, if MV was used to split those into separate tables, each full scan would grab denser blocks in a multiblock read fashion, and there would be fewer of them. There might even be enough information for the optimizer to do some probing, or perhaps even stopkeys. This might be an order of magnitude faster, simply from densification.
Insane, or crazy like a fox?
I'm also wondering if there might be some really tricky analytic function to make it all work with one pass, but that's just way over my head.

Similar Messages

  • Cannot perform cube view operation, null

    Hi There,
    Users use SmartView connect to the 11.1.1.3 cube, but get the following error:
    "Cannot perform cube view operation, null"
    Any advice?
    Thanks

    It is a stupid meanless message for the real issues. The users have suppress missing turned on on an intinal retrieve and nothing is returned. Turn off suppress missing in the options and the users should be fine.

  • [sql performance] inline view , group by , max, join

    Hi. everyone.
    I have a question with regard to "group by" inline view ,
    max value, join, and sql performance.
    I will give you simple table definitions in order for you
    to understand my intention.
    Table A (parent)
    C1
    C2
    C3
    Table B (child)
    C1
    C2
    C3
    C4 number type(sequence number)
    1. c1, c2, c3 are the key columns of tabla A.
    2. c1, c2, c3, c4 are the key columns of table B.
    3. table A is the parent table of Table B.
    4. c4 column of table b is the serial number.
    (c4 increases from 1 by "1" regarding every (c1,c2,c3)
    the following is the simple example of the sql query.
    select .................................
    from table_a,
    (select c1, c2, c3, max(c4)
    from table_b
    group by c1, c2, c3) table_c
    where table_a.c1 = table_c.c1
    and table_a.c2 = table_c.c2
    and table_a.c3 = table_c.c3
    The real query is not simple as above. More tables come
    after "the from clause".
    Table A and table B are big tables, which have more than
    100,000,000 rows.
    The response time of this sql is very very slow
    as everyone can expect.
    Are there any solutions or sql-tips about the late response-time?
    I am considering adding a new column into "Table B" in
    order to identify the row, which has max serial number.
    At this point, I am not sure adding a column is a good
    thing in terms of every aspect.
    I will be waiting for your advice and every response
    will be appreciated even if it is not the solution.
    Have a good day.
    HO.
    Message was edited by:
    user507290

    For such big sources check that
    1) you use full scans, hash joins or at least merge joins
    2) you scan your source data as less as possible. In the best case each necessary table only once (for example not using exists clause to effectively scan all table via index scan).
    3) how much time you are spending on sorts and hash joins (either from v$session_longops directly or some tool that visualises this info). If you are using workarea_size_policy = auto, probably you can switch to manual for this particular select and adjust sort_area_size and hash_area_size big enough to do as less as possible sorts on disk
    4) if you have enough free resources i.e. big box probably you can consider using some parallelism
    5) if your full scans are taking big time check what is your db_file_multiblock_read_count, probably increasing it for this select will give some gain.
    6) run trace and check on what are you waiting for
    7) most probably your problem is IO bound so probably you can do something from OS side to make IO faster
    8) if your query now is optimized as much as you can, disks are running as mad and you are using all RAM then probably it is the most you can get out of your box :)
    9) if nothing helps then you can start thinking about precalculations either using your idea about derived column or some materialized views.
    10) I hope you have a test box and at least point (9) do firstly on it and see whether it helps.
    Gints Plivna
    http://www.gplivna.eu

  • Performance of view wwsbr_all_folders very bad when user is public

    I have some routines that build navigation components based upon selects from the view
    wwsbr_all_folders
    They work great after a user is logged in, but if the user is public, the performance is extremely slow. It is so slow that the page often times out and it affects other users on the site.
    Is there a way to improve the performance of this view for public access?

    I was able to cut the time a select takes for public to 1/3 of what wwsbr_all_folders by doing the following:
    create or replace function return_1_not_logged_on return number
    is
    retval number(1) := 1;
    begin
    if wwctx_api.is_logged_on then
    retval := 0;
    end if;
    return retval;
    end;
    and add the following line to the where clause of wwsbr_all_folders (I actually created another view, pg_v);
    AND c.ispublic = decode(return_1_not_logged_on, 1, 1, c.ispublic)
    -this is not a perfect answer, but it won't give access to pages that are public due to inheritance, only due to the checkbox on the page itself.
    Still it has now gone from about 9 seconds to about 3 seconds for a public user, but a logged in user takes virtually no time (set timing on displays Elapsed: 00:00:00.00);
    So, digging a little deeper, I see that wwsbr_all_folders is based on WWV_USER_CORNERS which is a view 2 pages long and has three unions, plus multiple calls to security packages.
    Portal must do something else as it decides whether to display a page to a public user. Does anyone know what that might be?

  • Performance ora:view and collection()

    ora:view allows an XML structured table to be used in a XQuery "for" clause, while collection processes a set of documents in a directory. Normally these are two different sets of data.
    However, with XDB I can have a WEBDAV directory which can consist of documents, all of which are stored in schema based structured storage.
    Given this situation, where the ora:view and the collection() happen to be the exact same set of data (and this condition may be a rare corner case for many people), is there a performance difference between these two methods of access?
    The underlying question I am wondering is whether collection() will be rewritten to take advantage of any indexing on the structured data, in this sitution.
    A collection() directory can consist of XML in both structured and unstructured storage, in this case does the query reduce everything to the lowest common denominator (CLOB), or are any of the advantages of structured storage utilized?
    Thanks,
    Howard

    Howard,
    That's a good question. You should use ora:view() instead of collection(). Using ora:view() will give you better performance. Please contact me directly (geoff dot lee at oracle dot com) to discuss further.
    Regards,
    Geoff

  • Performance Of  Views

    Hi Guys,
    I have a view which is made for four different Views ,
    Now The Problem is Its Taking lot of time to Run as the sub Views are having Lot of conditions and joins.
    What are the Options I have except making Mview of the same to increase performance of the Main View .
    -Manish

    Hi Manish,
    1) you don't "use nested joins" in a query. you do joins, and then let the optimizer decide whether they are going to be implemented as nested loops, hash joins or merge joins
    2) NL don't cost anything -- i.e. their cost is simply the cost of acquiring the two row sources. You don't reduce the cost of a nested loop -- you reduce the cost of the access paths for NL row sources, and you make sure that NL is appropriate join method in this situation
    3) better yet -- just make sure that stats are accurate, and the optimizer will choose the optimal plan for you. If this doesn't work, post a tuning request in a separate thread (read FAQ carefully before doing that)
    Best regards,
    Nikolay

  • Performance regarding view

    hi,
    i have a view named CREATE OR REPLACE VIEW TAX_AMT_VIEW
    (PTIN_NO, AMOUNT)
    AS
    select I_ASMTNO PTIN_NO,
    (D_CRNPT+D_CRNED+D_CRNLCS+D_CRNUAUTHCNSTPLTY+D_ARRPT+D_ARRED+D_ARRLCS
    D_ARRUAUTHCNSTPLTYD_PLTYONARR+D_ADVAMT) AMOUNT
    from DMA12.PT_ASMTRCPT_TBL;
    i am retrewing data from this view from another view CREATE OR REPLACE VIEW TAX_COLLECTION_OTHER
    (CIRCLE_NO, AMT_LKS, TOTAL)
    AS
    SELECT SUM(B.AMOUNT)/100000 AMT_LKS,count(b.ptin_no) TOTAL FROM dma12.PT_RECEIPT_TBL B,dma12.PT_ASSE_PTIN_NOINFORMATION A,
    A.PTIN_NO=B.PTIN_NO
    how can i make my view faster.
    i can i do the summation faster
    can any one suggest me
    regards,
    kishore

    alter system set __fast=true scope=spfile
    or
    read the performance tuning manual for your version
    In absence of any relevant information like
    version
    result of dbms_xplan.display
    which optimizer being used
    which columns are indexed
    do you use system stats,
    what did you try
    etc, etc, etc
    Question: if you don't want to share any information, yet are asking about a specific statement, why do you request help?
    Do you expect people here are clairvoyant?
    Sybrand Bakker
    Senior Oracle DBA

  • Performance of View

    Hi,
    I have created a complex view A with user defined function as column. Then created another view B by selecting from the previous view.
    Now when I query the view B the perfornance well but when I use order by clause in the query then the performance become very poor. It takes very long time to execute.
    Please help me to improve the performance.
    Best Regards,

    no explain plan/trace/tkprof??
    best guess: increase sort_area_size for your session.
    Only a guess based on very limited information.

  • JSF 2.0 Performance - Build View on postback

    Hi,
    we are currently looking at JSF 2.0 and it seems as if on every postback a buildView is executed instead of a restoreView, as it was the case with JSF 1.2. This unfortunately seems to have quite an impact on performance in regards to memory consumption and runtime. Is there a way to get back to the "old" JSF 1.2 behavior by setting a flag or something similar? Until now, we could not find such an option.
    Thanks and regards,
    Michael

    Set the javax.faces.PARTIAL_STATE_SAVING context init parameter to false.

  • Bad performance: Xpath View causes database server almost 100% cpu

    Hi there,
    Since I am rather inexperienced in using the Oracle XML DB I wonder If I am doing wrong with the following:
    I created a table with a xmltype column in it:
    CREATE TABLE LPD_LOAD_XML
    FILENAME VARCHAR2(50 BYTE) NOT NULL,
    XML_CONTENT SYS.XMLTYPE,
    DATE_CREATED DATE DEFAULT sysdate NOT NULL,
    CREATED_BY VARCHAR2(30 BYTE) DEFAULT user NOT NULL
    and I am using a xpath query to retrieve the data which is stored in the xmltype column:
    select extractvalue(value(p),'/medobj@barcode') barcode
    , extractvalue(value(p),'/medobj@VJ') vj
    , extractvalue(value(p),'/medobj@FNF') fnf
    , extractvalue(value(p),'/medobj@GLB') glb
    , cast ( multiset ( select extractvalue(value(q),'/author@cap') cap
    , extractvalue(value(q),'/author/name/addpre') addpre
    , extractvalue(value(q),'/author/name/fname') fname
    , extractvalue(value(q),'/author/name/prefix') prefix
    , extractvalue(value(q),'/author/name/lname') lname
    , extractvalue(value(q),'/author/name/addapp') addapp
    from TABLE(xmlsequence(EXTRACT(value(p),'medobj/author'))) q
    ) as authors_type_nst
    ) as authors_type
    , cursor(select extractvalue(value(q),'/corp.author') corp_author
    from TABLE(xmlsequence(EXTRACT(value(p),'medobj/corp.author'))) q
    , extractvalue(value(p),'/medobj/isbd/auti') auti
    , extractvalue(value(p),'/medobj/isbd/edition') edition
    , cursor(select extractvalue(value(q),'/impressum/pofpublication') pofpublication
    , extractvalue(value(q),'/impressum/publisher') publisher
    , extractvalue(value(q),'/impressum/pyr') pyr
    from TABLE(xmlsequence(EXTRACT(value(p),'medobj/isbd/impressum'))) q
    , extractvalue(value(p),'/medobj/isbd/collation/extent') extent
    , extractvalue(value(p),'/medobj/isbd/collation/illustration') illustration
    , extractvalue(value(p),'/medobj/isbd/collation/size') size_
    , extractvalue(value(p),'/medobj/isbd/collation/enclosure') enclosure
    , cursor(select extractvalue(value(q),'/series/series.title') series_title
    , extractvalue(value(q),'/series/series.nr') series_nr
    from TABLE(xmlsequence(EXTRACT(value(p),'medobj/isbd/series'))) q
    , extractvalue(value(p),'/medobj/isbd/part') part
    , extractvalue(value(p),'/medobj/isbd/annotation') annotation
    , extractvalue(value(p),'/medobj/isbdblock') isdbblock
    , extractvalue(value(p),'/medobj/isbn/t') isbn_t
    , extractvalue(value(p),'/medobj/isbn/d') isbn_d
    , extractvalue(value(p),'/medobj/isbn/uh') isbn_uh
    , cursor(select extractvalue(value(q),'/isbn2/t') isbn2_t
    , extractvalue(value(q),'/isbn2/d') isbn2_d
    , extractvalue(value(q),'/isbn2/uh') isbn2_uh
    from TABLE(xmlsequence(EXTRACT(value(p),'medobj/isbn2'))) q
    , cursor(select extractvalue(value(q),'/label') label
    from TABLE(xmlsequence(EXTRACT(value(p),'medobj/label'))) q
    , extractvalue(value(p),'/medobj/ppn') ppn
    , cursor(select extractvalue(value(q),'/note') note
    from TABLE(xmlsequence(EXTRACT(value(p),'medobj/note'))) q
    , extractvalue(value(p),'/medobj/sysreq') sysreq
    , extractvalue(value(p),'/medobj/mat') mat
    , extractvalue(value(p),'/medobj/lang.content') lang_content
    , cursor(select extractvalue(value(q),'/siso@type') siso_type
    , extractvalue(value(q),'/siso@rank') siso_rank
    , extractvalue(value(q),'/siso') siso
    from TABLE(xmlsequence(EXTRACT(value(p),'medobj/siso'))) q
    , cursor(select extractvalue(value(q),'/subject@rank') rank
    , extractvalue(value(q),'/subject') subject
    from TABLE(xmlsequence(EXTRACT(value(p),'medobj/subjectheading/subject'))) q
    , cursor(select extractvalue(value(q),'/genre/genre.full') genre_full
    , extractvalue(value(q),'/genre/genre.abbr') genre_abbr
    , extractvalue(value(q),'/genre/genre.cd') genre_cd
    from TABLE(xmlsequence(EXTRACT(value(p),'medobj/genre'))) q
    , extractvalue(value(p),'/medobj/agecat') agecat
    , extractvalue(value(p),'/medobj/readinglevel') readinglevel
    , extractvalue(value(p),'/medobj/avi') avi
    , extractvalue(value(p),'/medobj/review') review
    , extractvalue(value(p),'/medobj/reviewer') reviewer
    , cursor(select extractvalue(value(q),'/cover') cover
    from TABLE(xmlsequence(EXTRACT(value(p),'medobj/cover'))) q
    from lpd_load_xml i
    , TABLE(xmlsequence(EXTRACT(i.xml_content,'bmo/medobj'))) p
    where i.filename = b_FileName
    You can see that I am using both CAST MULTISET and a cursor, since I am finding out the best way. I have to use either one because the xml is stored in a hierarchical way. But now i am lost. What is most surprising to me is that the database server is really 100% dedicated in mastering this query. Is there anyway to avoid this? How can I retrieve the data in the xml file from within the database without causing a slow performance?
    Greets,
    William de Ronde

    Have you created indexes on the XMLtype Column? Either way, if i am not mistaken then your XMLType column will default to XMLType CLOB storage. This will cause that your XML data will be put completly into memory regarding the inbetween resultsets. Use dmbs_xplan procedure, autotrace on (in sqlplus) or tkprof tools to find out whats happening. Did you generate statistics on your table via DBMS_GATHER_STATS package (don't use the analyze statment) ?

  • Performance issue: View query is calculating a column value before filterin

    Hi,
    I have a view like this.(My view is more complex than this..I just tried to imitate the situation )
    Select emp_id, emp_name, calculate_salary(emp_id) salary
      From employees
    Where nvl(department, '@@##$$') = nvl(get_global.department, '@@##$$')When I execute the below query
    select emp_name from my_view where salary=10000 by setting a value to get_globals.department I found that it first calls the calculate_salary instead of applying the filter for departments. By somehow the cost base analyzer thinks that calling the function is cheaper than applying the filter. I wonder whether there is way to direct the cba and say to first apply the filters before calculating column values.
    Any suggestions ?
    Thanks

    I don't think it's possible.
    Before a WHERE clause can be applied the data has to be collected for the row so Oracle, I would imagine, isn't going to differentiate between what is a database column and a function, fetch just the columns, do the filtering and then go back to calculate the rest of the columns; it's just going to get all the columns, including the calculated ones, and then apply the filters.
    The only option would be to do...
    select emp_id, emp_name, calculate_salary(emp_id) salary
    from (select emp_id, emp_name
          from employees
          where nvl(deparment, '@@##$$') = nvl(get_global.department, '@@##$$')
          )as your view

  • MD5 and RSA - Slow performance  - Help / Views Required

    Hi,
    I am facing a problem while signing a message.The
    scenario is:
    I have to create 20,000 messages to be sent to
    clients. I am encrypting the message using MD5 and
    RSA.
    But when i am encrypting via RSA it takes about 20
    mins to encrypt the 20k messages.I dont know why its
    taking so much time. I have max 4-5 mins to manipulate
    and send messages. The sample code is as follows:
    ur earliest help will be quite helpful.
    Thanks in advance
    Hassan
    ************** Source Code ****************
    import java.io.IOException;
    import java.math.BigInteger;
    import java.security.KeyFactory;
    import java.security.MessageDigest;
    import java.security.Signature;
    import java.security.PrivateKey;
    import java.security.spec.RSAPrivateKeySpec;
    import org.apache.log4j.Logger;
    public class Signer {
    ******************************************

    Hi Sabre,
    I have compiled the simple code from JCE tutorial for DES. The output text it is showing is different than input text.
    Is there any problem going on in tutorial's example ?
    Regards
    Hamid
    ******** output **************
    the original cleartext is: [B@13a328f
    the encrypted text is: [B@337838
    the final cleartext is: [B@119cca4
    ******** Code ************
    public class jCypher {
    private static Cipher desCipher = null;
    public static void main (String[] args) throws NoSuchAlgorithmException,
    InvalidKeyException, IllegalBlockSizeException, NoSuchProviderException,
    BadPaddingException, NoSuchPaddingException, Exception
    //Creating a Key Generator and Generating a Key
    //public static KeyGenerator getInstance(String algorithm);
    KeyGenerator keygen = KeyGenerator.getInstance("DES");
    SecretKey desKey = keygen.generateKey();
    // Creating a Cipher
    // Cipher.getInstance(Transformation);     
    // c1 = Cipher.getInstance("RSA/ECB/PKCS1Padding");     
    desCipher = Cipher.getInstance("DES/ECB/PKCS5Padding");
    // Cipher.init(int opmode, Key key);
    desCipher.init(Cipher.ENCRYPT_MODE, desKey );
    // Cleartext
    byte[] cleartext = "This is small Text for testing".getBytes();
    System.out.println("the original cleartext is: " + cleartext.toString());
    // Encrypt the cleartext
    // encrypted or decrypted data in one step (single-part operation)
    // public byte[] doFinal(byte[] input);
    byte[] ciphertext = desCipher.doFinal(cleartext);
    System.out.println("the encrypted text is: " + ciphertext.toString());
    // Initialize the same cipher for decryption
    desCipher.init(Cipher.DECRYPT_MODE, desKey );
    // Decrypt the ciphertext
    byte[] cleartext1 = desCipher.doFinal(ciphertext);
    System.out.println("the final cleartext is: " + cleartext1.toString());
    } // End main()
    }

  • Implementing the performance reporter & viewer tools in EP 6.0 SP11

    Hi Friends
    I'm trying to implement OSS note 766598 for better analysis of the java monitoring data for EP 6.0 on WAS 6.40, the note mentions about downloading & deploying the j2ee application attached in the note, though it doesn't specifies which is the file to be deployed, as part of the attachment I downloaded 2 files pviewer.war & pvpconverter.zip, can somebody who has implemented the Perfreporter & the Perfviewer advice which is the file that needs to be deployed?.Is it one of these 2 files or some another file. FYI I tried deploying the 'pviewer.war' but the visual admin gives an error saying that "cannot convert ear file".
    FYI I've completed the part wherein I added the relevant code in the autorun.scr file which created the /usr/sap/EPD/JC00/j2ee/cluster/MonitoringData folder with the scv files, now I've to complete the remaining portion of deploying the application & generating the html template.
    Thanks & Rgds,
    Abhishek

    Hi
    I solved the problem after deploying the pviewer.zip file.
    Rgds,
    Abhishek

  • Smart View Error

    I’m struggling to change grid retrieves, which is a new post Fusion problem. If I copy and paste a different account line onto the grid I get this message that reads -
    "Excel sheet has modified data cells. Do you want to submit the modified data cells before proceeding?"
    If I click yes then it takes 5 minutes of thinking before I get this message:
    "Cannot perform cube view operation. OLAP error (1020043): You do not have sufficient access to perform a lock on this database"
    And then when I refresh the grid it reverts to the original account line names.
    If I select no then the account lines revert to the original i.e. the paste doesn’t work.
    The only way I can get it to stop doing this is to disconnect from the application and close and re-open the file. And even this doesn’t work all the time. Please help! I hate to say it, but the problem seems to occur randomly...
    Regards
    Abhi

    Hi,
    Open Options in your excel spreadsheet, and in the Display tab, select "Use Excel Formatting" and "Preserve Formula on POV change"
    Restart excel and check if the problem goes away.
    Cheers
    RS

  • How to speed up the performance in Oracle APEX - Classical Report loading

    Hi,
    I am using APEX 4.2, DB 11.2.
    I have created 2 reports in the page and the time that is taken to load this page is very huge.
    To speed up the performance materialized views were used on queries, but still the performance is the same.
    checked the app in DEBUG mode, the following event takes a lot of time to execute:
    0.08415 4.76698 rows loop: 15 row(s) the query onky takes very less time to execute
    0.08184 0.00181

    ghini wrote:
    Hi,
    I am using APEX 4.2, DB 11.2.
    I have created 2 reports in the page and the time that is taken to load this page is very huge.
    To speed up the performance materialized views were used on queries, but still the performance is the same.
    checked the app in DEBUG mode, the following event takes a lot of time to execute:
    0.08415 4.76698 rows loop: 15 row(s) the query onky takes very less time to execute
    0.08184 0.00181
    Check query performance very carefully. If you execute the SQL more than once in a short amount of time the data will be in memory and accessed more quickly. It is possible that your fast response time was against cached data and therefore faster. If this is the case further tuning the SQL (the MV query) may help.
    It is also possible the slowness is due to other factors - network, firewall, antivirus software, etc. I am running Apex on my laptop using the embedded pl/sql gateway and due to antivirus and security software it can take pages 30 seconds or more to load.

Maybe you are looking for