Performance problem using on change

Hi abapers,
i am using ON CHANGE OF...END ON,,, AT END OF statements in My program.
will this statements effect on performance.
if so , is there any alternative?
please help .

Hi Ramesh,
   I don't know what are the performance implications with this statement, but SAP says that it is an Obsolete control structure.
You cannot use them in class contexts.(This statement is forbidden in classes).
More over, SAP Hep also says that,
<b>"For each time the statement ON CHANGE OF is executed, the content of all the specified data objects is saved as an auxiliary variable internally in the global system. The auxiliary variable is linked to this statement and cannot be accessed in the program. The auxiliary variables and their contents are retained longer than the lifetime of procedures. An auxiliary variable of this type can only be initialized if its statement ON CHANGE OF is executed while the associated data object is initial. "</b>
Regards,
Ravi Kanth

Similar Messages

  • Performance problem using OBJECT tag

    I have a performance problem using the java plugin and was wondering if anyone else was has seen the same thing. I have a rather complex applet that interacts with java script in a web page using the LiveConnect API. The applet both calls javascript in the page and is called by java script.
    Im using IE6 with the java plugin that ships with the 1.4.2_06 JVM. I have noticed that if I deploy the applet using the OBJECT tags, the application seems the trash everytime I call a java method on the applet from javascript. When I deplot the same applet using the APPLET tag the perfomance is much better. I would like to use the OBJECT tag because it applet bahaves better and I have more control over the caching.
    This problem seems to be on the boundaries of IE6, JScript, the JVM and my Applet (and I suppose any could be the real culprit). My application is IE5+ specific so I can not test the applet in isolation from the surround HTML/JavaScript (for example in another browser).
    Does anyone have any idea?
    thanks in advance.
    dennis.

    I have a performance problem using the java plugin and was wondering if anyone else was has seen the same thing. I have a rather complex applet that interacts with java script in a web page using the LiveConnect API. The applet both calls javascript in the page and is called by java script.
    Im using IE6 with the java plugin that ships with the 1.4.2_06 JVM. I have noticed that if I deploy the applet using the OBJECT tags, the application seems the trash everytime I call a java method on the applet from javascript. When I deplot the same applet using the APPLET tag the perfomance is much better. I would like to use the OBJECT tag because it applet bahaves better and I have more control over the caching.
    This problem seems to be on the boundaries of IE6, JScript, the JVM and my Applet (and I suppose any could be the real culprit). My application is IE5+ specific so I can not test the applet in isolation from the surround HTML/JavaScript (for example in another browser).
    Does anyone have any idea?
    thanks in advance.
    dennis.

  • (new?) performance problem using jDriver after a Sql Server 6.5 to 2000 conversion

    Hi,
    This is similar - yet different - to a few of the old postings about performance
    problems with using jdbc drivers against Sql Server 7 & 2000.
    Here's the situation:
    I am running a standalone java application on a Solaris box using BEA's jdbc driver
    to connect to a Sql Server database on another network. The application retrieves
    data from the database through joins on several tables for approximately 40,000
    unique ids. It then processes all of this data and produces a file. We tuned
    the app so that the execution time for a single run through the application was
    24 minutes running against Sql Server 6.5 with BEA's jdbc driver. After performing
    a DBMS conversion to upgrade it to Sql Server 2000 I switched the jDriver to the
    Sql Server 2000 version. I ran the app and got an alarming execution time of
    5hrs 32 min. After some research, I found the problem with unicode and nvarchar/varchar
    and set the "useVarChars" property to "true" on the driver. The execution time
    for a single run through the application is now 56 minutes.
    56 minutes compared to 5 1/2 hrs is an amazing improvement. However, it is still
    over twice the execution time that I was seeing against the 6.5 database. Theoretically,
    I should be able to switch out my jdbc driver and the DBMS conversion should be
    invisible to my application. That would also mean that I should be seeing the
    same execution times with both versions of the DBMS. Has anybody else seen a
    simlar situation? Are there any other settings or fixes that I can put into place
    to get my performance back down to what I was seeing with 6.5? I would rather
    not have to go through and perform another round of performance tuning after having
    already done this when the app was originally built.
    thanks,
    mike

    Mike wrote:
    Joe,
    This was actually my next step. I replaced the BEA driver with
    the MS driver and let it run through with out making any
    configuration changes, just to see what happened. I got an
    execution time of about 7 1/2 hrs (which was shocking). So,
    (comparing apples to apples) while leaving the default unicode
    property on, BEA ran faster than MS, 5 1/2 hrs to 7 1/2 hrs.
    I then set the 'SendStringParametersAsUnicode' to 'false' on the
    MS driver and ran another test. This time the application
    executed in just over 24 minutes. The actual runtime was 24 min
    16 sec, which is still ever so slightly above the actual runtime
    against SS 6.5 which was 23 min 35 sec, but is twice as fast as the
    56 minutes that BEA's driver was giving me.
    I think that this is very interesting. I checked to make sure that
    there were no outside factors that may have been influencing the
    runtimes in either case, and there were none. Just to make sure,
    I ran each driver again and got the same results. It sounds like
    there are no known issues regarding this?
    We have people looking into things on the DBMS side and I'm still
    looking into things on my end, but so far none of us have found
    anything. We'd like to continue using BEA's driver for the
    support and the fact that we use Weblogic Server for all of our
    online applications, but this new data might mean that I have to
    switch drivers for this particular application.Thanks. No, there is no known issue, and if you put a packet sniffer
    between the client and DBMS, you will probably not see any appreciable
    difference in the content of the SQL sent be either driver. My suspicion is
    that it involves the historical backward compatibility built in to the DBMS.
    It must still handle several iterations of older applications, speaking obsolete
    versions of the DBMS protocol, and expecting different DBMS behavior!
    Our driver presents itself as a SQL7-level application, and may well be treated
    differently than a newer one. This may include different query processing.
    Because our driver is deprecated, it is unlikely that it will be changed in
    future. We will certainly support you using the MS driver, and if you look
    in the MS JDBC newsgroup, you'll see more answers from BEA folks than
    from MS people!
    Joe
    >
    >
    Mike
    The next test you should do, to isolate the issue, is to try another
    JDBC driver.
    MS provides a type-4 driver now, for free. If it is significantly faster,
    it would be
    interesting. However, it would still not isolate the problem, because
    we still would
    need to know what query plan is created by the DBMS, and why.
    Joe Weinstein at BEA
    PS: I can only tell you that our driver has not changed in it's semantic
    function.
    It essentially send SQL to the DBMS. It doesn't alter it.

  • Anyone have a problem using iPhoto "change date of photo" function?

    I imported some old photos today and need to sent the time on them. I selected the photos and used the "Change date of photo" function. It worked fine on the first set. I tried adjust a second set and that's where problem began. I needed to change the date from 01-01-2002 to the correct date of 05-28-2004. I photo instead set the date to somewhere in 1989. I thought I must have typed the date wrong. So I selected the photos and tried again. Nope, it wasn't me. The date on the photos was set back to some time in 1983. I tried several more time... Well, lets just say I have photos dated in the 1700's..

    I had searched the forum and could not find anything. Maybe someone knows where is is.
    I fixed the photos the "brute force" way.
    I deleted them from the library.
    Changed the date on the files on a different computer and imported them again.
    However this seam like a crap way to fix a iPhoto issue.
    I hope that I don't need to fix the time on any more photos..
    Clarence.

  • Performance problem using multi-thread

    I am using berkeley db to store a int/double pair, and i randomly get 100,0000 results to check the performance . Using 1 thread, it cost about 1 Mins. But using 4 threads, it costs 4 Mins. More threads, lower performance. Is there Anyone know the reason?
    Env flags:
    envFlags=DB_CREATE | DB_INIT_MPOOL | DB_THREAD | DB_PRIVATE|DB_INIT_CDB;
    DB open flags: DB_THREAD
    and i use db->get method to get results.

    Berkeley DB 4.8 will be released soon and has features that address CMP/SMP scalability. We would appreciate your feedback on your experiences with it. Once available, please test it and post your results here, I'm sure you'll be pleasently surprised.
    regards,
    -greg

  • Strange Corba performance problem using java 1.6

    I have a java server talking to java and C++ clients using CORBA and moved from java 1.4.2 to 1.6.
    Using java 1.4.2 for a large block of data, the client consistently refreshes in about 28-32 seconds.
    Using Java 1.6 the times vary between 19 and 135 seconds.
    After restarting the server all clients consistently take a simlar amount of time (usually between 32-35 seconds). But sometimes when the server is started the clients see a time between 19-25 seconds, sometimes between 50-55 seconds, and very occassionally over we see times of over 100 seconds.
    Once started, the server seems to pick up some setting or behaviour that causes it to run at a fairly fixed rate.
    We have tried adjusting the GIOP fragment and block size, which can change the performance, but no mater what size we use, we still see this strange behaviour where the server sometime runs in "fast" mode and sometimes in "slow" mode.
    The server side cpu usage is higher when it is in "fast" mode. Client side cpu is higher in slow mode. Amount of data transfered does not appear to change.
    Server runing on Linux RedHat Ent 4u5 - client Linux RedHat 9, RedHat Ent 4u5.
    I see a similar behaviour even when I run the client and server on the same machine.
    Any thoughts on where I should look next anyone?
    Write a simple corba server/client that shows the problem.
    Investigate Other Corba networking settings
    measure the client server packet size and performance.
    Thanks

    3 forums is not enough to post this in, I mean, it is such a HUGE problem,
    you should post it in at least another 20 forums.

  • Mapviewer performance problem using image format FORMAT_RAW_COMPRESSED

    I am using the MapViewer.FORMAT_RAW_COMPRESSED map image in my (java) map application because some features must be clickable and as far as I can work out, this is the only way to achieve this in a Java client. On my local system, running the map server in an oc4j container, this works about as fast as using FORMAT_GIF_URL and loading the image from this url. There also doesn't seem to be much difference in memory and cpu usage.
    When I direct the request to a map server running on a remote Application Server the rendering time grows exponentially. The same maprequest using FORMAT_GIF_URL runs as fast as it does in my local OC4J container. The problem seems to be in "packing time" in RealWorker:
    Remote AS:
    Thu Jun 30 13:59:34 CEST 2005 DEBUG [oracle.lbs.mapserver.core.MapperPool] freeMapper() begins...
    Thu Jun 30 13:59:34 CEST 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] preparation time: 99ms
    Thu Jun 30 13:59:34 CEST 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] querying/rendering time: 5560ms
    Thu Jun 30 13:59:34 CEST 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] packing time: 142605ms
    Thu Jun 30 13:59:34 CEST 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] --------------- total time: 148264ms
    Local OC4J:
    Thu Jun 30 15:34:42 CEST 2005 DEBUG [oracle.lbs.mapserver.core.MapperPool] freeMapper() begins...
    Thu Jun 30 15:34:42 CEST 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] preparation time: 540ms
    Thu Jun 30 15:34:42 CEST 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] querying/rendering time: 2490ms
    Thu Jun 30 15:34:42 CEST 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] packing time: 120ms
    Thu Jun 30 15:34:42 CEST 2005 DEBUG [oracle.lbs.mapserver.core.RealWorker] [RealWorker] --------------- total time: 3150
    The test server is smaller than my local system and more applications are running on the AS, generating the map takes all the available memory and cpu, but the difference between the time it takes generating a GIF image and generating a Java image of almost a factor 50 is puzzling.
    What could cause this enormous difference? Any idea's about how we can analyze or solve this? What could RealWorker be doing in this packing time? Any hints would be greatly appreciated.
    Many thanks,
    Ida

    Thanks for the replies!
    1. Which AS version are you using? -> 10.1.2
    2. Just as a test, if you restart AS (if possible) do you still get the same values? -> yes, we restarted the AS and the results are the same.
    The server is indeed running low in memory. It is a 512MB machine, just big enough to run the AS. The production server will have some more, but not very much. Could I estimate how much extra memory it will need to keep a good performance when generating maps with live features? And maybe I'm wrong, but shouldn't the extra load for the java image only be on the client, since that's where the image is made? On the server it's just the image data, isn't it?
    I tried removing the basemap, but that reduces the loading time just with a few seconds. The live themes are jdbc themes and result in only some 20 to 30 geofeatures. Removing them from the request so only an empty image with a title is retrieved still takes about 117 seconds. Reducing the device size does reduce the loading time, so it does seem to have something to do with the amount of pixels in the image space, not with the data. Could it be that in the "packing" of the image something happens that takes a lot of memory, related to the amount of pixels?
    In my situation it would be handy if the live features were also returned when the image format is not set to FORMAT_RAW_COMPRESSED, it is also possible to draw shapes onto an existing image and this would bypass the memory problems.
    Thanks for any further help.
    Ida

  • Performance problems using BPM

    Hello all,
    We have Request/Reply interface using the JMS adapter towards the SAP R/3 system.
    So the interface has 3 steps :
    1. Request from JMS adapter - Asynchronous
    2. Request/Reply using RFC adapter towards the R/3 - sync
    3. Reply to JMS adapter - Asynchronous
    we are using the BPM to merge all those steps, but between step 1 to 2 it waits about 4 seconds (we can monitor the message at SM58 for 2-3 seconds).
    Its a problem for us because we exceed the time for the Request/reply at the MQ (which is connected to the JMS adapter).
    Does someone has any idea ?
    Regards,
    Yaki

    Hello again Michelle, Kjetil,
    We looked into this and given your details provided
    regarding the query executed and the fact that this
    problem shows up over thin network connections, we
    believe you may be hitting one/both of Bug 2658196
    and Bug 1844184.
    To summarise, regardless of whether you use version
    control or not, Designer must check version details
    for each repository object acted on.
    On a local machine or LAN, this does not present a
    problem, but on a WAN, this does, due the amount of
    (albeit individually small) packets of information
    sent backwards and forwards between the client and
    the repository.
    Unfortunately, Oracle Designer was never designed to
    run across a WAN. To attempt to get the performance
    required would involve a re-design and re-write of a
    large part of the Design Editor. I'm afraid this is
    not really a practical option.
    Other customers have also run into this problem. They
    have found that using a third party product, such as,
    Tarantella solves the problem. Products like Tarantella
    enable clients to use central installations of Designer
    with better results than using a locally installed copy.
    Please see Metalink (http://meatlink.oracle.com) for
    full details on the bugs themselves.
    Hope this helps.
    Regards,
    Dominic
    Designer Product Management
    Oracle Cor

  • Performance problems using WLS6.1 with the thin driver for Ora9i from OTN

    Hello everyone,
    Has anyone been experimenting with the thin driver for Oracle 9i under WLS6.1. I got it running, but
    I get extremely bad performance when having multiple concurrent accesses. It works more or less in
    single user mode. Also it seems not to support XA transactions?
    When could we expect the driver from BEA to be out?
    Thanks in advance!
    Samuel Kounev
    TU-Darmstadt, Germany

    I had done this from the very beginning, but I was still getting very bad performance under
    concurrent accesses. I even followed Sree's instructions and removed the old thin driver from
    weblogic.jar, but this didn't help. I am now trying to get the OCI driver for 9i running and hope
    this will solve the problem.
    Samuel
    Tamilselvan Ramasamy wrote:
    You have to use Oracle's Oracle 9i thin driver .
    put this driver infront of the classpath i.e before weblogic_sp.jar and
    weblogic.jar
    /selvan
    "Sree Bodapati" <[email protected]> wrote in message
    news:[email protected]..
    The BEA driver is available in WLS6.1SP2 which is GA.
    hth
    sree
    "Samuel Kounev" <[email protected]> wrote in message
    news:[email protected]..
    Hello everyone,
    Has anyone been experimenting with the thin driver for Oracle 9i under
    WLS6.1. I got it running, but
    I get extremely bad performance when having multiple concurrent accesses.
    It
    works more or less in
    single user mode. Also it seems not to support XA transactions?
    When could we expect the driver from BEA to be out?
    Thanks in advance!
    Samuel Kounev
    TU-Darmstadt, Germany

  • Many-to-many Performance Problem (Using FAQ Template)

    Having read "HOW TO: Post a SQL statement tuning request - template posting" I have gathered:
    I have included some background information at the bottom of the post
    The following SQL statement has been identified as performing poorly. It takes ~160 seconds to execute, but similar (shown below first statement) SQL statements executes in ~1 second.
    SQL taking 160 seconds:
    SELECT
    a.*
    FROM
    table_a a
    INNER JOIN table_a_b ab ON a.id = ab.media_fk
    WHERE
    ab.channel_fk IN (7, 1);SQL taking ~1 second or less
    ab.channel_fk IN (7);Or even:
    ab.channel_fk IN (6, 9, 170, 89);The purpose of the SQL is to return rows from table_a that are associated with table_b (not in SQL) through the junction table table_a_b.
    The version of the database is 10.2.0.4.0
    These are the parameters relevant to the optimizer:
    show parameter optimizer;
    NAME                                               TYPE        VALUE
    optimizer_dynamic_sampling                         integer     2
    optimizer_features_enable                          string      10.2.0.4
    optimizer_index_caching                            integer     0
    optimizer_index_cost_adj                           integer     100
    optimizer_mode                                     string      ALL_ROWS
    optimizer_secure_view_merging                      boolean     TRUE
    show parameter db_file_multi;
    NAME                                               TYPE        VALUE
    db_file_multiblock_read_count                      integer     16
    show parameter db_block_size;
    NAME                                               TYPE        VALUE
    db_file_multiblock_read_count                      integer     16
    select sname, pname, pval1, pval2 from sys.aux_stats$;
    SNAME                          PNAME                          PVAL1                  PVAL2
    SYSSTATS_INFO                  STATUS                                                COMPLETED
    SYSSTATS_INFO                  DSTART                                                07-18-2006 23:19
    SYSSTATS_INFO                  DSTOP                                                 07-25-2006 23:19
    SYSSTATS_INFO                  FLAGS                          0
    SYSSTATS_MAIN                  SREADTIM                       5.918
    SYSSTATS_MAIN                  MREADTIM                       7.889
    SYSSTATS_MAIN                  CPUSPEED                       1383
    SYSSTATS_MAIN                  MBRC                           8
    SYSSTATS_MAIN                  MAXTHR                         1457152
    SYSSTATS_MAIN                  SLAVETHR                       -1Here is the output of EXPLAIN PLAN:
    PLAN_TABLE_OUTPUT
    Plan hash value: 3781163428
    | Id  | Operation             | Name               | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT      |                    |  1352K|   771M|       | 60042   (3)| 00:05:56 |
    |*  1 |  HASH JOIN            |                    |  1352K|   771M|    27M| 60042   (3)| 00:05:56 |
    |*  2 |   INDEX FAST FULL SCAN| SYS_IOT_TOP_316310 |  1352K|    11M|       |  1816   (4)| 00:00:11 |
    |   3 |   TABLE ACCESS FULL   | TABLE_A            |  2190K|  1230M|       | 32357   (4)| 00:03:12 |
    Predicate Information (identified by operation id):
       1 - access(""AB"".""MEDIA_FK""=""A"".""ID"")
       2 - filter(""AB"".""CHANNEL_FK""=1 OR ""AB"".""CHANNEL_FK""=7)
    Note
       - 'PLAN_TABLE' is old versionFor reference, the EXPLAIN PLAN when using
    ab.channel_fk IN (6, 9, 170, 89);which executes in ~1 second is:
    PLAN_TABLE_OUTPUT
    Plan hash value: 794334170
    | Id  | Operation          | Name      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |           |   143K|    81M|       | 58982   (3)| 00:05:50 |
    |*  1 |  HASH JOIN         |           |   143K|    81M|  2952K| 58982   (3)| 00:05:50 |
    |   2 |   INLIST ITERATOR  |           |       |       |       |            |          |
    |*  3 |    INDEX RANGE SCAN| C_M_INDEX |   143K|  1262K|       |  1264   (1)| 00:00:08 |
    |   4 |   TABLE ACCESS FULL| TABLE_A   |  2190K|  1230M|       | 32357   (4)| 00:03:12 |
    Predicate Information (identified by operation id):
       1 - access(""AB"".""MEDIA_FK""=""A"".""ID"")
       3 - access(""AB"".""CHANNEL_FK""=6 OR ""AB"".""CHANNEL_FK""=9 OR
                  ""AB"".""CHANNEL_FK""=89 OR ""AB"".""CHANNEL_FK""=170)
    Note
       - 'PLAN_TABLE' is old versionHere is the output of SQL*Plus AUTOTRACE including the TIMING information:
    SQL> set autotrace traceonly arraysize 100;
    SQL> SELECT
      2  a.*
      3  FROM
      4  table_a a
      5  INNER JOIN table_a_b ab ON a.id = ab.media_fk
      6  WHERE
      7  ab.channel_fk IN (7, 1);
    1336148 rows selected.
    Execution Plan
    Plan hash value: 3781163428
    | Id  | Operation             | Name               | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT      |                    |  1352K|   771M|       | 60042   (3)| 00:05:56 |
    |*  1 |  HASH JOIN            |                    |  1352K|   771M|    27M| 60042   (3)| 00:05:56 |
    |*  2 |   INDEX FAST FULL SCAN| SYS_IOT_TOP_316310 |  1352K|    11M|       |  1816   (4)| 00:00:11 |
    |   3 |   TABLE ACCESS FULL   | TABLE_A            |  2190K|  1230M|       | 32357   (4)| 00:03:12 |
    Predicate Information (identified by operation id):
       1 - access("AB"."MEDIA_FK"="A"."ID")
       2 - filter("AB"."CHANNEL_FK"=1 OR "AB"."CHANNEL_FK"=7)
    Note
       - 'PLAN_TABLE' is old version
    Statistics
          10586  recursive calls
              0  db block gets
         200457  consistent gets
         408343  physical reads
              0  redo size
      498740848  bytes sent via SQL*Net to client
         147371  bytes received via SQL*Net from client
          13363  SQL*Net roundtrips to/from client
             49  sorts (memory)
              0  sorts (disk)
        1336148  rows processedThe TKPROF output for this statement looks like the following:
    TKPROF: Release 10.2.0.4.0 - Production on Mon Oct 1 12:23:21 2012
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Trace file: ..._ora_4896.trc
    Sort options: default
    count    = number of times OCI procedure was executed
    cpu      = cpu time in seconds executing
    elapsed  = elapsed time in seconds executing
    disk     = number of physical reads of buffers from disk
    query    = number of buffers gotten for consistent read
    current  = number of buffers gotten in current mode (usually for update)
    rows     = number of rows processed by the fetch or execute call
    ALTER SYSTEM SET TIMED_STATISTICS = TRUE
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.03          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.00       0.03          0          0          0           0
    Misses in library cache during parse: 0
    Parsing user id: 21
    SELECT
    a.*
    FROM
    table_a a
    INNER JOIN table_a_b ab ON a.id = ab.media_fk
    WHERE
    ab.channel_fk IN (7, 1)
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        2     27.23     163.57     179906     198394          0          16
    total        4     27.25     163.58     179906     198394          0          16
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 21
    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        2      0.01       0.00          0          0          0           0
    Execute      2      0.00       0.03          0          0          0           0
    Fetch        2     27.23     163.57     179906     198394          0          16
    total        6     27.25     163.62     179906     198394          0          16
    Misses in library cache during parse: 1
    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        0      0.00       0.00          0          0          0           0
    Execute      0      0.00       0.00          0          0          0           0
    Fetch        0      0.00       0.00          0          0          0           0
    total        0      0.00       0.00          0          0          0           0
    Misses in library cache during parse: 0
        2  user  SQL statements in session.
        0  internal SQL statements in session.
        2  SQL statements in session.
    Trace file: ..._ora_4896.trc
    Trace file compatibility: 10.01.00
    Sort options: default
           1  session in tracefile.
           2  user  SQL statements in trace file.
           0  internal SQL statements in trace file.
           2  SQL statements in trace file.
           2  unique SQL statements in trace file.
          46  lines in trace file.
         187  elapsed seconds in trace file.The DBMS_XPLAN.DISPLAY_CURSOR output:
    select * from table(dbms_xplan.display_cursor('474frsqbc1n4d', null, 'ALLSTATS LAST'));
    PLAN_TABLE_OUTPUT
    SQL_ID  474frsqbc1n4d, child number 0
    SELECT /*+ gather_plan_statistics */ c.* FROM table_a c INNER JOIN table_a_b ab ON c.id = ab.media_fk WHERE ab.channel_fk IN (7, 1)
    Plan hash value: 3781163428
    | Id  | Operation             | Name               | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  | Writes |  OMem |  1Mem | Used-Mem |
    |*  1 |  HASH JOIN            |                    |      1 |   1352K|   1050 |00:00:40.93 |     198K|    182K|    209K|    29M|  5266K| 3320K (1)|
    |*  2 |   INDEX FAST FULL SCAN| SYS_IOT_TOP_316310 |      1 |   1352K|   1336K|00:00:01.34 |   10874 |      0 |      0 |       |       |          |
    |   3 |   TABLE ACCESS FULL   | TABLE_A            |      1 |   2190K|   2267K|00:02:45.56 |     187K|    182K|      0 |       |       |          |
    Predicate Information (identified by operation id):
       1 - access(""AB"".""MEDIA_FK""=""C"".""ID"")
       2 - filter((""AB"".""CHANNEL_FK""=1 OR ""AB"".""CHANNEL_FK""=7))Thank you for reading I'm looking forward for suggestions how to improve the performance of this statement.
    h3. Backgroud
    Many years ago my company made the decision to store many-to-many relationships in our database using pipe delimited fields. An example field value:
    '|ABC|XYZ|VTR|DVD|'Each delimited value refers to a unique 'short code' in TABLE_B (There is also a true numeric foreign key in TABLE_B which is what I'm using in the junction table). We regularly search using these column with the following style SQL:
    WHERE
    INSTR(pipedcolumn, '|ABC|') > 0
    OR INSTR(pipedcolumn, '|XYZ|' > 0
    ...Appropriate indexes have been created over the years to make this process as fast a possible.
    We now have an opportunity to fix some of these design mistakes and implement junction tables to replace the piped field. Before this we decided to take a copy of a database from a customer with the largest record set and test. I created a new junction table:
    TABLE_A_B DDL:
        CREATE TABLE TABLE_A_B (
            media_fk NUMBER,
            channel_fk NUMBER,
            PRIMARY KEY (media_fk, channel_fk),
            FOREIGN KEY (media_fk) REFERENCES TABLE_A (ID),
            FOREIGN KEY (channel_fk) REFERENCES TABLE_B (ID)
        ) ORGANIZATION INDEX COMPRESS;
        CREATE INDEX C_M_INDEX ON TABLE_A_B (channel_fk, media_fk) COMPRESS;And parsing out a pipe delimited field, populated this new table.
    I then compared the performance of the following SQL:
    SELECT
    a.*
    FROM
    table_a a
    INNER JOIN table_a_b ab ON a.id = ab.media_fk
    WHERE
    ab.channel_fk IN (x, y, n); -- Can be Many Minutes
    --vs.
    SELECT
    a.*
    FROM
    table_a a
    WHERE
    INSTR(OWNERS,'|x|')    >0
    OR INSTR(OWNERS,'|y|')    >0
    OR INSTR(OWNERS,'|n|')    >0; -- About 1 second seemingly regardlessWhen x, y, n are values that occur less frequently in TABLE_A_B.CHANNEL_FK the performance is comparable. However once the frequency of x, y, n increases the performance suffers. Here is a summary of the CHANNEL_FK data in TABLE_A_B:
    --SQL For Summary Data
    SELECT channel_fk, count(channel_fk) FROM table_a_b GROUP BY channel_fk ORDER BY COUNT(channel_fk) DESC;
    CHANNEL_FK             COUNT(CHANNEL_FK)
    7                      780741
    1                      555407
    2                      422493
    3                      189493
    169                    144663
    9                      79457
    6                      53051
    171                    28401
    170                    19857
    49                     12603
    ...I've noticed that once I use any combination of values which occur more than about 800,000 times (i.e. IN (7, 1) = 780741 + 555407 = 1336148) then I get performance issues.
    I'm finding it very difficult to accept that the old pipe delimited fields are a better solution (ignoring everything other than this search criteria!).
    Thank you for reading this far. I truly look forward to suggestions on how to improve the performance of this statement.
    Edited by: user1950227 on Oct 1, 2012 12:06 PM
    Renamed link table in DDL.

    Possibly not, I followed the instructions as best as I could but may have missed things.
    h5. 1. DDL for all tables and indexes?
    h6. - TABLE_A_B is described above and has a total of 2,304,642 rows. TABLE_A and TABLE_B are described below.
    h5. 2. row counts for all tables?
    h6. - See below
    h5. 3. row counts for the predicates involved?
    h6. - Not sure what your asking for, I have a summary of data in TABLE_A_B above. Could you clarify please?
    h5. 4. Method and command used to collect stats on the tables and indexes?
    h6. - For the stats I collected above I have included the command used to collect the data. If you are asking for further data I am happy to provide it but need more information. Thanks.
    TABLE_A has 2,267,980 rows. The DLL that follows has been abbriviated, only the column involved is described.
    --  DDL for Table TABLE_A
      CREATE TABLE "NS"."TABLE_A"
       (     "ID" NUMBER
         --Lots more columns
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 106496 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "CUSTOMNAMESPACE" ;
    --  DDL for Index ID_PK
      CREATE UNIQUE INDEX "NS"."MI_PK" ON "NS"."TABLE_A" ("ID")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 16384 NEXT 29458432 MINEXTENTS 1 MAXEXTENTS 505
      PCTINCREASE 50 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "SYSTEM" ;
    --  Constraints for Table TABLE_A
      ALTER TABLE "NS"."TABLE_A" ADD CONSTRAINT "MI_PK" PRIMARY KEY ("ID")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 16384 NEXT 29458432 MINEXTENTS 1 MAXEXTENTS 505
      PCTINCREASE 50 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "SYSTEM"  ENABLE;
      ALTER TABLE "NS"."TABLE_A" MODIFY ("ID" NOT NULL ENABLE);TABLE_B has 22 rows. The DLL that follows has been abbriviated, only the column involved is described.
    --  DDL for Table TABLE_B
      CREATE TABLE "NS"."TABLE_B"
         "ID" NUMBER
      --Lots more columns
       ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
      STORAGE(INITIAL 106496 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "CUSTOMNAMESPACE" ;
    --  DDL for Index CID_PK
      CREATE UNIQUE INDEX "NS"."CID_PK" ON "NS"."TABLE_B" ("ID")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 16384 NEXT 16384 MINEXTENTS 1 MAXEXTENTS 505
      PCTINCREASE 50 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "SYSTEM" ;
    --  Constraints for Table TABLE_B
      ALTER TABLE "NS"."TABLE_B" ADD CONSTRAINT "CID_PK" PRIMARY KEY ("ID")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 16384 NEXT 16384 MINEXTENTS 1 MAXEXTENTS 505
      PCTINCREASE 50 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "SYSTEM"  ENABLE;
      ALTER TABLE "NS"."TABLE_B" MODIFY ("ID" NOT NULL ENABLE);Edited by: davebcast on Oct 1, 2012 8:51 PM
    Index name incorrect
    Edited by: davebcast on Oct 1, 2012 8:52 PM

  • Performance problem using distributed query

    Hi,
    Can anyone provide an explanation/solution to the following problem encountered on an 8.1.7 database:
    SELECT /*+ DRIVING_SITE(vs) */
    vs.col2
    ,user_defined_function
    FROM v_remote_table_1 vs
    ,v_remote_table_2 vc
    ,local_table_1 s
    WHERE vp.col1 = vs.col1
    AND s.col1 = vs.col2
    AND vs.col2 = &some_val
    This generalised query joins two tables in a remote database schema to a table in the local database schema and returns a single row. Without the call to the local user defined function, my specific query returns the row in less than a second. As soon as I include any local user defined function call, even a call to a dummy function which simply returns a string, my query takes several minutes to return its row. Explain plan gives exactly the same plan for both versions of the query, but the statistics are different:
    Version without call to function
    ================================
    8 recursive calls
    0 db block gets
    7 consistent gets
    0 physical reads
    0 redo size
    235 bytes sent via SQL*Net to client
    311 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed
    Version with call to function
    =============================
    93 recursive calls
    4 db block gets
    109 consistent gets
    1998 physical reads
    0 redo size
    288 bytes sent via SQL*Net to client
    312 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    2 sorts (memory)
    2 sorts (disk)
    1 rows processed
    I'm assuming that, when calling a local function, the DRIVING_SITE hint is ignored, but I don't know why. It's quite important that we are able to include the results of function calls in the query. Any ideas as to the cause of the degraded performance and possible solutions to it would be most welcome!
    Thanks.....

    I would try something like:
    SELECT r.col2,user_defined_function
    FROM (SELECT vs.col2
          FROM v_remote_table_1 vs, v_remote_table_2 vp
          WHERE vp.col1 = vs.col1 AND
                vs.col2 = &some_val) r,
         local_table_1 s
    WHERE s.col1 = r.col2Thismay allow Oracle to better seperate the calls to the two databases.
    HTH
    John

  • Select Performance problems using the 'like' operator

    I have a PL/SQL procedure that uses a cursor which contains a 'like' operator in the where clause. I have two database instances that are theoretically the same, however this code processes about 100,000 rows in 5 minutes on one database and 100,000 rows in several weeks on the other database. I know it is the 'like' operator that is causing the problem, but I don't know where to look in the database setup parameters as to what could be different between the two. Can someone point me in the right direction?

    I tried to think of another way to write the query, but I really need to use the wildcard option on the data I'm searching for. The system I'm working with attaches a suffix to the end of every ID (ie. '214-222-1234-0') The suffix ('-0') increments but the rest of the ID stays the same ('-1','-2',etc...), but I want to find all of the rows where the first 12 characters are the same, so I strip off the suffix and use a wildcard '%' in its place. I tried adding the SUBSTR() function to the left hand column of the where clause, but it was even slower than using the 'like' operator. I know its a sound query, I just can't figure out why it works fine on one database and not the other.

  • Performance problem using wwsec_api.is_user_in_group

    Hello,
    In our PL/SQL code, we using the wwsec_api.is_user_in_group to know in which group is the current user :
    This is the code we're using :
    AdminNatGroupId := portal.wwsec_api.group_id(upper('vw_admin'));
    AnimComGroupId := portal.wwsec_api.group_id(upper('vw_animcom'));
    AnimProjGroupId := portal.wwsec_api.group_id(upper('vw_animproj'));
    if ( portal.wwsec_api.is_user_in_group(portal.wwctx_api.get_user_id,AdminNatGroupId) ) then
    end if ;
    Since we have insert 18,000 users in OID, the performances became very, very bad !!!!!
    WHY ?
    Is there anybody who have an idea ?
    Luc.

    Your snippet worked fine in PL/SQL on 10.1.2.
    l_is_member is a BOOLEAN which is not allowed in SQL, but is allowed in PL/SQL. Although I would expect a different error.
    The following dynamic page worked for me:
    <HTML>
    <HEAD>
    <TITLE>Example</TITLE>
    </HEAD>
    <BODY>
    <H2>Example of A Dynamic Page</H2>
    <ORACLE>
    DECLARE
    user_sn NUMBER;
    group_sn NUMBER;
    l_is_member BOOLEAN;
    BEGIN
    htp.p('user = ' || :userid);htp.br;
    htp.p('group = ' || :groupname);htp.br;
    user_sn := wwsec_api.id (:userid);
    group_sn := wwsec_api.group_id (:groupname);
    l_is_member := wwsec_api.is_user_in_group(
    p_person_id => user_sn,
    p_group_id => group_sn
    IF l_is_member
    THEN
    htp.p('User ' || :userid || ' is a member of ' || :groupname);
    ELSE
    htp.p('User ' || :userid || ' is NOT a member of ' || :groupname);
    END IF;
    exception
    when wwsec_api.USER_NOT_FOUND_EXCEPTION
    then
    htp.p('USER_NOT_FOUND_EXCEPTION');
    when wwsec_api.GROUP_NOT_FOUND_EXCEPTION
    then
    htp.p('GROUP_NOT_FOUND_EXCEPTION');
    when wwsec_api.VALUE_ERROR_EXCEPTION
    then
    htp.p('VALUE_ERROR_EXCEPTION');
    when wwsec_api.LDAP_CONNECTION_EXCEPTION
    then
    htp.p('LDAP_CONNECTION_EXCEPTION');
    when wwsec_oid.MULTIPLE_MATCHES_FOUND
    then
    htp.p('wwsec_oid.MULTIPLE_MATCHES_FOUND');
    END;
    </ORACLE>
    </BODY>
    </HTML>

  • Diff Using and changing in Perform

    Hi All,
           What is the difference betwen USING and CHANGING in Perform.
    Thanks in advance
                                                  Ranjith

    hi,
    Using helps to use the parameter value passed.
    Changing helps to change the parameter value and then use the same in main program with changed value.
    Sample:
    data : val1 type i value 1,
           val2 type i value 0.
    perform calc using val1 changing val2.
    Write / : 'Changing :' , val2.
    write / : 'Using :' , val1.
    *&      Form  calc
          text
         -->P_VAL1  text
         <--P_VAL2  text
    form calc  using    p_val1
               changing p_val2.
    p_val2 = p_val1 + 100.
    *p_val1 = p_val1 + 100.
    *Since p_val1 is passed as using,the above is not *permitted
    endform.                    " calc
    This link will clear all your Doubts reagrding Perform Statement.
    Have a look:
    http://help.sap.com/saphelp_erp2005/helpdata/en/9f/db977635c111d1829f0000e829fbfe/frameset.htm
    rgds
    anver

  • Using and changing

    Hi sir,
    what is the diff b/w using and changing keywords for passing the perameters to subroutine and form

    Hi ,
       By default if you pass a varaible as Using , you cannot change the value of it in the subroutine  but in case of chianging it can be.
    Now you can pass the value of using paramater by pass by value , it allows you to change the value in the subroutine but once you are out of the subroutine the changed value is lost and the original value is retained.
    So in case you want to change value of a parameter you are passing to a subroutine use changing and if you just want to use its value then use using.
    Here is a code which might help you understand it better
    REPORT .
    data  : one type  i ,
            two type i.
            one = 1.
            two = 1.
    perform chnage_value using one
                         changing two.
    write /: one , two.
    *&      Form  chnage_value
          text
         -->P_ONE  text
         <--P_TWO  text
    form chnage_value using value(p_one)
                      changing p_two.
    p_one = p_one + 1.
    p_two = p_two + 1.
    endform.                    " chnage_value
    regards
    Arun

Maybe you are looking for

  • Packages in Opportunities

    We sell a lot of packages. We are looking for a way to display the products that are included in the packages when folks create a revenue record for the top level item. So if they add part A to a revenue record, since parts 1, 2, and 3 are included w

  • IPad downloads email folders but no email ever appears

    I have a User that was accidently deleted from their Groupwise Post Office. The User was recovered from a recent backup backup and retained the same FID. Now the only thing that appears on the ipad are his Grouwise folders. No mail ever appears. I de

  • SRM PO form.

    HI friends, I'm quite new to SRM. I've to make some changes to std. PO form in SRM.like logo. Can you tell me Step by step what are the basic config required.? Also can anyone please forward me a sample techinical spec on SRM PO Smartforms, which I c

  • Why can't thunderbird find my email accounts

    I open up Thunderbird and it asks me if I want to create an account. I have two existing accounts that access my mail on Time Warner Cable's Webmail. One is PAWilkey and the other is Tx7Phyl. I had 100's of emails in these two accounts. Thunderbird s

  • Problem in Restricting Char in Row ,

    Hello all, I got a query in which i have to do restriction on Calendar Day/Month in Rows under Material which is a Characteristics So it should be Product Line     Sold to Party          Material             Material for current year              Mat