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

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

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

  • 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) ?

  • Regarding View Size Inside Tab Strip

    Hi All,
    I'm having a Tabstrip with 2 tabs. Inside which i'm having ViewContainerElememt on each tab. On Each View I'm having one dropdown & a table .
    In the first Tab i'm also having a Text View.If there is no values in the dropdown then that text view ll be displayed and not the Table . If there is values in the drop down then the table ll dispaly & not the Text view.
    Wat happens is,if there is value in the Dropdown then the table is getting displayed & the view is displaying in Full screen. If there is no value then the Textview is displaying.At that time the View Size is Reducing to Half.
    How to fix the ViewContainer Element inside that Tab ?
    I tried with giving Width as 100%  but still it is not coming.
    Helpful Answers ll be Rewarded.
    Regards,
    Padmam.

    Hi Padman
    Set the height property of tabstrip control to some fixed value.i.e 800px or whatever you want. it will fix the height of each tab.
    Regards
    Naresh

  • Regarding View

    Hi,
    Would be happy if some one clarifies the below doubt.
    Oracle version : 10g
    1. I have created a complex view ( say it would return 10million records).
    2. This view contains some structures like inline view in it ( so i suppose
    in the explain plan it may not be broken down to the base tables)
    2. I am using that view in a select statment as below
    select * from ( thisview)
    where thisview.empno =12
    and ..... (some more condition)
    In this scenario my doubt is that would this be fetching all the records and filter
    it using the conditions specified in the select statement?
    Please let us know if some can help me regarding this.
    Regards,

    Hi,
    The best way is to run the explain plan and see what it does.
    Where condition will be applied on base table. See the below example:
    SQL> select * from employees
      2  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("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>
    SQL> ed
    Wrote file afiedt.buf
      1* create view emp_view as select * from employees
    SQL> /
    View created.
    SQL> set autotrace traceonly
    SQL> select * from emp_view
      2  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("FIRST_NAME"='XXX')
    Statistics
             15  recursive calls
              0  db block gets
              5  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>Regards,
    Avinash

  • Regarding views in plannning

    hi
    any body help me on hyperion build views for automation of dimension building using HAL to plannning application.data source is SQL server.how to create views for account, utility,product,customer dimensions.
    Thanks
    subbu.

    Hi ACP,
    You can check it in table MARC/MARA. Field PSTAT. This gives the views created.
    The overall maintenance status is made up of the individual maintenance
    statuses. The individual maintenance statuses have the following
    meaning:
    User department Maintenance status
    Work scheduling A
    Accounting B
    Classification C
    MRP D
    Purchasing E
    Production resources/tools F
    Costing G
    Basic data K
    Storage L
    Forecasting P
    Quality management Q
    Warehouse management S
    Sales V
    Plant stocks X
    Storage location stocks Z
    kindly test your requirement with the Tcode MM50.
    it will be surely helpful.
    Let me kow the feedback.
    Regards,
    R.Brahmankar

  • Regarding views

    Hi all,
    I want some material on all the types of views like database views projection view, help view, maintenance view. how to create them and how to use them in programs.
    Thanks & Regards,
    Saroja.

    hi,
    Database View (SE11)
    Database views are implement an inner join, that is,
    only records of the primary table (selected via the join operation)
    for which the corresponding records of the secondary tables also exist are fetched.
    Inconsistencies between primary and secondary table could, therefore, lead to a reduced selection set.
    In database views, the join conditions can be formulated using equality relationships between any base fields.
    In the other types of view, they must be taken from existing foreign keys.
    That is, tables can only be collected in a maintenance or help view if they are linked to one another via foreign keys.
    - Help View ( SE54)
    Help views are used to output additional information when the online help system is called.
    When the F4 button is pressed for a screen field, a check is first made on whether a matchcode is defined for this field.
    If this is not the case, the help view is displayed in which the check table of the field is the primary table.
    Thus, for each table no more than one help view can be created,
    that is, a table can only be primary table in at most one help view.
    - Projection View
    Projection views are used to suppress or mask certain fields in a table (projection), thus minimizing the number of interfaces. This means that only the data that is actually required is exchanged when the database is accessed.
    A projection view can draw upon only one table. Selection conditions cannot be specified for projection views.
    - Maintenance View ( SE54 )
    Maintenance views enable a business-oriented approach to looking at data,
    while at the same time, making it possible to maintain the data involved.
    Data from several tables can be summarized in a maintenance view and maintained collectively via this view.
    That is, the data is entered via the view and then distributed to the underlying tables by the system.
    Creating Database View:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ed06446011d189700000e8322d00/content.htm
    Creating Projection View:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ecc5446011d189700000e8322d00/frameset.htm
    Creating Help View:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ecd2446011d189700000e8322d00/frameset.htm
    Creating maintenance View:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ecdf446011d189700000e8322d00/frameset.htm
    Re: what are the various views?
    http://help.sap.com/saphelp_webas620/helpdata/en/cf/21ec5d446011d189700000e8322d00/content.htm
    Regards
    Reshma

  • Regarding Views Generation

    Hi i am doing standard Program modification with respect to OSS notes given by SAP.
    in that they have given
    The folllowing views should be generated after the DDIC changes.
    J_1IVTXRAT for table J_1IEXCTAX
    J_1IEXCDEF for table J_1IEXCDEF
    J_1IEXCACC for table J_1IEXCACC
    how we can proceed with this.
    what is the view generation?
    please help me.
    thanks in advance.

    Hi,
    Whenever you create Table maintenance generator from SE11 -> utilities-> table maintenance generator , a View will be created which allows you to enter the Values from SM30 Transaction.
    So in this case also you are asked to generate the table maintenance for the 3 tables which in turns create the 3 views corresponding to the tables
    J_1IEXCTAX
    J_1IEXCDEF
    J_1IEXCACC
    Views for them are
    J_1IVTXRAT
    J_1IEXCDEF
    J_1IEXCACC
    Table maintenance creation steps:
    table maintanance Generator is used to manually
    input values using transaction sm30
    follow below steps
    1) go to se11 check table maintanance check box under
    attributes tab
    2) utilities-table maintanance Generator->
    create function group and assign it under
    function group input box.
    also assign authorization group default &NC& .
    3)
    select standard recording routine radio in table
    table mainitainence generator to move table
    contents to quality and production by assigning
    it to request.
    4) select maintaience type as single step.
    5) maintainence screen as system generated numbers
    this dialog box appears when you click on create
    button
    6) save and activate table
    reward points if useful
    regards,
    Anji

Maybe you are looking for

  • How can I move itunes/iphoto library from SSD to HD on my new imac?

    I have a lovely new imac with the SSD option. My old comps' boot disk was migrated to the SSD because it is the boot disk for the new computer. This is great and speedy but now I'd like to move my huge itunes and iphoto libraries from the SSD to the

  • Airport extreme icon not showing up in my devices

    the whole thing was working just fine last week .i dont really want to restart it all from scrach .my wireless internet is working fine being routed through it but when i look in my hard drive and under devices i cant make the icon show up along with

  • Message Splitting Design Problem

    Hi guys, I am an XI newbie so please bear with me. I have to build an XI interface to update existing service orders in CRM.  The data is coming from a file, which contains change requests for multiple orders (and possibly multiple requests for the s

  • Seeburger AS2 Adapter

    Hi, I need few information how to implement seeburger adapter(Using AS2 or FTP) with XI. I have a requirement to convert the EDI Ansi X12 messages from a EDI system and post it into a R/3 system using XI. The client system(EDI system) is in US has VA

  • Insert/append taking way too long

    Hello, I am trying to load the data from DB1 to DB2 via db-link, structure is as DB#1 My_table col1 c0l2 c0l3 col4 col15 DB#2 DB2_My_table col1 c0l2 c0l3 col4 col15 Index on col1 ,col3,col5Structure is same I have created a synonym MY_TABLE on DB#2 f