DELETE Performance

We are running Oracle 9i on Solaris 9.
I have a delete statement that's taking too long. Can somebody please advice what to do reduce the run time? Here is that:
delete materal_table where material_id = (select material_id from materials where name = 'abcd');
Result: About 1 million rows deleted in 4 hours!
Thanks.
Here is some more information:
Number of Records:
MATERIAL_TABLE = 280680800
MATERIALS = 8000
EXPLAIN PLAN:
Operation     Object Name     Rows     Bytes     Cost     Object Node     In/Out     PStart     PStop
DELETE STATEMENT Optimizer Mode=FIRST_ROWS          55 K          50402                     
DELETE     MATERIAL_TABLE                                   
INDEX RANGE SCAN     MATERIALTABLE_INDX     55 K     4 M     378           
TABLE ACCESS BY INDEX ROWID     MATERIALS     1      66      2           
INDEX UNIQUE SCAN     MATERIALS_INDX     1           1
MATERIALTABLE_INDX & MATERIALS_INDX are not PRIMARY KEYs.
Edited by: user578671 on Nov 13, 2008 3:38 PM

The optimizer has got two choices for this plan (once it has fetched the material_id): access by index, or full table scan. Your plan shows it is using the index, which for 1M rows from 280M (0.36%) is probably the right choice.
However to ensure it is the right choice you should make sure the optimizer has as much information as possible. Have you collected system stats recently? Have you collected table stats recently? The optimiser thinks it will find 55K rows via the index, whereas you say there are 1M to delete. That estimate is therefore out by a factor of 20 which could be significant. You might try collecting a histogram on the material_table.material_id column to help the optimizer. If that doesn't give the correct cardinality estimate, you may also want to try splitting the "SELECT material_id FROM materials..." into a separate statement to capture the material_id into a variable, then use that variable in the DELETE so that the optimizer can do bind peeking for an accurate cardinality estimate.
If after all this the plan is the same, then (as Justin says) you need to find out what it's waiting on. For example an unindexed FK might be doing a full table scan of a child table for each of the 1M rows. To do this, perform an extended trace, e.g.
ALTER SESSION SET timed_statistics=true;
ALTER SESSION SET max_dump_file_size=unlimited;
ALTER SESSION SET tracefile_identifier='DELETE';
ALTER SESSION SET EVENTS '10046 trace name context forever, level 8';
<run DELETE here>
ALTER SESSION SET EVENTS '10046 trace name context off';
<terminate session>Then use a tool like OraSRP to process the results and find out the biggest waits (and whether any other SQL statements are being run in the background - as a result of FKs, triggers, etc).

Similar Messages

  • Oracle Advance Compression Deletion Performance issue in 11g R1

    Hi,
    We have implemented OAC in our datawarehouse environment to enable table and index compression. We tested in our Test machine and we gained almost 600GB due to advance compression without any issues and all the informatica loads are running fine. And hence we implemented the same in our production but unfortunately two sessions which are involving deletion of data are taking more time (3 times of actual timing) for completion which affects our production environment.
    The tables creating issue are all non partitioned tables.
    I need to know whether Oracle Advance Compression will decrease delete performance? and is there any way to disable advance compression on those particular tables?
    Our environment details:
    DB earlier version: 11.1.0.6
    DB current version : Oracle 11.1.0.7
    Applied PSU: 11.1.0.7.6
    Operating system: Solaris 5.9
    Syntax used for compression:
    ALTER TABLE TABLE_NAME MOVE COMPRESS FOR ALL OPERATIONS;
    Thanks in Advance.

    Hi,
    Thanks for your reply.
    The note is for update performance issue and also I have applied necessary patches for improving update performance.
    The update sessions are all working fine. only the deletion sessions are creating problem.
    Could someone help me out to clear this problem.
    Thanks,
    VBK

  • Insert, search, delete performance overhead for different collections

    Hi,
    I am trying to create a table which compares performance overheads for different collections data structures. Does anyone want to help me out? I want to put a number from 1 - 9 in each of the question marks. 1 being very poor performance and 9 being very good performance (the reason I am doing this is that I had this question in a job interview test and I didn't pass it)
    anyone have any comments?
              Searching     Inserting     Deleting     
    ArrayList ? ? ?
    LinkedList ? ? ?
    TreeSet ? ? ?
    TreeMap ? ? ?
    HashMap ? ? ?
    HashSet ? ? ?
    Stack ? ? ?

    sorry the formatting has screwed up a bit when I posted it. It should have a list of the collection types and three columns (inserting, deleting, searching)

  • OWB 10.2.0.4 really bad set-based delete performance

    Hi, we recently upgraded to OWB 10.2.0.4, with one of the reasons being the ability to do set-based deletes instead of row-based. However, upon testing this, we're seeing maps that in row based deletes go from 30 - 40 seconds, now taking literally 1.5 to 2 HOURS to run.
    I expected the SQL from the set based to take the form of:
    delete from my_table
    where (col_a, col_b, col_c) in (select a, b, c from ....)
    but instead the format is different:
    delete from my_table
    where exists (select 1 from ....)
    I don't quite understand what the SQL is trying to accomplish - and truthfully, it performs horribly compared to the hand-written version (explain plan shows estimated cost of 14,000 for my query, and over 5 million for the OWB query).
    Has anyone else seen this - and is there a solution? Part of me wants to say I'm doing something wrong, but the other part says "sure, but it works fine in row-based mode(target only)" - exact same map.
    Any ideas?
    Thanks!
    Scott

    Hi everyone, we'll I've figured out what is causing the problem and how to fix it...but still don't understand why it causes the problem.
    Here's a high level overview of the ETL - we find deleted record by selecting business key columns from our existing dimension table and doing a MINUS on the matching columns from the source table. If any records come out of this, it means the record was deleted on the source, and we go ahead and do a matching delete on the dimension table.
    Here's where the odd thing happens though - there's a column called "source system name" that is part of the dimension business key. This column does NOT exist on the source system - it's just a hard coded constant (put in just in case we ever add an additional system in the future).
    Basically, if we do the minus logic on all the columns EXCEPT for this one, and then connect a constant to the delete operator that has this hard coded value in - the delete takes FOREVER... On the other hand, if we actually put this field into the minus operator by simply repointing the existing constant there instead of directly to the delete table...the deletes magically start taking 30 seconds instead of 10 minutes to run.
    No idea (at all) why this makes a diff, but it seems to - and it's a day and night different.
    Hopefully this can help someone else out who runs into the same issue.
    Thanks!
    Scott

  • Extremely poor delete performance on DS 5.2sp4

    I'm trying to run some bulk deletes on our production master server (5.2 sp 4), and we're having problems with the performance. Strangely, the problem doesn't seem to manifest on the replicas.
    Below is a section from the logfile. I sent ten deletes using ldapdelete -f.
    The first five go very quickly, then apparently, the server decides to do some "housekeeping" and "goes away" for nearly five minutes. The next five are quick to return, then the unbind, but the "housekeeping" continues on the server for nearly five minutes.
    During those five minutes, disk usage is very high (the disk the ldap db's are on is normally very lightly used).
    Suggestions?
    [31/Jan/2006:11:25:26 -0800] conn=8544 op=0 msgId=1 - RESULT err=0 tag=120 nentries=0 etime=0
    [31/Jan/2006:11:25:26 -0800] conn=8544 op=-1 msgId=-1 - SSL 128-bit RC4
    [31/Jan/2006:11:26:02 -0800] conn=8544 op=1 msgId=2 - BIND dn="uid=darrell,XXX" method=128 version=3
    [31/Jan/2006:11:26:02 -0800] conn=8544 op=1 msgId=2 - RESULT err=0 tag=97 nentries=0 etime=36 dn="uid=darrell,XXX"
    [31/Jan/2006:11:26:02 -0800] conn=8544 op=2 msgId=3 - DEL dn="uid=irn00007, XXX"
    [31/Jan/2006:11:26:02 -0800] conn=8544 op=2 msgId=3 - RESULT err=0 tag=107 nentries=0 etime=0 csn=43dfb9ca000000010000
    [31/Jan/2006:11:26:02 -0800] conn=8544 op=3 msgId=4 - DEL dn="uid=irn00025, XXX"
    [31/Jan/2006:11:26:02 -0800] conn=8544 op=3 msgId=4 - RESULT err=0 tag=107 nentries=0 etime=0 csn=43dfb9ca000400010000
    [31/Jan/2006:11:26:02 -0800] conn=8544 op=4 msgId=5 - DEL dn="uid=irn00030, XXX"
    [31/Jan/2006:11:26:03 -0800] conn=8544 op=4 msgId=5 - RESULT err=0 tag=107 nentries=0 etime=1 csn=43dfb9ca000900010000
    [31/Jan/2006:11:26:03 -0800] conn=8544 op=5 msgId=6 - DEL dn="uid=irn00032, XXX"
    [31/Jan/2006:11:26:03 -0800] conn=8544 op=5 msgId=6 - RESULT err=0 tag=107 nentries=0 etime=0 csn=43dfb9cb000300010000
    [31/Jan/2006:11:26:03 -0800] conn=8544 op=6 msgId=7 - DEL dn="uid=irn00108, XXX"
    [31/Jan/2006:11:26:03 -0800] conn=8544 op=6 msgId=7 - RESULT err=0 tag=107 nentries=0 etime=0 csn=43dfb9cb000500010000
    [31/Jan/2006:11:31:01 -0800] conn=8544 op=7 msgId=8 - DEL dn="uid=irn00125, XXX"
    [31/Jan/2006:11:31:01 -0800] conn=8544 op=7 msgId=8 - RESULT err=0 tag=107 nentries=0 etime=0 csn=43dfbaf5000000010000
    [31/Jan/2006:11:31:07 -0800] conn=8544 op=8 msgId=9 - DEL dn="uid=irn00159, XXX"
    [31/Jan/2006:11:31:07 -0800] conn=8544 op=8 msgId=9 - RESULT err=0 tag=107 nentries=0 etime=0 csn=43dfbafb000000010000
    [31/Jan/2006:11:31:26 -0800] conn=8544 op=9 msgId=10 - DEL dn="uid=irn00164, XXX"
    [31/Jan/2006:11:31:27 -0800] conn=8544 op=9 msgId=10 - RESULT err=0 tag=107 nentries=0 etime=1 csn=43dfbb0e000000010000
    [31/Jan/2006:11:31:37 -0800] conn=8544 op=10 msgId=11 - DEL dn="uid=irn00225, XXX"
    [31/Jan/2006:11:31:37 -0800] conn=8544 op=10 msgId=11 - RESULT err=0 tag=107 nentries=0 etime=0 csn=43dfbb19000000010000
    [31/Jan/2006:11:31:39 -0800] conn=8544 op=11 msgId=12 - UNBIND
    [31/Jan/2006:11:31:39 -0800] conn=8544 op=11 msgId=-1 - closing - U1

    I'm seeing exactly the same here. I have a perl script that is attempting to delete users (we have around 12000 to delete) and after the first 5 it clags up and takes ages (considerable cpu usage increase as well).
    I could turn of the referential integrity plugin I guess (although that will result in a break in service so is a bit of a problem) but we do really want this working.
    All of the attributes refered to in the plugin config are indexed for equality (at least).
    Anyone have any ideas why this struggles? Performing an ldapsearch with what I assume would be the same filter returns instantly (with the correct results!)
    (|(member=uid=dmc,ou=staff,xxx)(uniquemember=uid=dmc,ou=staff,xxx)(owner=uid=dmc,ou=staff,xxx)(seeAlso=uid=dmc,ou=staff,xxx)(nsroledn=uid=dmc,ou=staff,xxx)(iplanet-am-modifiable-by=uid=dmc,ou=staff,xxx)(iplanet-am-static-group-dn=uid=dmc,ou=staff,xxx)
    We are running 5.2P3. Is there something special that I'm missing? (an index that the plug needs but an ldapsearch won't or something?). I'm scratching my head here... a truss of the slapd I'm connected to show a huge amount of reads so I assume it is searching the entire db and not using the indexes - why would this be??

  • DELETE performance issue

    Dear All,
    I am posting again my performance issue for a delete statement (this time according to the instructions for posting SQL statements tunning request). The following delete statement was running more than 2 hours without success. Please note that the tables are indexed on the used fields in the query. If i try simple select it is done within 16 seconds:
    DELETE FROM aux_exist_relationship_3 aer_3
            WHERE EXISTS (SELECT ''
                          FROM aux_kind_of_control_1 akc_1
                          WHERE aer_3.cons_rel_id_new= akc_1.cons_rel_id)
            AND NOT EXISTS (SELECT ''
                            FROM aux_kind_of_control_3 akc_3
                            WHERE akc_3.cons_rel_id=aer_3.cons_rel_id_new)The version of the DB is 10.2.0.4
    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
    SQL> show parameter db_file_multi
    NAME TYPE VALUE
    db_file_multiblock_read_count integer 128
    SQL>
    SQL>
    SQL> show parameter db_block_size
    NAME TYPE VALUE
    db_block_size integer 8192
    SQL>
    SQL> show parameter cursor_sharing;
    NAME TYPE VALUE
    cursor_sharing string EXACT
    SQL>
    SQL> column sname format a20
    SQL> column pname format a20
    SQL> column pval2 format a20
    SQL>
    SQL> select sname, pname, pval1, pval2 from sys.aux_stats$;
    SNAME PNAME PVAL1 PVAL2
    SYSSTATS_INFO STATUS COMPLETED
    SYSSTATS_INFO DSTART 10-30-2008 16:28
    SYSSTATS_INFO DSTOP 10-30-2008 16:28
    SYSSTATS_INFO FLAGS 1
    SYSSTATS_MAIN CPUSPEEDNW 1217.17877
    SYSSTATS_MAIN IOSEEKTIM 10
    SYSSTATS_MAIN IOTFRSPEED 4096
    SYSSTATS_MAIN SREADTIM
    SYSSTATS_MAIN MREADTIM
    SYSSTATS_MAIN CPUSPEED
    SYSSTATS_MAIN MBRC
    SNAME PNAME PVAL1 PVAL2
    SYSSTATS_MAIN MAXTHR
    SYSSTATS_MAIN SLAVETHR
    13 rows selected.
    Here is the output of EXPLAIN PLAN
    explain plan for
    2 DELETE FROM aux_exist_relationship_3 aer_3
    3 WHERE EXISTS (SELECT ''
    4 FROM aux_kind_of_control_1 akc_1
    5 WHERE aer_3.cons_rel_id_new= akc_1.cons_rel_id)
    6 AND NOT EXISTS (SELECT ''
    7 FROM aux_kind_of_control_3 akc_3
    8 WHERE akc_3.cons_rel_id=aer_3.cons_rel_id_new);
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 4002353621
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU) | Time |
    | 0 | DELETE STATEMENT | | 2334 | 42012 | | 1174 (1) | 00:00:15 |
    | 1 | DELETE | AUX_EXIST_RELATIONSHIP_3 | | | | | |
    |* 2 | HASH JOIN SEMI | | 2334 | 42012 | | 1174 (1) |00:00:15 |
    |* 3 | HASH JOIN ANTI | | 2334 | 28008 | 1992K | 989 (1) | 00:00:12 |
    | 4 | TABLE ACCESS FULL | AUX_EXIST_RELATIONSHIP_3 | 113K| 663K| | 718 (1) | 00:00:09 |
    | 5 | INDEX FAST FULL SCAN| AUX_KIND_OF_CONTROL_3_IDX1 | 113K| 663K| | 74 (2) | 00:00:01 |
    | 6 | INDEX FAST FULL SCAN | AUX_KIND_OF_CONTROL_1_IDX1 | 221K| 1298K| | 183 (2) | 00:00:03 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
    2 - access("AER_3"."CONS_REL_ID_NEW"="AKC_1"."CONS_REL_ID")
    3 - access("AKC_3"."CONS_REL_ID"="AER_3"."CONS_REL_ID_NEW")
    19 rows selected.
    I will be very grateful if someone can tel me where might be the problem. i got suggestions yesterday for using MINUS in the delete clause:
    DELETE  FROM aux_exist_relationship_3 aer_3
          WHERE aer_3.cons_rel_id_new IN(SELECT akc_1.cons_rel_id
                                           FROM aux_kind_of_control_1 akc_1
                                         MINUS
                                         SELECT akc_3.cons_rel_id
                                           FROM aux_kind_of_control_3 akc_3)or using view, but it did not help.
    My guess is that this is linked to the UNDO_TABLESPACE but how to prove it? Or perhaps I am wrong?

    Good day to everyone!
    Thanks a lot for th suggestions.
    I have tested the same query in a different DB where I have imported the 3 tables together with the data and the execution took 2.54 seconds. I guess the problem might be coming from the UNDO_TABLESPACE. I have found the following query:
    select b.tablespace_name, tbs_size SizeMb, a.free_space FreeMb
    from  (select tablespace_name, round(sum(bytes)/1024/1024 ,2) as free_space
           from dba_free_space
           group by tablespace_name) a,
          (select tablespace_name, sum(bytes)/1024/1024 as tbs_size
           from dba_data_files
           group by tablespace_name) b
    where a.tablespace_name(+)=b.tablespace_name;and the result is:
    TABLESPACE_NAME | SIZEMB | FREEMB
    SYSAUX | 600 | 48
    UNDOTBS | 9500 | 2.44
    SYSTEM | 400 | 122.69
    EGR_TBS_DATA | 13000 | 96.56
    and also
    select SEGMENT_SPACE_MANAGEMENT,RETENTION,MAX_EXTENTS
    from dba_tablespaces
    where tablespace_name = 'UNDOTBS'result:
    SEGMENT_SPACE_MANAGEMENT |RETENTION | MAX_EXTENTS
    MANUAL | NOGUARANTEE | 2147483645
    so perhaps it is from the UNDO_TABLESPACE.
    Do you think this could be the issue?

  • DataBase Adapter Rollback option for Logical/Physical Delete in SOA  11g

    Hi All,
    We have a requirement where we need to rollback the logical delete performed by the DB Adapter (after polling a table) if there is any failure in the process down the line. We are trying to implement this using Mediator or OSB. For example if we are polling a table for changed records and performing logical delete, down the line if the business service (OSB) or the external reference (Mediator) are down/faulted, the records which were logically deleted are not getting rolled back in the table. Would any one please let me know if you have come across the same kind of scenario?
    Is there any property we need to set while configuring the polling DB Adapter?
    Thank You.

    Thank you very much for the reply Anuj,
    I have created a db adapter which polls on a table with logicaldeletestrategy in JDeveloper 11g,
    then I imported the XSD, mapping.xml, wsdl and JCA file into OSB using OSB consol. In the console
    I generated proxy and wsdl for that proxy using JCA file. Then created one more db adapter in JDev
    which inserts the records polled by the first db adapter into another table, followed the same
    process of importing the above mentioned 4 files and generated a business service. In proxy service
    route node I am using a transformation (which also I imported from Jdev) to route the data polled
    by proxy service to the business service. Here I am using an XA datasource both the JCA's also
    I made the 3 changes reccommended by Arun but still I am not getting the results.
    I tried physical delete same issue with that too. When I am doing physical delete the proxy service
    atleast picking up the records and deleting them. But when I tried logical delete the proxy is not even
    picking up the records. Am I missing anything here?
    Thank You,
    Edited by: user12237005 on Apr 7, 2011 2:17 PM

  • Need to delete specific Months Data from SQL Server Table

    Greetings Everyone,
    So i have one table which contains 5 years old data, now business wants to keep just one year old data and data from qurter months i.e. (jan, mar, June, sep and December), i need to do this in stored procedure. how i can achive this using month lookup table.
    Thank you in advance
    R

    Hi Devin,
    In a production environment, you should be double cautious about the data. I have no idea why you’re about to remove the data just years old. In one of the applications I used to support, the data retention policy is like to keep raw data for latest month
    and the elder data would get rollup as max, min, average and so on to store in another table. That’s a good example for data retention.
    In your case I still suggest you keep the elder data in another table. If the data size is so huge that violates  your storage threshold, get the data rollup and store the aggregated would be a good option.
    Anyway if you don’t care about the elder data, you can just delete them with code like below.
    DELETE
    FROM yourTable
    WHERE YEAR(dateColumn) < YEAR(CURRENT_TIMESTAMP) OR (MONTH(dateColumn) not in (1,3,6,9,12) AND YEAR(dateColumn) = YEAR(CURRENT_TIMESTAMP))
    In some cases to remove data from very large table, DELETE performs bad. TRUNCATE would be a better option which works faster. Read more by clicking
    here. In your case, if necessary, you can reference the below draft code.
    SELECT * INTO tableTemp FROM yourTable WHERE YEAR(dateColumn) = YEAR(CURRENT_TIMESTAMP) AND MONTH(dateColumn) IN(1,3,6,9,12)
    TRUNCATE yourTable;
    INSERT INTO yourTable SELECT * FROM tableTemp
    As you mentioned, you need to do the deletion in Stored Procedure(SP). Can you post your table DDL with sample data and specify your requirement details so that I can help to compose your SP.
    If you have any question, feel free to let me know.
    Best regards,
    Eric Zhang

  • HOW TO PERFORM SELECT ALL BUTTON IN ALV

    Hi ,
    i displayed output by using list display. in my status i have one button i.e. select all. when i click that button it has to select all the chckboxes in my list display.
    anybody can send me the code please.
    i am sending my code below.
    report zmahi6.
    type-pools : slis.
    tables : zuser_secobjects.
    data: t_header1 like zvfrcsthdr.
    data : begin of t_header occurs 0 .
             include structure t_header1.
    data :  customer_name like zvsfrcsthdr-customer_name,
             kukla like kna1-kukla,
            end of t_header.
    data : t_header1 like zuser_secobjects.
    data : begin of it_secobjects occurs 0.
            include structure t_header1.
    data :  box,
            input(1) type c,
          end of it_secobjects.
    *data : it_secobjects like zuser_secobjects occurs 0 with header line.
    data : i_field type slis_t_fieldcat_alv with header line.
    data : w_field like line of i_field.
    data : i_sort type slis_t_sortinfo_alv.
    data : w_sort like line of i_sort.
    data : it_filt1 type slis_t_filter_alv with header line.
    data:
    i_tabname type tabname,
    i_repid like sy-repid,
    is_lout type slis_layout_alv.
    data : chk_box type slis_fieldname.
    selection-screen: begin of block b1 with frame title text-t01.
    parameters : p_appln type zuser_secobjects-appln.
    parameters : p_user type usr02-bname, "zuser_secobjects-appln_user,
    p_partnr type zuser_secobjects-appln_partner,
    p_ptype type zuser_secobjects-partner_type default '02',
    p_upostn type zuser_secobjects-user_position,
    p_sdate like likp-erdat default sy-datum,
    "type zuser_secobjects-start_date
    p_edate(10) default '12/31/9999',
    type zuser_secobjects-end_date,
    p_revnum type zuser_secobjects-revnum,
    p_cted type zuser_secobjects-created_by,
    p_cdate type zuser_secobjects-creation_date,
    p_ctime type zuser_secobjects-creation_time,
    p_chnby type zuser_secobjects-changed_by,
    p_cdate1 type zuser_secobjects-changed_date,
    p_ctime1 type zuser_secobjects-changed_time.
    selection-screen: end of block b1.
    start-of-selection.
      perform get_data.
      check sy-subrc eq 0.
      set pf-status 'ZMAHEE'.
      perform prepare_fieldcatalog.
      perform alv_list_display.
      form user_command using r_ucomm like sy-ucomm
                          rs_selfield type slis_selfield.
      case r_ucomm.
        when 'DELETE'.
          perform delete.
      endcase.
    ENDFORM.
    *& Form PREPARE_FIELDCATALOG
    text
    --> p1 text
    <-- p2 text
    form prepare_fieldcatalog.
      clear: w_field,i_field.
      refresh:i_field.
      i_field-key = 'X'.
      i_field-col_pos = 1.
      i_field-ddictxt = 'S'.
      i_field-seltext_s = '@11@'.
      i_field-checkbox = 'X'.
      i_field-input = 'X'.
      i_field-fieldname = 'HEADER'.
      i_field-outputlen = 0.
      append i_field.
      clear i_field.
      w_field-fieldname = 'APPLN'.
      w_field-tabname = 'IT_SECOBJECTS'.
      w_field-seltext_l = text-m01.
      w_field-outputlen = '10'.
      w_field-col_pos = 1.
      append w_field to i_field.
      clear w_field.
      w_field-fieldname = 'APPLN_USER'.
      w_field-tabname = 'IT_SECOBJECTS'.
      w_field-just = 'C'.
      w_field-seltext_l = text-m02.
      w_field-outputlen = '7'.
      w_field-col_pos = 2.
      append w_field to i_field.
      clear w_field.
    endform. " PREPARE_FIELDCATALOG
          FORM pf_status_set                                            *
    -->  RT_EXTAB                                                      *
    form pf_status_set using rt_extab type slis_t_extab.
      set pf-status '0001'.
    endform.
    *form user_command using r_ucomm like sy-ucomm
                           rs_selfield type slis_selfield.
    *form user_command using r_ucomm like sy-ucomm
                         rs_selfield type slis_selfield.
    case r_ucomm.
       when 'DELETE'.
         perform delete.
    endcase.
    *endform.
    *& Form ALV_LIST_DISPLAY
    text
    --> p1 text
    <-- p2 text
    form alv_list_display.
      i_repid = sy-repid.
      call function 'REUSE_ALV_LIST_DISPLAY'
      exporting
      i_callback_program = i_repid
      i_callback_pf_status_set = 'PF_STATUS_SET'
      i_callback_user_comomand = 'USER_COMMAND'
      is_layout = is_lout
      it_fieldcat = i_field[]
    it_sort = i_sort
    it_events = it_evts[]
      tables
      t_outtab = it_secobjects.
    endform. " ALV_LIST_DISPLAY
    *& Form GET_DATA
    text
    --> p1 text
    <-- p2 text
    form get_data.
      select * from zuser_secobjects
      into table it_secobjects.
    endform. " GET_DATA
    *&      Form  delete
          text
    -->  p1        text
    <--  p2        text
    form delete.
      data : lines type i.
      do lines times.
        clear it_secobjects.
        read line sy-index field value it_secobjects-box.
        read table it_secobjects with  key appln = it_secobjects-appln
                                     appln_user = it_secobjects-appln_user.
        if it_secobjects-input ne 'X'.
          it_secobjects-box = 'X'.
          modify line sy-index
               field value it_secobjects-box.
        else.
          it_secobjects-box = space.
          modify line sy-index
          field value it_secobjects-box.
        endif.
      enddo.
    endform.                    " delete
    this program is not working when i select select all button. this button exist in pf status 0001.
    anybody can modify the code and send me the code again.
    thanks,
    maheedhar.t

    HI Rich,
    i tried in this way also but i didnt get the output. i am sending my code again plz do the necessary changes and resend it to me if possible,
    report zmahi6.
    type-pools : slis.
    tables : zuser_secobjects.
    data: t_header1 like zvfrcsthdr.
    data : begin of t_header occurs 0 .
             include structure t_header1.
    data :  customer_name like zvsfrcsthdr-customer_name,
             kukla like kna1-kukla,
            end of t_header.
    data : t_header1 like zuser_secobjects.
    data : begin of it_secobjects occurs 0.
            include structure t_header1.
    data :  box,
            input(1) type c,
            checkBOX(1) type c,
          end of it_secobjects.
    data : wa_ita like line of it_secobjects.
    *data : it_secobjects like zuser_secobjects occurs 0 with header line.
    data : i_field type slis_t_fieldcat_alv with header line.
    data : w_field like line of i_field.
    data : i_sort type slis_t_sortinfo_alv.
    data : w_sort like line of i_sort.
    data : it_filt1 type slis_t_filter_alv with header line.
    data:
    i_tabname type tabname,
    i_repid like sy-repid,
    is_lout type slis_layout_alv.
    data : chk_box type slis_fieldname.
    selection-screen: begin of block b1 with frame title text-t01.
    parameters : p_appln type zuser_secobjects-appln.
    parameters : p_user type usr02-bname, "zuser_secobjects-appln_user,
    p_partnr type zuser_secobjects-appln_partner,
    p_ptype type zuser_secobjects-partner_type default '02',
    p_upostn type zuser_secobjects-user_position,
    p_sdate like likp-erdat default sy-datum,
    "type zuser_secobjects-start_date
    p_edate(10) default '12/31/9999',
    type zuser_secobjects-end_date,
    p_revnum type zuser_secobjects-revnum,
    p_cted type zuser_secobjects-created_by,
    p_cdate type zuser_secobjects-creation_date,
    p_ctime type zuser_secobjects-creation_time,
    p_chnby type zuser_secobjects-changed_by,
    p_cdate1 type zuser_secobjects-changed_date,
    p_ctime1 type zuser_secobjects-changed_time.
    selection-screen: end of block b1.
    start-of-selection.
      perform get_data.
      check sy-subrc eq 0.
      set pf-status 'ZMAHEE'.
      perform prepare_fieldcatalog.
      perform alv_list_display.
    END-OF-SELECTION.
    AT USER-COMMAND.
    CASE SY-UCOMM.
    when 'DELETE'.
          loop at it_secobjects.
    it_secobjects-checkBOX = 'X'.     "<-this would be the name of the
             modify it_secobjects.
          endloop.
        rs_selfield-refresh = 'X'.
         PERFORM ALV_LIST_DISPLAY.
    endcase.
    *ENDCASE.
    *ENDFORM.
    *& Form PREPARE_FIELDCATALOG
    text
    --> p1 text
    <-- p2 text
    form prepare_fieldcatalog.
      clear: w_field,i_field.
      refresh:i_field.
      i_field-key = 'X'.
      i_field-col_pos = 1.
      i_field-ddictxt = 'S'.
      i_field-seltext_s = '@11@'.
      i_field-checkbox = 'X'.
      i_field-input = 'X'.
      i_field-fieldname = 'HEADER'.
      i_field-outputlen = 0.
      append i_field.
      clear i_field.
      w_field-fieldname = 'APPLN'.
      w_field-tabname = 'IT_SECOBJECTS'.
      w_field-seltext_l = text-m01.
      w_field-outputlen = '10'.
      w_field-col_pos = 1.
      append w_field to i_field.
      clear w_field.
      w_field-fieldname = 'APPLN_USER'.
      w_field-tabname = 'IT_SECOBJECTS'.
      w_field-just = 'C'.
      w_field-seltext_l = text-m02.
      w_field-outputlen = '7'.
      w_field-col_pos = 2.
      append w_field to i_field.
      clear w_field.
    endform. " PREPARE_FIELDCATALOG
          FORM pf_status_set                                            *
    -->  RT_EXTAB                                                      *
    form pf_status_set using rt_extab type slis_t_extab.
      set pf-status '0001'.
    endform.
    *form user_command using r_ucomm like sy-ucomm
                           rs_selfield type slis_selfield.
    *form user_command using r_ucomm like sy-ucomm
                         rs_selfield type slis_selfield.
    case r_ucomm.
       when 'DELETE'.
         perform delete.
    endcase.
    *endform.
    *form user_command using p_ucomm like sy-ucomm
    *rs_selfield type slis_selfield.
    case p_ucomm.
       when 'DELETE'.               " SELALL is the FCODE of ur push
    *button
         loop at it_secobjects  into wa_ita.
           it_secobjects-check = 'X'.
           modify it_secobjects from wa_ita.
         endloop.
    endcase.
    *endform.
    form user_command using r_ucomm like sy-ucomm
                                           rs_selfield type slis_selfield.
    case r_ucomm.
    when 'DELETE'.
          loop at it_secobjects.
    it_secobjects-checkBOX = 'X'.     "<-this would be the name of the
    *checkbox field in your internal table.
             modify it_secobjects.
          endloop.
         rs_selfield-refresh = 'X'.
         PERFORM ALV_LIST_DISPLAY.
    endcase.
    endform.
    *& Form ALV_LIST_DISPLAY
    text
    --> p1 text
    <-- p2 text
    form alv_list_display.
      i_repid = sy-repid.
      call function 'REUSE_ALV_LIST_DISPLAY'
      exporting
      i_callback_program = i_repid
      i_callback_pf_status_set = 'PF_STATUS_SET'
      i_callback_user_comomand = 'USER_COMMAND'
      is_layout = is_lout
      it_fieldcat = i_field[]
    it_sort = i_sort
    it_events = it_evts[]
      tables
      t_outtab = it_secobjects.
    endform. " ALV_LIST_DISPLAY
    *& Form GET_DATA
    text
    --> p1 text
    <-- p2 text
    form get_data.
      select * from zuser_secobjects
      into table it_secobjects.
    endform. " GET_DATA
    *&      Form  delete
          text
    -->  p1        text
    <--  p2        text
    form delete.
      data : lines type i.
      do lines times.
        clear it_secobjects.
        read line sy-index field value it_secobjects-box.
        read table it_secobjects with  key appln = it_secobjects-appln
                                     appln_user = it_secobjects-appln_user.
        if it_secobjects-input ne 'X'.
          it_secobjects-box = 'X'.
          modify line sy-index
               field value it_secobjects-box.
        else.
          it_secobjects-box = space.
          modify line sy-index
          field value it_secobjects-box.
        endif.
      enddo.
    endform.                    " delete
    thanks,
    maheedhar.t

  • Function Based Indexes - negative performance

    Has anyone run across any cases where they have had issues with Function Based Indexes negatively impacting performance??
    We are trying to use function based indexes in 9i (NLS_SORT=GENERIC_BASELETTER) and 10g (NLS_SORT=BINARY_CI) for case insensitivity.
    We thought this was a decent solution until recently when testing with larger datasets. Any info is appreciated.
    Thanks,

    Just to clarify rreynoldson's first point:
    All indexes will negatively impact inserts. Indexes, including function-based indexes, may or may not improve update and delete performance depending on whether the overhead of maintaining the index outweighs the benefit of being able to use the index to find the row(s) to update relatively quickly.
    For user564260:
    Assuming those parameters are set, make sure that you've gathered statistics on the function based index. If that doesn't resolve the problem, can you post a small test case that demonstrates the problem where you
    - Create the table
    - Create the indexes
    - Populate it with data
    - Run the query that you'd expect to use the FBI
    - Post the explain plan
    that would help us immensely.
    Justin

  • VPD Performance

    Hi,
    I need to use VPD feature for my project, so testing the performance hit if I use VPD.
    I have table CUST_MAST which hold details for customer. I want to apply VPD policy on this table in such a way that branch employee can see only customers under their own branch.
    So that I added one field BRANCH_CODE in CUST_MAST table, this field will hold branch code number and policy function will return predicate like WHERE BRANCH_CODE = 'CODE VALUE'. so I can grantee that employee can see only own branch customers. Its working fine.
    Now I want to test performance hit with VPD. So I am testing INSERT,SELECT,UPDATE, DELETE operation on this table. I created one more table with same structure as CUST_MAST e.g CUST_MAST_VPD and added branch_code. The policy function is applied on CUST_MAST_VPD
    CUST_MAST ---------- Structure before adding BRANCH_CODE
    cust_no
    cust_name
    CUST_MAST_VPD ----------- Structure after adding BRANCH_CODE
    cust_no
    cust_name
    branch_code
    Policy Function
    create or replace function filter_branch_data
    p_schema in varchar2,
    p_table in varchar2
    return varchar2
    as
    l_retstr varchar2(2000);
    begin
    if(SYS_CONTEXT ('hr_ctx', 'BRANCH_CODE') = 'ALL') then
    l_retstr := null;
    else
    l_retstr := 'BRANCH_CODE = '||''''|| SYS_CONTEXT ('hr_ctx', 'BRANCH_CODE')||'''';
    end if;
    return l_retstr ;
    end;
    Policy Type is
    dbms_rls.add_policy (
    object_schema => 'DEV',
    object_name => 'CUST_MAST_VPD',
    policy_name => 'perform_vpd_test',
    function_schema => 'DEV',
    policy_function => 'filter_branch_data',
    statement_types => 'SELECT,INSERT,UPDATE,DELETE,INDEX',
    update_check => TRUE,
    policy_type => dbms_rls.context_sensitive
    Table has following Indexes
    Index for non policy table CUST_MAST
    Unique Index on cust_no
    Index for policy table CUST_MAST_VPD
    Unique index on cust_no
    Index on bank_code
    When I tried to Insert,select,update and delete operation with 10000 records
    but I got a apposite result, with VPD my performace got improved,
    INSERT - takes less time to insert in policy table i.e CUST_MAST_VPD -- performance improved
    SELECT - takes more time to select from policy table i.e CUST_MAST_VPD --
    performance decreased
    UPDATE - takes less time to update records in policy table i.e CUST_MAST_VPD -- performance improved
    DELETE - takes less time to delete from policy table i.e CUST_MAST_VPD --
    performance imporved
    MY QUESTION
    As per my thinking It should reduce the performance but how it is possible that for INSERT,UPDATE and DELETE performance is improved ?

    Hi,
    Thanks for reply.
    POLICY table has 2 indexes
    Unique Index on cust_no
    Index on branch_code.
    I made mistake in previous Post there is no field bank_code its a brach_code.

  • Deleting files is slow

    System:
    - Dell quad core XPS 710, 4GB RAM
    - 5x500MB HD
    - Vista
    - Nvidia 7900 GS and Nvidia 8600 GTS (I have updated the nvidia drivers and the vista hot patches)
    - My Lr database, with 62,000 images, is on its own 500MB HD, with Vista file indexing turned off.
    - The HD containing the actual images has Vista file indexing turned on.
    - McAfee security center is running
    Problem:
    Deleting files (delete from disk) can be very slow. The first time I delete files it can take several minutes. Subsequent deletions can take from 2-20 seconds.
    I have no other Lr performance issues at present (that I am aware of).
    Does anyone have any tips to improve file deletion performance?
    TIA
    Rory

    Thanks John
    I was already doing a multi-select. After the first delete, which takes several minutes, no matter how many images are selected, subsequent deletes take about 1 second per image, so if I select 200 images it takes about 200 seconds.
    As a work around I have been deleting the images in the windows explorer, which is always less than one second, and then synchronizing in Lr, which is fairly quick.
    But I am weary of work arounds, and was hoping for a tip on some possible conflict in my system with Lr. Is this a known issue with Lr?
    Rory

  • Slow delete

    Oracle RAC 10.2.0.4 on RHEL 5.
    I do not understand this situation: I have a table A with 60 million rows and an index A_IDX on column C1 of table A.
    If I run
    select sum (C2) from A where C1 = 'XXX';
    being C2 another column of A, the query returns in 20 seconds, performing an index range scan of A_IDX.
    If I run
    delete from A where C1 = 'XXX';
    the query performs the same index range scan on A_IDX but runs for days waiting on db file scattered read.
    The records to be deleted are only 300,000 so undo/redo generated should not influence the DELETE performance.
    Any suggestion on the reason for this waits?
    Regards

    Ask your self if you have
    (a) delete trigger on table A
    (b) foreign key intergirty constraints in table A
    As this might influence the delete time
    Best Regards
    Mohamed Houri

  • Possibly solution to slow deleting if using Kapersky Internet Security

    In case anyone has a similr problem i discovered today that the File AV within Kersky Internet Security 2010 is killing the process when deelting files making it take forever.  The solutions I have found so far are:
    a) Turn off the File AV completely under settings
    b)There is an option under  File AV / settings/additional go to "pause on application startup" click select and at the exe.
    Hope that helps someone
    Mike

    FWIW, I have a similar problem with Webroot's Spy Sweeper - it seems to kill MOVE and DELETE performance.
    When I've had to copy 100's or 1000's of large files, it will crawl and Windows will report "4 hours remaining"... I turn off the A/V and all of a sudden it's "2 minutes remaining".

  • NFe 3.10 - XML ainda sendo gerado na versão 2.00

    Boa noite pessoal!
    Fizemos as atualizações nos sistemas e aplicamos do arquivo .SAR no ECC, Support Package 16 no GRC/PI, fizemos customizing no ECC e no GRC mas quando a NFe é gerada na nova versão, as tags do XML onde a versão é informada ainda estão saindo como 2.00.
    Nos passos de customizing no GRC, fizemos conforme o Help:
    Settings for NF-e Layout 3.10+
    NF-e: Maintain Connected Government Systems
    NF-e: Maintain Version of Message Types
    NF-e: Define Query for Service Status for Authority (SEFAZ)
    NF-e: Maintain Batch Parameters
    Fazendo um DEBUG, o campo XMLVERS está sendo preenchido no ECC com a versão 3.10 corretamente.
    O que percebi (e talvez possa ter algo a ver) é que nos customizings do GRC não tem nenhum campo onde informar que a versão 3.10 refere-se ao namespace http://sap.com/xi/NFE/008 como em algumas configurações das versões anteriores onde era possível selecionar Versão 005a ou 006. Existe alguma outra configuração que tem que ser feita fora essas que comentei?
    Obrigado!
    Abs.

    Pior que se voce olhar na nota 1933985 - NF-e new layout 3.10
    Tá lá... certifique se que foi atualizada.
    *& Object          REPS LJ_1B_NFEF42
    *& Object Header   FUGR J_1B_NFE
    *& FORM CALL_XI
    FORM call_xi USING    p_bukrs TYPE bukrs
                          p_branch TYPE j_1bbranc_
                          p_model  TYPE j_1bmodel       "V1.10
                          p_parallel TYPE flag          "1276438
    *>>>> START OF DELETION <<<<<
                 CHANGING p_rfcerror TYPE sy-subrc
    *>>>> END OF DELETION <<<<<<<
    *>>>> START OF INSERTION <<<<
                          p_resend   TYPE flag          "1933985
                 CHANGING p_rfcerror TYPE sy-subrc
    *>>>> END OF INSERTION <<<<<<
      DATA: lt_error type J_1BNFE_INBOUND_TAB,       "1254565
            ls_error type j_1bnfe_inbound,           "1254565
            lv_subrc type sy-subrc.                  "1254565
      DATA: lt_bapiret2 TYPE bapirettab.             "1362971
    *>>>> START OF DELETION <<<<<
    * Define messaging-system destination for RFC
    *>>>> END OF DELETION <<<<<<<
    *>>>> START OF INSERTION <<<<
      DATA: lv_error_status TYPE j_1bnfe_errstatus.           "1933985
    * Define messaging-system destination for RFC
    *>>>> END OF INSERTION <<<<<<
        if lv_xnfeactive is initial.                    "V1.10
          IF  p_model NE lc_cte.                               "1724476
    *>>>> START OF DELETION <<<<<
    * Call function asych. when RFC connection available
    *>>>> END OF DELETION <<<<<<<
    *>>>> START OF INSERTION <<<<
    * NF-e Layout 3.10 changes                                "1933985
          IF xmlh-version >= gc_nfe_version_3.                "1933985
                                                              "1933985
              PERFORM call_message_system_comm                "1933985
                      USING lv_rfcdest                        "1933985
                            p_resend                          "1933985
                            lv_xnfeactive                     "1933985
                      CHANGING lv_error_status                "1933985
                               p_rfcerror                     "1933985
                               lt_bapiret2.                   "1933985
                                                              "1933985
          ELSE.                                               "1933985
                                                              "1933985
    * Call function asych. when RFC connection available
    *>>>> END OF INSERTION <<<<<<
              p_rfcerror = sy-subrc.
            ENDIF.
          ENDIF.
    *>>>> START OF DELETION <<<<<
    *>>>> END OF DELETION <<<<<<<
    *>>>> START OF INSERTION <<<<
                                                              "1933985
          ENDIF.                                              "1933985
    *>>>> END OF INSERTION <<<<<<
    *          p_rfcerror = sy-subrc.                        "V1.10 1254565
    *        ENDIF.                                          "V1.10 1254565
    *      ELSE.                                                   "1254565
    *>>>> START OF DELETION <<<<<
            call function '/XNFE/NFE_CREATE'                "V1.10
    *>>>> END OF DELETION <<<<<<<
    *>>>> START OF INSERTION <<<<
    *NF-e version 2
          IF xmlh-version < gc_nfe_version_3.                 "1933985
            call function '/XNFE/NFE_CREATE'                "V1.10
    *>>>> END OF INSERTION <<<<<<
    * empty, everything is OK.                                  "1254565
           lv_subrc = sy-subrc.                                 "1254565
    *>>>> START OF DELETION <<<<<
           PERFORM transfer_bapiret2_to_error_log               "1362971
    *>>>> END OF DELETION <<<<<<<
    *>>>> START OF INSERTION <<<<
           PERFORM transfer_bapiret2_to_error_log               "1362971
    *>>>> END OF INSERTION <<<<<<
             move c_a to p_msstat.                              "1254565
           endif.                                               "1254565
           sy-subrc = lv_subrc.                                 "1254565
    *>>>> START OF DELETION <<<<<
    *>>>> END OF DELETION <<<<<<<
    *>>>> START OF INSERTION <<<<
                                                              "1933985
         ELSE.                                                "1933985
    * NF-e Layout 3.10 changes                                "1933985
            PERFORM call_message_system_comm                  "1933985
                      USING lv_rfcdest                        "1933985
                            p_resend                          "1933985
                            lv_xnfeactive                     "1933985
                      CHANGING lv_error_status                "1933985
                               p_rfcerror                     "1933985
                               lt_bapiret2.                   "1933985
            lv_subrc = p_rfcerror.                            "1933985
                                                              "1933985
            IF NOT lt_bapiret2[] IS INITIAL.                  "1933985
              CALL FUNCTION 'J_1B_NFE_BAPIRET2_MAP_TO_LOG1'   "1933985
                EXPORTING                                     "1933985
                  iv_docnum         = xmlh-docnum             "1933985
                  it_bapiret2       = lt_bapiret2.            "1933985
            ENDIF.                                            "1933985
            IF lv_error_status IS NOT INITIAL.                "1933985
               move lv_error_status to p_msstat.              "1933985
            ELSE.                                             "1933985
               move c_a to p_msstat.                          "1933985
            ENDIF.                                            "1933985
            sy-subrc = lv_subrc.                              "1933985
                                                              "1933985
         ENDIF.                                               "1933985
    *>>>> END OF INSERTION <<<<<<

Maybe you are looking for

  • How can I create a new event without it automatically being an all-day event?

    When I create a new event in iCal, it automatically creates an all-day event.  (By create, i mean double-clicking in the month view.)  Is there any way to change it back to hourly when you create an event, like in Snow Leopard?  Although this is easy

  • Popup window error : You are trying to access a page that is no longer..

    Hello guys, read all the threads related to popup windows and everything works fine except one thing: all the time I get following error : "You are trying to access a page that is no longer active. - The referring page may have come from a previous s

  • Photo Gallery Module - Customize large image size

    I need to figure out how to customize the size of the full image on the Photo Gallery Module. I have a couple of clients using this module that do not understand how to crop and resize images before uploading them. I understand this can be done throu

  • Missing video footage

    Hello, I'm using the JMF to playback some video footage. The footage is raw avi and is rather sizable. It was captured with amcap if that is of any help. My problem is that java will not play all of the video but stops before the end. I think it also

  • FPS being converted during import

    I am converting AVCHD video into MPEG2 format using the Voltaic demo software. After conversion I can open the created *.mov using quicktime and it plays at the correct 30 FPS. However, when I import it into Final Cut HD it nerfs it down to 10 FPS. I