<?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 SQL Expression and SAP buffer in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-expression-and-sap-buffer/m-p/478231#M15668</link>
    <description>&lt;P&gt;Do queries with &lt;A href="https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/index.htm?file=ABAPSQL_EXPR.htm"&gt;SQL expressions&lt;/A&gt; bypass the SAP buffer?&lt;/P&gt;
  &lt;P&gt;As table TCURX is fully buffered, I would expect this query to use the SAP buffer:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;        SELECT SINGLE currdec INTO @number FROM tcurx
          WHERE currkey EQ @currency.
        IF sy-subrc = 0.
          shift = 2 - number.
        ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;but what about this one?&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;        SELECT SINGLE ( 2 - currdec ) INTO @shift FROM tcurx
          WHERE currkey EQ @iv_currency.
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;If this query is buffered, does it means the SQL expression is evaluated by the database interface and not calculated in the database system? &lt;/P&gt;
  &lt;P&gt;JNN&lt;/P&gt;</description>
    <pubDate>Sat, 29 Jul 2017 19:25:53 GMT</pubDate>
    <dc:creator>nomssi</dc:creator>
    <dc:date>2017-07-29T19:25:53Z</dc:date>
    <item>
      <title>SQL Expression and SAP buffer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-expression-and-sap-buffer/m-p/478231#M15668</link>
      <description>&lt;P&gt;Do queries with &lt;A href="https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/index.htm?file=ABAPSQL_EXPR.htm"&gt;SQL expressions&lt;/A&gt; bypass the SAP buffer?&lt;/P&gt;
  &lt;P&gt;As table TCURX is fully buffered, I would expect this query to use the SAP buffer:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;        SELECT SINGLE currdec INTO @number FROM tcurx
          WHERE currkey EQ @currency.
        IF sy-subrc = 0.
          shift = 2 - number.
        ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;but what about this one?&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;        SELECT SINGLE ( 2 - currdec ) INTO @shift FROM tcurx
          WHERE currkey EQ @iv_currency.
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;If this query is buffered, does it means the SQL expression is evaluated by the database interface and not calculated in the database system? &lt;/P&gt;
  &lt;P&gt;JNN&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jul 2017 19:25:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-expression-and-sap-buffer/m-p/478231#M15668</guid>
      <dc:creator>nomssi</dc:creator>
      <dc:date>2017-07-29T19:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expression and SAP buffer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-expression-and-sap-buffer/m-p/478232#M15669</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
  &lt;P&gt;No, SQL Expressions are (mostly) passed to the database, see: &lt;A href="https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/index.htm?file=abapsql_expr.htm" target="test_blank"&gt;https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/index.htm?file=abapsql_expr.htm&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;eg. this is done with buffer:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;SELECT SINGLE 'EUR5' AS currkey, currdec as currdec FROM tcurx
       WHERE currkey EQ 'EUR5'
       INTO @DATA(curr_decimals_w_curr).
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;this is done on database:&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;SELECT SINGLE 'EUR5' AS currkey, currdec * 1 as currdec FROM tcurx
       WHERE currkey EQ 'EUR5'
       INTO @DATA(curr_decimals_w_curr).
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;You can check the buffer usage easily with transaction ST10.&lt;/P&gt;
  &lt;P&gt;There are also some other restrictions for buffering: &lt;A href="https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/index.htm?file=abenbuffer_restrictions.htm" target="test_blank"&gt;https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/index.htm?file=abenbuffer_restrictions.htm&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Sat, 29 Jul 2017 21:31:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-expression-and-sap-buffer/m-p/478232#M15669</guid>
      <dc:creator>Domi</dc:creator>
      <dc:date>2017-07-29T21:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expression and SAP buffer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-expression-and-sap-buffer/m-p/478233#M15670</link>
      <description>&lt;P&gt;Hello Dominik,&lt;/P&gt;
  &lt;P&gt;thanks for your feedback. &lt;/P&gt;
  &lt;P&gt;I could enable &lt;EM&gt;Buffer Trace&lt;/EM&gt; in transaction&lt;STRONG&gt; ST05&lt;/STRONG&gt; and filter for object TCURX to evaluate buffer usage:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/58423-performanceanalysis.png" /&gt;&lt;/P&gt;
  &lt;P&gt;The SAP buffer access is at least 50x faster than DB access (caveat: buffer creation time not included). &lt;/P&gt;
  &lt;P&gt;I can only display cummulated TCURX table statistics in transaction In ST10. Am I missing something?&lt;/P&gt;
  &lt;P&gt;I think the &lt;A href="https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/index.htm?file=abenbuffer_restrictions.htm"&gt;SAP Buffer - Restrictions&lt;/A&gt; section should clearly state that SQL expressions bypass the SAP buffer most of the time.&lt;BR /&gt; &lt;/P&gt;
  &lt;P&gt;best regards,&lt;/P&gt;
  &lt;P&gt;JNN&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 22:29:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-expression-and-sap-buffer/m-p/478233#M15670</guid>
      <dc:creator>nomssi</dc:creator>
      <dc:date>2017-07-31T22:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Expression and SAP buffer</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-expression-and-sap-buffer/m-p/478234#M15671</link>
      <description>&lt;P&gt;For 7.52 the documentation "SAP Buffer - Restrictions" was rewritten and it says:&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;"In the SELECT list, only columns, host variables, and host expressions can be used. No other SQL expressions or aggregate expressions can be used."&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 05:29:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-expression-and-sap-buffer/m-p/478234#M15671</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2017-08-01T05:29:42Z</dc:date>
    </item>
  </channel>
</rss>

