<?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: select count (*) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count/m-p/8283348#M1634033</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;You can already add a SINGLE in front of count:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select SINGLE count(*) from RSPCINSTANCE into rows.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;added: my bad, this won't speed-up the process...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kr,&lt;/P&gt;&lt;P&gt;m.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Manu D'Haeyer on Oct 11, 2011 3:51 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Oct 2011 13:47:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-10-11T13:47:53Z</dc:date>
    <item>
      <title>select count (*)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count/m-p/8283347#M1634032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Observing regularly the rows tables we need a program. We want to have a short list of trhe rows entry.&lt;/P&gt;&lt;P&gt;A test program is the following, it delivers what I want but is very slow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: rows type i,&lt;/P&gt;&lt;P&gt;      rows_1 type i,rows_2 type i,rows_3 type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     START-of-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select count(*) from RSPCINSTANCE into rows.&lt;/P&gt;&lt;P&gt;  select count(*) from  RSBERRORLOG into rows_1.&lt;/P&gt;&lt;P&gt;    select count(*) from RSRWBSTORE into rows_2.&lt;/P&gt;&lt;P&gt;    select count(*) from RSDDSTATAGGRDEF into rows_3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  write: rows,&lt;/P&gt;&lt;P&gt;  / rows_1,&lt;/P&gt;&lt;P&gt;  / rows_2,&lt;/P&gt;&lt;P&gt;  / rows_3,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Do you have any suggestion to speed that statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 12:36:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count/m-p/8283347#M1634032</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-11T12:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: select count (*)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count/m-p/8283348#M1634033</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;You can already add a SINGLE in front of count:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select SINGLE count(*) from RSPCINSTANCE into rows.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;added: my bad, this won't speed-up the process...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kr,&lt;/P&gt;&lt;P&gt;m.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Manu D'Haeyer on Oct 11, 2011 3:51 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 13:47:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count/m-p/8283348#M1634033</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-11T13:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: select count (*)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count/m-p/8283349#M1634034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Henning,&lt;/P&gt;&lt;P&gt;I believe you just want to count the total number of rows for each table, right ?&lt;/P&gt;&lt;P&gt;So no use of WHERE clause or INDEXES, am I correct ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that is the case, then I would suggest you have this program run on a background job and storing the results somewhere (on a Z table for example.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You would then read the counters directly from that Z table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It wouldn't be online data, I know, but could be a solution for your problem nevertheless.&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;/Ricardo Quintas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 13:50:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count/m-p/8283349#M1634034</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-11T13:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: select count (*)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count/m-p/8283350#M1634035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Henning,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what is a business case for counting records in these tables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RSPCINSTANCE - Generic Instance Storage (for process chains?)&lt;/P&gt;&lt;P&gt;RSBERRORLOG - Logs for Incorrect Records&lt;/P&gt;&lt;P&gt;RSRWBSTORE - Storage for binary large objects (Excel workbooks)&lt;/P&gt;&lt;P&gt;RSDDSTATAGGRDEF - Statistics data OLAP: Navigation step / aggregate definition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The RSBERRORLOG table looks like an error log table that should be regularly cleaned.&lt;/P&gt;&lt;P&gt;Regarding RSRWBSTORE, I cannot figure out the idea why someone need to regularly count entries in this table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you also need an absolute exact number of entries? If not, you can try to use the database statistics information to quickly get the number or rows. This information may not be up to date, but the deviation should not be very large if the statistics are regulary updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;  Yuri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 15:11:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count/m-p/8283350#M1634035</guid>
      <dc:creator>yuri_ziryukin</dc:creator>
      <dc:date>2011-10-11T15:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: select count (*)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count/m-p/8283351#M1634036</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;how log does each statement run?&lt;/P&gt;&lt;P&gt;How often do you need this? Once a day? every 15 minutes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general: Speeding up a statement without a WHERE (keep in mind you will have a&lt;/P&gt;&lt;P&gt;"MANDT=" or "CLIENT=" or "RCLNT=" WHERE if one of the tables is client dependent),&lt;/P&gt;&lt;P&gt;works only with &lt;/P&gt;&lt;P&gt;1) giving a smaller physical object than the table&lt;/P&gt;&lt;P&gt;-&amp;gt; create a non unique index on the smallest physical column (or the MANDT,  whatever the field is  ... if clientdependent)&lt;/P&gt;&lt;P&gt;---&amp;gt; bad design, costs overhead for several actions on these tables&lt;/P&gt;&lt;P&gt;would only go for this if fast enough and you need it every 30 minutes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or 2) using parallel query&lt;/P&gt;&lt;P&gt;-&amp;gt; use a hint in the program to achieve this&lt;/P&gt;&lt;P&gt;---&amp;gt; costs overhead for parallel activity anywhere in the system, as it costs cpu and IO resources that others might need.&lt;/P&gt;&lt;P&gt;would only go for this if request is on demand, needs to be speedy, but max. around 10 times a day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In all other cases I'd schedule one or three jobs every 2, 4, or 24 hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Volker&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Oct 2011 16:23:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count/m-p/8283351#M1634036</guid>
      <dc:creator>volker_borowski2</dc:creator>
      <dc:date>2011-10-11T16:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: select count (*)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-count/m-p/8283352#M1634037</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;Perhaps, you could use this program RSTABL11 and the function SAPWL_TABSTAT_SINCE_STARTUP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brgds&lt;/P&gt;&lt;P&gt;Julien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Oct 2011 09:42:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-count/m-p/8283352#M1634037</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-12T09:42:09Z</dc:date>
    </item>
  </channel>
</rss>

