<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic INSERT into BKPF - index causing a problem? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668286#M1574824</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a standard SAP transaction, there is the statement INSERT BKPF. The SQL trace shows this statement can take a long time to execute. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The oracle SQL is &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SQL Statement
----------------------------------------------------------------------------------------------------------------------
INSERT
INTO
  "BKPF"
VALUES
(
  :A0 , :A1 , :A2 , :A3 , :A4 , :A5 , :A6 , :A7 , :A8 , :A9 , :A10 , :A11 , :A12 , :A13 , :A14 ,
  :A15 , :A16 , :A17 , :A18 , :A19 , :A20 , :A21 , :A22 , :A23 , :A24 , :A25 , :A26 , :A27 , :A28 ,
  :A29 , :A30 , :A31 , :A32 , :A33 , :A34 , :A35 , :A36 , :A37 , :A38 , :A39 , :A40 , :A41 , :A42 ,
  :A43 , :A44 , :A45 , :A46 , :A47 , :A48 , :A49 , :A50 , :A51 , :A52 , :A53 , :A54 , :A55 , :A56 ,
  :A57 , :A58 , :A59 , :A60 , :A61 , :A62 , :A63 , :A64 , :A65 , :A66 , :A67 , :A68 , :A69 , :A70 ,
  :A71 , :A72 , :A73 , :A74 , :A75 , :A76 , :A77 , :A78 , :A79 , :A80 , :A81 , :A82 , :A83 , :A84 ,
  :A85 , :A86 , :A87 , :A88 , :A89 , :A90 , :A91 , :A92 , :A93 , :A94 , :A95 , :A96 , :A97 , :A98
)


Execution Plan

----------------------------------------------------------------------------------------------------------------------
System: xxx

---------------------------------------------------------------------------------
| Id  | Operation                | Name | Rows  | Bytes | Cost (%CPU)| Time     |
---------------------------------------------------------------------------------
|   0 | INSERT STATEMENT         |      |     1 |   369 |     1   (0)| 00:00:01 |
|   1 |  LOAD TABLE CONVENTIONAL | BKPF |       |       |            |          |
---------------------------------------------------------------------------------

Query Block Name / Object Alias (identified by operation id):
-------------------------------------------------------------

   1 - INS$1&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could a badly defined index causing an INSERT performance problem? Obviously, adding an index increases the time taken to process an insert, but it couldn't cause actual performance problems, could i?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Feb 14, 2011 11:54 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Feb 2011 10:53:18 GMT</pubDate>
    <dc:creator>matt</dc:creator>
    <dc:date>2011-02-14T10:53:18Z</dc:date>
    <item>
      <title>INSERT into BKPF - index causing a problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668286#M1574824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In a standard SAP transaction, there is the statement INSERT BKPF. The SQL trace shows this statement can take a long time to execute. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The oracle SQL is &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SQL Statement
----------------------------------------------------------------------------------------------------------------------
INSERT
INTO
  "BKPF"
VALUES
(
  :A0 , :A1 , :A2 , :A3 , :A4 , :A5 , :A6 , :A7 , :A8 , :A9 , :A10 , :A11 , :A12 , :A13 , :A14 ,
  :A15 , :A16 , :A17 , :A18 , :A19 , :A20 , :A21 , :A22 , :A23 , :A24 , :A25 , :A26 , :A27 , :A28 ,
  :A29 , :A30 , :A31 , :A32 , :A33 , :A34 , :A35 , :A36 , :A37 , :A38 , :A39 , :A40 , :A41 , :A42 ,
  :A43 , :A44 , :A45 , :A46 , :A47 , :A48 , :A49 , :A50 , :A51 , :A52 , :A53 , :A54 , :A55 , :A56 ,
  :A57 , :A58 , :A59 , :A60 , :A61 , :A62 , :A63 , :A64 , :A65 , :A66 , :A67 , :A68 , :A69 , :A70 ,
  :A71 , :A72 , :A73 , :A74 , :A75 , :A76 , :A77 , :A78 , :A79 , :A80 , :A81 , :A82 , :A83 , :A84 ,
  :A85 , :A86 , :A87 , :A88 , :A89 , :A90 , :A91 , :A92 , :A93 , :A94 , :A95 , :A96 , :A97 , :A98
)


Execution Plan

----------------------------------------------------------------------------------------------------------------------
System: xxx

---------------------------------------------------------------------------------
| Id  | Operation                | Name | Rows  | Bytes | Cost (%CPU)| Time     |
---------------------------------------------------------------------------------
|   0 | INSERT STATEMENT         |      |     1 |   369 |     1   (0)| 00:00:01 |
|   1 |  LOAD TABLE CONVENTIONAL | BKPF |       |       |            |          |
---------------------------------------------------------------------------------

Query Block Name / Object Alias (identified by operation id):
-------------------------------------------------------------

   1 - INS$1&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could a badly defined index causing an INSERT performance problem? Obviously, adding an index increases the time taken to process an insert, but it couldn't cause actual performance problems, could i?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Feb 14, 2011 11:54 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 10:53:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668286#M1574824</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2011-02-14T10:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT into BKPF - index causing a problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668287#M1574825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if this is a single insert in a single transaction, additional indexes are not that costy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course the index has to be maintained upon insert, and if it is a unique one,&lt;/P&gt;&lt;P&gt;additional checks need to be done. So this might cost a bit, but it should not be that bad.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a table has many indexes, you should not rebuild them frequently all at the same time.&lt;/P&gt;&lt;P&gt;There are sometimes benfits for read in doing so, but for inserts, you will soon face the&lt;/P&gt;&lt;P&gt;need to do blocksplits for additional inserts and those are expensive, esp. if you have to do&lt;/P&gt;&lt;P&gt;some of them on more than one index for the same insert.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have many inserts in parallel, you might also face db-lock situations, either data related&lt;/P&gt;&lt;P&gt;(all databases) or db-specific. For Oracle that might be related to the INITRANS parameter of &lt;/P&gt;&lt;P&gt;either tables or indexes. Those can be identified by some ITL-contention wait event in the session monitor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How many Indexes has your BKPF? 5-7 are not unusual for BKPF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Volker&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 12:37:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668287#M1574825</guid>
      <dc:creator>volker_borowski2</dc:creator>
      <dc:date>2011-02-14T12:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT into BKPF - index causing a problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668288#M1574826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can see your SQL statement, but where is the problem? Neither costs nor time are seeming to become a problem!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any further information?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 13:01:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668288#M1574826</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-14T13:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT into BKPF - index causing a problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668289#M1574827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please post the ST05 summary data. How long does it take to insert one record?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have to compare that time with your answer for Volker's questions (number of indexes, parallelism involved)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 13:43:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668289#M1574827</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2011-02-14T13:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT into BKPF - index causing a problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668290#M1574828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When was the last database re-org and do you have any idea of how many records were inserted since then?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 14:11:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668290#M1574828</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-14T14:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT into BKPF - index causing a problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668291#M1574829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's a single insert. There are 6 indexes on the table. On one run it took 300'000 microseconds. The next time the statement executed, it to 30'000.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I should have explained further - sorry! The reason for posting the question is that we added an index, and testing has shown some transactions are slower than before. Certain groups are saying it's because of the indexes, and demanding they be removed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the load on the machine is certainly not constant. My feeling is that the "after" testing results - of the order of 20s for a transaction rather than 15s - is more likely to be caused by normal variation within the instance - db contention, load, network etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I traced the access paths on BKPF for the transactions in question (VA01, VF01 and the like). and found that the new index wasn't used. I just wanted to be sure that there wasn't some esoteric scenario where adding an index would dramatically increase the runtime of an insert. This is quite sensitive as we &lt;EM&gt;did&lt;/EM&gt; have trouble with index conflict on read, which took quite a long time to resolve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there's still resistance, I'll suggest a reorg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 15:00:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668291#M1574829</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2011-02-14T15:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT into BKPF - index causing a problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668292#M1574830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this in the production or a test system?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 15:09:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668292#M1574830</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-14T15:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT into BKPF - index causing a problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668293#M1574831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Test&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 15:22:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668293#M1574831</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2011-02-14T15:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: INSERT into BKPF - index causing a problem?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668294#M1574832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might try creating a batch input session using RFBIBL00 (or some other method) to create say 1,000 transactions and process it when system load is light. Then remove the index (making sure it is removed at the database level as well) and re-process the transactions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the run times are comparable, then the index is not the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 16:11:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-bkpf-index-causing-a-problem/m-p/7668294#M1574832</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-14T16:11:57Z</dc:date>
    </item>
  </channel>
</rss>

