Cost of delete

Would the cost (time) to use
delete from table where rowid in ( select rowid from table1,table2, table2 where ...)
be same or nearly same as using select query if the select query does not fetch any records?

I am deleting some records using complex sql but in most cases it does not delete any records. I wanted to know if the cost or the time it takes for this delete statement to execute will be same as executing just the select statement if no rows are returned?
I am using oracle 10g. I am assuming that since no rows are returned so oracle does not have to actually delete anything so there will not be any overhead of creating redo logs.. etc.
Hence , using delete with select in the where condition would be same as just using select statement. Is my assumption correct?
Following is my delete statement.
DELETE FROM table_name
WHERE ROWID IN (
SELECT c.ROWID
FROM table_name c, clm_run_error cre, clm_hdr_clm_ln_run_detail chcld
WHERE c.clm_run_error_sid = cre.clm_run_error_sid
AND cre.clm_hdr_clm_ln_run_detail_sid = chcld.clm_hdr_clm_ln_run_detail_sid
AND chcld.claim_header_sid = crec1.claim_header_sid
AND NVL (chcld.claim_line_sid, 0) = NVL (crec1.claim_line_sid, 0)
AND cre.clm_error_sid = v_clm_error_sid);
Thanks a lot for your asssistance.

Similar Messages

  • Cost Element Deletion Job test run getting run time error

    How can I make test run of cost element deletion job in background?

    Hi Riyas,
    Deleting Cost Elements in the Background
    If you want to delete many cost elements, the checks for dependent data take some time. You should therefore carry out the deletion in the background at times of minimal system usage.
    To do so, choose Background processing.
    Choose Execute and answer the confirmation prompt with Yes.
    ( T Code: KA04 - Individual cost element deletion )
    ( KA24 - Collective Deletion)
    Enter a job name in the dialog box.
    Enter a date and time for the planned start or select Immediate start.
    You can also define from which date and from which time no more starts should occur.
    Choose Confirm to leave the dialog box. In the next dialog box, choose Save.
    The R/3 System deletes the cost elements at the date specified.
    To check the current status of the job, choose System
    Status of Background Job T Code: SM37 and Execute.
    Regards,
    Pavan Kumar Arvapally

  • Cost element deletion-COEP entries deletion originated from Spl purpse ledg

    Hi Folks,
    We have created RA GL account by mistake as cost element and some entries have already gone into table COEP table. To delete cost element the prerequisite is that cost element shouldn't contain any entries. We have deleted COEP entries by using program "RKACOR20 : to delete CO documents for the GL doc and its reversal document" generated from FI, but unable to delete one entry which has got originated from Special purpose ledger. Can any one suggest way to delete this entry from COEP table.
    Thanks in advance.
    Thanks
    Rajesh Angadala

    Hi
    Check the below program, may be it works :
    Function Module: K_OBJECT_DATA_DELETE
    Program :
    RGUREP03                       FI-SL: Delete Line Items and Correct Totals Reco
    MGCU3TOP                       FI-SL: Delete Transaction Data
    SAPMGCU3                       FI-SL: Delete Transaction Data
    SKS

  • Cost Estimate Deletion Problem

    Hi,
    I have executed the cost estimate for the material.Now i wanted to delete it in CKR1 as it is incorrect.So that i can execute a new cost estimate for this.
    but my doubt is - if we execute cost estimate,then it will update in material master costing view.If i delete and then execute new cost estimate for the same material.will the new rates will be update? or the old incorrect rates are not deleted?
    Kindly advise me
    Thanks
    Supriya

    From the time you run a cost estimate, till the time it reaches the material master, there are three stages.
    First run and save the cost , Second mark the cost estimate, Third release the cost estimate.
    There is no change to the material master for the first two stages with respect to material value. When you mark, it just updates the future price. Only at the third stage, the material price changes with the new cost estimate value.  For any quantity that is in stock, the change in vaule is journalised.
    Hence, if you have just run the cost estimate, you are only in the first stage. You can comfortably delete CKR1. But please exercise caution, any wrong deletion can take away the cost estimate stored in the material master. This does not take away the standard price, only the estimate gets removed. As a result, you may not be able to get the cost component report for production order etc.
    When you are in CKR1, open up the small plus icon, which will give you more selection option to help you pinpoint the cost estimate that you want to delete.
    You can also check details of the current cost estimate in the costing view to find out which cost estimate has got updated in the standard price.

  • Plan/Actual cost for Deleted Material - reg

    Hello,
    Actually iam assigning one BOM to activicity.
    Now i have released the project,after this in cns41 plan and actual costs r flowing correctly.
    Now i have deleted that BOM from activity and saved the project also,
    now again in cns41 the same BOM cost was flowing in Planded data,
    pls give solution for this....
    --Prakash.

    Hi Manish,
    Thanks for ur support,
    but iam getting this error message,
    Typ Ite Message text                                                           LTxt
        000 The project info database reconstruction starts with: 1 Projects
        000 Processing is complete
    <b>   000 No value category could be determined for cost element 1000 50200000</b>
    this error was coming thg cjen
    --Prakash

  • Shipment cost document deletion

    Hi Gurus,
    Can u guide me the process how we need to delete the shipment cost document....
    I tried to delete it by selcting the delete icon in the menu bar (file).. but the below message is coming
    "Document can not be deleted,since item 0001 can not be deleted"
    Please guide me how can i delete
    Regards,
    Subbu

    might u have transferred the shipcost document.u need to cancel the transfer document by checking the cancellation check box.After that u need to delete the account assignment document there by clicking the delete button on the header document we can delete the ship cost document.
    Reward Points If helpful.
    -Sudheer

  • Cost element delete

    Hi guru,
    how to delete cost element after transaction......

    Hi,
    If there are any postings in controlling, run program RKACOR20 to delete the controlling document and try to delete the cost element.
    if u r in production system system ignore my suggestion, if not then use okc3 to reset the transcation data of controlling area, then it will allow u to delete the cost element.
    As per my knowledge, deletion is not a good practice. Try to go to OKB9 and change the cost element for your GL account.
    also please check the link
    Delete Cost Element with Account Assignment
    Hope this helps..
    Regards,
    Praisty

  • Cost element deleted - log

    Hi,
    Is there a way to find out who has deleted a cost element please?
    I'm hoping for some sort of log that might tell me.
    Thanks

    Hi,
    If this cost element is deleted completely, then no. Otherwise, if only validity period has been shortened, you can go to KA03 - Menu - Environment - Change documents. Of course, if it has been deleted completely, this also means that there are no positngs, actual or planning, on this element.
    Regards,
    Eli

  • Planned Cost after deletion flag

    Hi Experts
    After I have set the deletion flag for "PM03" operation in maintenance order and purchase requisition, the system still displays the planned costs in the transaction IW33.
    This is a normal situation or how can I remove this value from the planned costs.
    Thanks for your help.

    Hi Pete and Santos
    System: 605 SP 6 Netweaver: 702 SP 9
    I am sure that the PR has not PO, I did again the order in QAS
    and when I detele the operation the PR is delete too without
    PO.
    After cost determination there is not an error. It is like the
    system keeps this value in any table and It not can be deleted.
    I have run OLI5N the value appears but after run the
    transaction the value does not disappear from IW32.
    Thanks for your help.

  • Can't delete the cost estimate via CKR1

    Hi,
    We have one material. We can't delete the cost estimate via CKR1. It is only warning. It is no error log. The other material cost estimate can delete normally. I check the material master I can't find the issue. The following is the warning message. Could you pls help check it? Whate factor will effect the cost estimate deletion? Thanks.
    ==========================
    Deleting current standard cost estimates can cause inconsistencies
    Message no. CK 669
    Diagnosis
    u2022 If you delete a current standard cost estimate, the fields for
    the cost estimate are set to zero in the material master record. If you
    use the material ledger, the standard prices in the material ledger
    master data are also deleted when you delete the current standard cost
    estimate. The material master record for the material thus does no
    longer contains a current standard price from a standard cost estimate.
    u2022 If you delete an active standard cost estimate, you can no
    longer determine scrap, work in process and variations for previous
    periods.
    u2022 In certain countires, it is a legal requirement to maintain
    records of standard pricing. Therefore, you should check whether you
    are obliged by law to keep records of your standard cost estimates.
    Please also contact the relevant accounting and inventory management
    departments.
    ==========================
    Best Regards
    Park Han

    Hi,
    The deletion of Current standard cost estimate should be followed with some rules of the IFRS.
    If you want to change the standard cost you can do the change,If you want to delete the standard cost of material then it will set the price of material to zero.If the material ledger also activate then it will make the Moving average price & standard cost of the material to zero.
    So follow the Law of the country & Discus with Audit team &then delete the curent standard cost estimate of the material.
    Regards,
    Raj

  • How do I delete a costing run?

    Hi,
    I have a costing run which is already released. How do I delete it? I have deleted the price update from Material Master using CKR1. I want to totally delete the costing run. Please advise. Thanks.
    Regards,
    Sakthy

    Hi Sakthy,
    Please check the online help document for more information.
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/7e/cb841c43a311d189ee0000e81ddfac/content.htm
    CK44;
    Choose Accounting->Controlling->Product Cost Controlling->Product Cost Planning->Environment->Costing Run->Delete Costing Run. The Delete Costing Run screen will appear.
    1. Enter the name and date of the costing run. Data is displayed on the costing run that is to be deleted.
    2. Push trash can button
    best regards, Takashi

  • Delete not using indexes

    Hi, I'm a fairly new user of Oracle XMLDB 9.2.0.4 so please bear with me. I registered a schema and inserted about 130k rows into an XMLType table. Retrieval time took a severe hit as expected, but I created some indexes and it seemed to solve the problem. Autotrace showed that indexes were working correctly.
    However, delete does not seem to use those indexes, and instead performs a full table scan. The only difference between the statements used were:
    SELECT * FROM <table> where existsNode(...)
    DELETE FROM <table> where existsNode(...)
    Does anyone know how to alleviate full table scans on deletes?
    Thanks in advance,
    Justin

    Thanks for your time Mark.
    I messed around with 9.2.0.4 a little more, and realized that delete will use the index if it's an element that is indexed (like your example pointed out). However, delete doesn't seem to use indexed attributes.
    (Deleting based on an indexed element)
    explain plan for
    delete
    from purchaseorder x
    where existsNode ( value(x), '/PurchaseOrder/LineItems/LineItem[@ItemNumber="1"]/Part[@Id="715515011129"]') = 1
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | DELETE STATEMENT | | 1 | 19946 | 1 |
    | 1 | DELETE | PURCHASEORDER | | | |
    |* 2 | TABLE ACCESS BY INDEX ROWID| PURCHASEORDER | 1 | 19946 | 1 |
    |* 3 | INDEX RANGE SCAN | IPURCHASEORDERUSER | 2 | | 1 |
    (retrieving based on an indexed attribute)
    explain plan for
    select value(x)
    from purchaseorder x
    where existsNode ( value(x), '/PurchaseOrder/LineItems/LineItem[@ItemNumber="1"]/Part[@Id="715515011129"]') = 1
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 1 | 24142 | 6 |
    |* 1 | INDEX RANGE SCAN | SYS_IOT_TOP_35381 | 1 | 2038 | 2 |
    |* 2 | INDEX RANGE SCAN | SYS_IOT_TOP_35386 | 1 | 4214 | 2 |
    | 3 | NESTED LOOPS | | 1 | 24142 | 6 |
    | 4 | SORT UNIQUE | | | | |
    |* 5 | INDEX UNIQUE SCAN | SYS_IOT_TOP_35386 | 1 | 4216 | 2 |
    |* 6 | INDEX RANGE SCAN | ILINEITEMPARTNUMBER | 1 | | 2 |
    |* 7 | TABLE ACCESS BY INDEX ROWID| PURCHASEORDER | 4 | 79704 | 1 |
    |* 8 | INDEX UNIQUE SCAN | SYS_C003455 | 102 | | |
    Predicate Information (identified by operation id):
    1 - access("SYS_NT5e0stCgbSQ6Dg7Md7+/Y0A=="."NESTED_TABLE_ID"=:B1)
    2 - access("SYS_NTyLtUmo5HRjCEB+0PWmS+kA=="."NESTED_TABLE_ID"=:B1)
    5 - access("SYS_NTyLtUmo5HRjCEB+0PWmS+kA=="."ITEMNUMBER"=1)
    filter("SYS_NTyLtUmo5HRjCEB+0PWmS+kA=="."SYS_NC00011$"='715515011129')
    6 - access("SYS_NTyLtUmo5HRjCEB+0PWmS+kA=="."ITEMNUMBER"=1)
    7 - filter(SYS_CHECKACL("SYS_ALIAS_4"."ACLOID","SYS_ALIAS_4"."OWNERID",xmltype(''<
    privilege xmlns="http://xmlns.oracle.com/xdb/acl.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
    http://xmlns.oracle.com/xdb/acl.xsd DAV:http://xmlns.oracle.com/xdb/dav.xsd"><read-pr
    operties/><read-contents/></privilege>''))=1)
    8 - access("SYS_NTyLtUmo5HRjCEB+0PWmS+kA=="."NESTED_TABLE_ID"="SYS_ALIAS_4"."SYS_N
    C0003400035$")
    Note: cpu costing is off
    (Deleting based on indexed attribute)
    explain plan for
    delete
    from purchaseorder x
    where existsNode ( value(x), '/PurchaseOrder/LineItems/LineItem[@ItemNumber="1"]/Part[@Id="715515011129"]') = 1
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | DELETE STATEMENT | | 1 | 19946 | 13 |
    | 1 | DELETE | PURCHASEORDER | | | |
    |* 2 | FILTER | | | | |
    |* 3 | TABLE ACCESS FULL | PURCHASEORDER | 1 | 19946 | 2 |
    |* 4 | COLLECTION ITERATOR PICKLER FETCH| | | | |
    Predicate Information (identified by operation id):
    2 - filter( EXISTS (SELECT /*+ */ 0 FROM
    TABLE(SYS_OP_ATG(SYS_OP_ATG(:B1,10,11,3),2,3,3)) "KOKBF$" WHERE
    SYS_OP_ATG(VALUE(KOKBF$),2,3,2)=1 AND SYS_OP_ATG(SYS_OP_ATG(VALUE(KOKBF$),4,5,3),2,3,2
    )='715515011129'))
    3 - filter(SYS_CHECKACL("SYS_ALIAS_4"."ACLOID","SYS_ALIAS_4"."OWNERID",xmltype(''<p
    rivilege xmlns="http://xmlns.oracle.com/xdb/acl.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.oracle.com/xdb/acl.xsd
    http://xmlns.oracle.com/xdb/acl.xsd DAV:http://xmlns.oracle.com/xdb/dav.xsd"><update/>
    <unlink-from/></privilege>''))=1)
    4 - filter(SYS_OP_ATG(VALUE(KOKBF$),2,3,2)=1 AND
    SYS_OP_ATG(SYS_OP_ATG(VALUE(KOKBF$),4,5,3),2,3,2)='715515011129')
    Note: cpu costing is off
    Thanks again,
    Justin

  • Change in the cost center group

    Hi,
    Can we change the cost center from one cost center group to another group, when there are some postings in the cost center? If yes, how to go about it?
    help me out

    Yes you can!
    If you are planning to change within the standard hierarchy, Goto OKEON, drag, drop and save.
    Or you can go to KS02 for the cost center, in the basic data, you can give the new cost center group under the hierarchy area.
    If it is just non hierarchy cost center group, then go to KSH2 enter the old group, select the cost center, delete save, then go to the new cost center group and include the cost center.
    It does not matter whether it has been posted or not. It is just a grouping. But caution must be exercised. and there shall be a valid justification for doing so. Because the cost center may be used in various cycles. So better to check where and all the cost center is being used and then do the change.

  • Deleting Planning Profitability thru KP90 and KP91

    SAP Experts,
    I am trying to delete plan data in one of our plan versions, I used tcode KP90 & KP91, However, when I go to run reports to view what was deleted, I noticed that all Costing was deleted with the exception of Profitability. I read varios  SAP notes but they do not apply to our version SAP 700. We do not have COPA implemented yet, so I do not have any data there. Does anyone knows what steps am I missing? I also tried reversing any allocated profit centers thru 4KEB, I reversed them, but data still shows up in my reports. I tried copying a blank version also and still there is some data that do not get deleted.
    ANy help will be aprpeciated
    Edited by: Frank on Nov 20, 2008 5:15 PM

    We figure it out, we had to reverse profit centers by using tcode 4KEB, then KP90 and KP91.
    Then copy your plan data first with tcode KP97, then 7KEV, the order in which you do it is important.

  • Delete with sub select sometimes slow

    Hi all,
    we have following problem in version 11.2:
    we run some deletes similar delete-statements:
    delete from msvs where fk_msv_nr in (select pk_msv_nr from msv where rueckweisungsgrund = '<Falsch aus ePUB angelegt>');
    delete from zbe where fk_msv_nr in (select pk_msv_nr from msv where rueckweisungsgrund = '<Falsch aus ePUB angelegt>');
    delete from zag where fk_msv_nr in ( select  pk_msv_nr from msv where rueckweisungsgrund = '<Falsch aus ePUB angelegt>');
    table msv has 500000 rows, the select has 390000 rows and is running a few seconds, seems good.
    table msvs has 1000000 rows, zbe 3250000 rows and zag 513000 rows
    pk_msv_nr is primary key on msv
    fk_msv_nr is foreign key and referencing table msv
    delete from msvs: 780000 rows, 55sec
    delete from zbe: 2885000 rows 5min 55sec
    delete from zag: process killed after 30min
    execution plan shows FTS on msv and index range scan on idx_zag_fk_msv_nr (foreign key)
    also i see more than 100'000'000 logical reads
    we have similar problem with one other table
    Anybody an idea, why the deletes on two tables are slow, a few other tables (all with same sub-select) are in time
    Thanks for any help!!!
    Regards
    Jürgen

    SQL> explain plan for
      2  delete from msvs where fk_msv_nr in (select pk_msv_nr from msv where rueckweisungsgrund = '<Falsch aus ePUB angelegt>');
    Explained.
    Elapsed: 00:00:00.21
    SQL> @?/rdbms/admin/utlxpls
    PLAN_TABLE_OUTPUT
    | Id  | Operation          | Name              | Rows  | Bytes | Cost  |
    |  0 | DELETE STATEMENT    |                    |    1 |    21 |  2202 |
    |  1 |  DELETE            | MSVS              |      |      |      |
    |  2 |  NESTED LOOPS      |                    |    1 |    21 |  2202 |
    |  3 |    TABLE ACCESS FULL| MSV                |    1 |    7 |  2200 |
    |  4 |    INDEX RANGE SCAN | IDX_UNIQUE_MSVS_PK |    2 |    28 |    2 |
    SQL>  explain plan for
      2  delete from zbe where fk_msv_nr in (select pk_msv_nr from msv where rueckweisungsgrund = '<Falsch aus ePUB angelegt>');
    Explained.
    Elapsed: 00:00:00.09
    SQL>  @?/rdbms/admin/utlxpls
    PLAN_TABLE_OUTPUT
    | Id  | Operation           | Name              | Rows  | Bytes | Cost  |
    |   0 | DELETE STATEMENT    |                   |     3 |    78 |  2202 |
    |   1 |  DELETE             | ZBE               |       |       |       |
    |   2 |   NESTED LOOPS      |                   |     3 |    78 |  2202 |
    |   3 |    TABLE ACCESS FULL| MSV               |     1 |     7 |  2200 |
    |   4 |    INDEX RANGE SCAN | IDX_UNIQUE_ZBE_PK |     7 |   133 |     2 |
    SQL>  explain plan for
      2  delete from zag where fk_msv_nr in ( select  pk_msv_nr from msv where rueckweisungsgrund = '<Falsch aus ePUB angelegt>');
    Explained.
    SQL> @?/rdbms/admin/utlxpls
    PLAN_TABLE_OUTPUT
    | Id  | Operation           | Name              | Rows  | Bytes | Cost  |
    |   0 | DELETE STATEMENT    |                   |     1 |    27 |  2202 |
    |   1 |  DELETE             | ZAG               |       |       |       |
    |   2 |   NESTED LOOPS      |                   |     1 |    27 |  2202 |
    |   3 |    TABLE ACCESS FULL| MSV               |     1 |     7 |  2200 |
    |   4 |    INDEX RANGE SCAN | IDX_ZAG_FK_MSV_NR |     3 |    60 |     2 |

Maybe you are looking for