<?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: Update databse from internal table statement not using index in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-databse-from-internal-table-statement-not-using-index/m-p/5038870#M1171783</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;... as often there are recommendations in this forum which makes me wonder, how people overestimate their knowledge!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Updates and Deletes do of course use indexes, as can be seen in the SQL Trace (use explain).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inserts don't use indexes, because in many databases inserts are just done somewhere, But also with the INSERT, the primary key is the constraint for the uniqueness condition, duplicate keys are not allowed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Coming to the original question, what is you actually coding for the update?&lt;/P&gt;&lt;P&gt;What is the table, which fields are in the internal table and what are the indexes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Jan 2009 16:16:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-02T16:16:02Z</dc:date>
    <item>
      <title>Update databse from internal table statement not using index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-databse-from-internal-table-statement-not-using-index/m-p/5038865#M1171778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are updating a databse table from a file. The file has a couple of fields which have data different from what the database has (non-primary fields :). We upload the file data into an internal table and then update the database table from internal table. At a time, internal table is supposed to have 10,000 records. I did SQL trace and found that the update statement is not making use of the databse index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should not the update statement here be using the table index (for primary key)? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Munish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2008 01:21:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-databse-from-internal-table-statement-not-using-index/m-p/5038865#M1171778</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-31T01:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Update databse from internal table statement not using index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-databse-from-internal-table-statement-not-using-index/m-p/5038866#M1171779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;While Updating the DB table using the either INSERT/UPDATE/MODIFY the index will never be used.&lt;/P&gt;&lt;P&gt;You need to ensure that you are not violating the update procedure(Unique entries) for the key fields.&lt;/P&gt;&lt;P&gt;Index will be used while reading(SELECT).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Hakim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2008 06:15:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-databse-from-internal-table-statement-not-using-index/m-p/5038866#M1171779</guid>
      <dc:creator>abdul_hakim</dc:creator>
      <dc:date>2008-12-31T06:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Update databse from internal table statement not using index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-databse-from-internal-table-statement-not-using-index/m-p/5038867#M1171780</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;&lt;/P&gt;&lt;P&gt;Do like below.&lt;/P&gt;&lt;P&gt;TABLES:&lt;/P&gt;&lt;P&gt;  DATA_BASE_TABLE_NAME.&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  WA TYPE DATA_BASE_TABLE_NAME.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB INTO WA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  MODIFY DATA_BASE_TABLE_NAME FROM  WA.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC EQ 0.&lt;/P&gt;&lt;P&gt;    COMMIT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rama Chary.Pammi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2008 06:31:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-databse-from-internal-table-statement-not-using-index/m-p/5038867#M1171780</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-31T06:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Update databse from internal table statement not using index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-databse-from-internal-table-statement-not-using-index/m-p/5038868#M1171781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Munish,&lt;/P&gt;&lt;P&gt;Update DB table do not use index. Try to do the mass update always, ref below link-&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_NW04/helpdata/en/fc/eb3a94358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_NW04/helpdata/en/fc/eb3a94358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;look for 'Overwriting Several Lines Using an Internal Table '&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;Nishikant.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jan 2009 21:23:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-databse-from-internal-table-statement-not-using-index/m-p/5038868#M1171781</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-01T21:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Update databse from internal table statement not using index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-databse-from-internal-table-statement-not-using-index/m-p/5038869#M1171782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; While Updating the DB table using the either INSERT/UPDATE/MODIFY the index will never be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do you know that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you ever see the times for a SELECT with index and without index?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So how do the update manage it to be fast?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 10:25:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-databse-from-internal-table-statement-not-using-index/m-p/5038869#M1171782</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-02T10:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Update databse from internal table statement not using index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-databse-from-internal-table-statement-not-using-index/m-p/5038870#M1171783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;... as often there are recommendations in this forum which makes me wonder, how people overestimate their knowledge!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Updates and Deletes do of course use indexes, as can be seen in the SQL Trace (use explain).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inserts don't use indexes, because in many databases inserts are just done somewhere, But also with the INSERT, the primary key is the constraint for the uniqueness condition, duplicate keys are not allowed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Coming to the original question, what is you actually coding for the update?&lt;/P&gt;&lt;P&gt;What is the table, which fields are in the internal table and what are the indexes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 16:16:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-databse-from-internal-table-statement-not-using-index/m-p/5038870#M1171783</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-02T16:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Update databse from internal table statement not using index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-databse-from-internal-table-statement-not-using-index/m-p/5038871#M1171784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Siegfried, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inserts into tables with a primary key (or unique) constraint(s) will use the primary key (or unique key) index(es) to check uniqueness. You may prove this by defining a primary key without an index (in DB2 this is possible) and execute some inserts. You'll see that inserts getting pretty soon very slow. Only for inserts into a tables without unique keys the insert does not access an index. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Ralph&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2009 17:17:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-databse-from-internal-table-statement-not-using-index/m-p/5038871#M1171784</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-02T17:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Update databse from internal table statement not using index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/update-databse-from-internal-table-statement-not-using-index/m-p/5038872#M1171785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A big thanks to all of you! Now the original issue - apologies for the confusion - update was infact using the priamry index. Earlier I was updating database in a lot of 10,000 records. It was taking more time and besides even if update failed for one record, all 10,000 records had to be updated again. It was not to be a periodic activity. So I recoded the code to update database one record at a time and then capture failed updates in a file (single record update fails) - Read 10000 records from the file at a time and then update database one record at a time. That did the job!  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Munish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2009 00:44:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/update-databse-from-internal-table-statement-not-using-index/m-p/5038872#M1171785</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-17T00:44:55Z</dc:date>
    </item>
  </channel>
</rss>

