<?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 Re: Insert statement performance in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247826#M1720525</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;none of these options are viable .. for indexses- ther isnt any index in table . its a simple ztable with 7-8 columns. &lt;/P&gt;&lt;P&gt;is there any way to use native sql ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Jan 2013 08:37:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2013-01-24T08:37:43Z</dc:date>
    <item>
      <title>Insert statement performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247824#M1720523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing a performance problem in insert stament . the statement is inserting aroung 200000 records in ztable from internal table and it takes more than an hour . Is there any way to optimize this insert statement . ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Madhumati&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 08:13:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247824#M1720523</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-01-24T08:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Insert statement performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247825#M1720524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI&gt;How did you analyze performance, insure the performance problem is related to SQL insertions.&lt;/LI&gt;&lt;LI&gt;Upgrade the database server...&lt;/LI&gt;&lt;LI&gt;Drop secondary indexes before insert and rebuild them afterwards.&lt;/LI&gt;&lt;LI&gt;Parallelism may or not improve performance, depend on database (perform some tests, more process may improve performance but lock management may, and will, hinder performance.)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 08:29:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247825#M1720524</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2013-01-24T08:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Insert statement performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247826#M1720525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;none of these options are viable .. for indexses- ther isnt any index in table . its a simple ztable with 7-8 columns. &lt;/P&gt;&lt;P&gt;is there any way to use native sql ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 08:37:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247826#M1720525</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-01-24T08:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Insert statement performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247827#M1720526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Might be problem with redo buffers filling up (not sure about the exact term, varies by database), all DB changes are recorded for potential rollback until you do a COMMIT WORK. So try inserting blocks of e.g. 10K records at a time, do a COMMIT WORK (or call function DB_COMMIT for a database commit only), process the next block etc., and see if this improves things.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 08:42:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247827#M1720526</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2013-01-24T08:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: Insert statement performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247828#M1720527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Try to use TABLE INDEX. It might do the trick. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Vignesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 08:57:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247828#M1720527</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-01-24T08:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Insert statement performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247829#M1720528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, this was the last post in the thread that made sense. &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/1151/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Good point, Thomas.&lt;/P&gt;&lt;P&gt;Inserting data in packages and committing is a right thing to do.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2013 09:39:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247829#M1720528</guid>
      <dc:creator>yuri_ziryukin</dc:creator>
      <dc:date>2013-01-24T09:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Insert statement performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247830#M1720529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Far too less information for a competent answer!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adding indexes to optimize an INSERT from ITAB ... will not help at all, for no database type.&lt;/P&gt;&lt;P&gt;It will do things worse, because more actions have to be done on inserts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Packaging and increasing the commit ratio (sorry, I hate to contradict Yuri and Thomas)&lt;/P&gt;&lt;P&gt;will only help for inserts, if you have a concurrent change activity on this table.&lt;/P&gt;&lt;P&gt;If you are processing alone on that table, going for ALL-or-NOTHING is better &lt;/P&gt;&lt;P&gt;for the performance and it might be easier in terms of transaction logic, &lt;/P&gt;&lt;P&gt;because, if you did commit 50 packs but get an error for pack 51, &lt;/P&gt;&lt;P&gt;how do you roll back the 50 committed ones?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An insert is pretty simple. An INSERT form ITAB is even better, because&lt;/P&gt;&lt;P&gt;it is implemented as an array insert, if the underlying DB permits this type of operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now 200k rows in one hour seems extremly slow to me.&lt;/P&gt;&lt;P&gt;How much is that in MB when you did insert this stuff?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without knowing any more details, I'd assume:&lt;/P&gt;&lt;P&gt;- lousy/defective hardware&lt;/P&gt;&lt;P&gt;- high change concurrency on the table affected (locks involved)&lt;/P&gt;&lt;P&gt;- strange datatypes involved (long raw? LOBs?)&lt;/P&gt;&lt;P&gt;- slow network, if this is running on an application server remote to the DB&lt;/P&gt;&lt;P&gt;- extrem high number of index keys per leaf block&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What DB type are you using?&lt;/P&gt;&lt;P&gt;If Oracle what release and in what type of tablespace is your table stored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for indexes (2): Every SAP table has at least a primary key (index 0).&lt;/P&gt;&lt;P&gt;If this is oracle, check how many rows the table has and how many blocks the index 0 has.&lt;/P&gt;&lt;P&gt;if you have a significant number of index keys per index block, it might help&lt;/P&gt;&lt;P&gt;to do a rebuild of the PK while adjusting the INITRANS parameter.&lt;/P&gt;&lt;P&gt;It defaults to 2 on SAP-Oracle DBs,&lt;/P&gt;&lt;P&gt;Setting it to 20 might help, but will cost some space (I think it was 24 bytes per slot).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is Oracle, watch your statement in transaction ST04/ST04old &lt;/P&gt;&lt;P&gt;and check out if there is a specific wait event listed.&lt;/P&gt;&lt;P&gt;if you find "ITL waits" go for the INITRANS rebuild mentioned above&lt;/P&gt;&lt;P&gt;if you find log waits / logfile switch waits / ... increase redolog size and/or log_buffer&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try these for startes, but I could not guarantee for anything based on the data given.&lt;/P&gt;&lt;P&gt;Time to talk to your DBA I think&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Volker&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Jan 2013 18:06:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247830#M1720529</guid>
      <dc:creator>volker_borowski2</dc:creator>
      <dc:date>2013-01-26T18:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Insert statement performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247831#M1720530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;Volker Borowski wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Packaging and increasing the commit ratio (sorry, I hate to contradict Yuri and Thomas)&lt;/P&gt;&lt;P&gt;will only help for inserts, if you have a concurrent change activity on this table.&lt;/P&gt;&lt;P&gt;If you are processing alone on that table, going for ALL-or-NOTHING is better &lt;/P&gt;&lt;P&gt;for the performance and it might be easier in terms of transaction logic, &lt;/P&gt;&lt;P&gt;because, if you did commit 50 packs but get an error for pack 51, &lt;/P&gt;&lt;P&gt;how do you roll back the 50 committed ones? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hello Volker,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your comment was so interesting that I decided to make some tests out of it.&lt;/P&gt;&lt;P&gt;Here are my results.&lt;/P&gt;&lt;P&gt;The DB table contains 2 fields:&lt;/P&gt;&lt;P&gt;- GUID (RAW16) -&amp;gt; primary key&lt;/P&gt;&lt;P&gt;- DESCR (CHAR40)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only primary key exists for the table.&lt;/P&gt;&lt;P&gt;After each iteration I have deleted and recreated the table using DB utility.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Source code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;REPORT&amp;nbsp; ZYZ_TEST.&lt;/P&gt;&lt;P&gt;parameters: p_type type boolean.&lt;/P&gt;&lt;P&gt;types: begin of ts_test,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; guid type guid,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; descr type char40,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end of ts_test.&lt;/P&gt;&lt;P&gt;data: ls_test type ts_test,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lt_test type standard table of ts_test,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lt_test2 type standard table of ts_test,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_start TYPE i,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_stop TYPE i,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_diff type i.&lt;/P&gt;&lt;P&gt;if p_type = 'X'.&lt;/P&gt;&lt;P&gt;&amp;nbsp; do 10000000 times.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALL FUNCTION 'GUID_CREATE'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IMPORTING&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EV_GUID_16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = ls_test-guid&lt;BR /&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EV_GUID_22&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&lt;BR /&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EV_GUID_32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ls_test-descr = ls_test-guid.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; append ls_test to lt_test.&lt;BR /&gt;&amp;nbsp; enddo.&lt;/P&gt;&lt;P&gt;&amp;nbsp; GET RUN TIME FIELD lv_start.&lt;/P&gt;&lt;P&gt;&amp;nbsp; insert zyz_test from table lt_test.&lt;/P&gt;&lt;P&gt;&amp;nbsp; commit work.&lt;BR /&gt;&amp;nbsp; GET RUN TIME FIELD lv_stop.&lt;BR /&gt;&amp;nbsp; lv_stop = lv_stop - lv_start.&lt;/P&gt;&lt;P&gt;&amp;nbsp; write: 'Duration = ', lv_stop.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;&amp;nbsp; do 200 times.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do 50000 times.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CALL FUNCTION 'GUID_CREATE'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IMPORTING&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EV_GUID_16&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = ls_test-guid&lt;BR /&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EV_GUID_22&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&lt;BR /&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EV_GUID_32&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ls_test-descr = ls_test-guid.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; append ls_test to lt_test.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; enddo.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GET RUN TIME FIELD lv_start.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; insert zyz_test from table lt_test.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; commit work.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GET RUN TIME FIELD lv_stop.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_stop = lv_stop - lv_start.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lv_diff = lv_diff + lv_stop.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; refresh lt_test.&lt;BR /&gt;&amp;nbsp; enddo.&lt;/P&gt;&lt;P&gt;&amp;nbsp; write: 'Duration = ', lv_diff.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st run: 200.000 records.&lt;/P&gt;&lt;P&gt;Inserting all together + 1 commit runtimes:&lt;/P&gt;&lt;P&gt;2072 ms&lt;/P&gt;&lt;P&gt;2331 ms&lt;/P&gt;&lt;P&gt;2549 ms&lt;/P&gt;&lt;P&gt;2301 ms&lt;/P&gt;&lt;P&gt;Inserting by packages of 50.000 (4 in total) + 4 commits:&lt;/P&gt;&lt;P&gt;2660 ms&lt;/P&gt;&lt;P&gt;2860 ms&lt;/P&gt;&lt;P&gt;2790 ms&lt;/P&gt;&lt;P&gt;2409 ms&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here we can see that 1 commit and large insert is slightly faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2nd run: with 2.000.000 records.&lt;/P&gt;&lt;P&gt;Inserting all together + 1 commit:&lt;/P&gt;&lt;P&gt;40423 ms&lt;/P&gt;&lt;P&gt;32744 ms&lt;/P&gt;&lt;P&gt;Inserting by packages of 50.000 (40 in total) + 40 commits:&lt;/P&gt;&lt;P&gt;43127 ms&lt;/P&gt;&lt;P&gt;35500 ms&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still one large insert is faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I decided to increase the volume to 10.000.000 records.&lt;/P&gt;&lt;P&gt;Inserting all together + 1 commit:&lt;/P&gt;&lt;P&gt;470.520 ms&lt;/P&gt;&lt;P&gt;386.099 ms&lt;/P&gt;&lt;P&gt;Inserting by packages of 50.000 (200 in total) + 200 commits:&lt;/P&gt;&lt;P&gt;389.897 ms&lt;/P&gt;&lt;P&gt;401.416 ms&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here the results are varying, it's difficult to tell that one large insert is always faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also remember ORA-1555 issue. Long running transactions without COMMIT might cause ORA-1555 if the rollback segment is overwritten...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the transactional correctness issue, if previous packages should be rolled back, - it depends on the program logic. I can hardly imagine normal transaction that requires inserting so much data. Normally this happens for some kind of initial load or mass processing. And there, it's even better if you do not start from scratch and can continue after fixing your error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Yuri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 12:31:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247831#M1720530</guid>
      <dc:creator>yuri_ziryukin</dc:creator>
      <dc:date>2013-01-28T12:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Insert statement performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247832#M1720531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yuri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;some interesting results, though I like to direct attention to some aspects:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GUIDs: Guids have been developed to support massive parallel inserts.&lt;/P&gt;&lt;P&gt;Since the "flickering" bits are somewhere in the middle of the field. Looking at &lt;/P&gt;&lt;P&gt;a B-Tree GUID index, an insert will hit the B-tree at very distinct places with each new record, &lt;/P&gt;&lt;P&gt;thus avoiding many transaction "fighting" for the "right" end of the B-Tree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is perfect when 50 jobs are trying to insert at the same time, but is &lt;/P&gt;&lt;P&gt;a bit harder when in a single transaction. The Index will utilize more space in the end&lt;/P&gt;&lt;P&gt;because during the insert the leafblocks will be mostly processed be with 50:50 block splits.&lt;/P&gt;&lt;P&gt;With a sequence oracle should detect "right end inserts" for the PK and thus &lt;/P&gt;&lt;P&gt;doing 90:10 splits for the index blocks. This should use less index space and &lt;/P&gt;&lt;P&gt;therefore less undo resources.&lt;/P&gt;&lt;P&gt;Might be irrelevant for low volume transactions, but I like to see how this works&lt;/P&gt;&lt;P&gt;in your big testcase with a normal ascending integer key instead of a guid.&lt;/P&gt;&lt;P&gt;I'd expect both cases to be quicker, and the relation between both shrinking.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second: Your are using a very short row length. And a very short key. This means, you are &lt;/P&gt;&lt;P&gt;utilizing the space of the table and the index very effectively in terms of a "per block" ratio.&lt;/P&gt;&lt;P&gt;I think you will get more overhead trouble as longer keys and average row length are, &lt;/P&gt;&lt;P&gt;because you are hitting space- and index-management more often then.&lt;/P&gt;&lt;P&gt;Since your rows are so short, I assume your first two examples get away without&lt;/P&gt;&lt;P&gt;any noticeable log-space problems, while the big one might face waits for log information&lt;/P&gt;&lt;P&gt;to be written. I'd like to know with how many blocks you end up for data and index.&lt;/P&gt;&lt;P&gt;Would be a curious thing to see what happens when the average row length goes to ~ 500 byte.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the "big" testcase, it might be relevant how your logfiles are filled and how big these are.&lt;/P&gt;&lt;P&gt;So you should do a logswitch directly before you start the measurement, because if one of &lt;/P&gt;&lt;P&gt;the candidates would draw a "checkpoint incomplete" wait due to an unfortunate log start point&lt;/P&gt;&lt;P&gt;that would be unfair &lt;SPAN __jive_emoticon_name="sad" __jive_macro_name="emoticon" class="jive_macro jive_macro_emoticon jive_emote" src="https://community.sap.com/1151/images/emoticons/sad.gif"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 1555 is indeed a commit related error, but it is rare, that a single modifying transaction&lt;/P&gt;&lt;P&gt;gets it, esp. with new undo managemnt in Oracle. &lt;/P&gt;&lt;P&gt;It always requires concurrency to occur.&lt;/P&gt;&lt;P&gt;Does not seem to be the case here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And yes, if this is an initial load, or the data contains an identifier that allows to&lt;/P&gt;&lt;P&gt;identify what data needs to be taken back (a pack id, a date, whatever), no problem.&lt;/P&gt;&lt;P&gt;But one should be sure about how to work on this.&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, 28 Jan 2013 19:06:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247832#M1720531</guid>
      <dc:creator>volker_borowski2</dc:creator>
      <dc:date>2013-01-28T19:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Insert statement performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247833#M1720532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;changing the records to multiple inserts has worked and the performance is much better now. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2013 13:01:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-statement-performance/m-p/9247833#M1720532</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-02-12T13:01:37Z</dc:date>
    </item>
  </channel>
</rss>

