Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Clarifications on Table Buffer Trace of ST05

former_member186584
Participant
0 Kudos

Hello Experts,

I am not very clear with regards to the "Table Buffer Trace" of ST05. Firstly, I considered the following cases:

Case 1:

DO 3 TIMES.

   SELECT *

          FROM DARTT              ""DARTT is a fully buffered table with 514 records

          INTO TABLE IT_DARTT.

ENDDO.

And the following was the Buffer Trace:

    

                                             Figure 1: Buffer Trace for SELECT..INTO TABLE

Then, I executed the following code:

Case 2:

DO 3 TIMES.

   SELECT *

          FROM DARTT

          INTO WA_DARTT.

   ENDSELECT.

ENDDO.

And the following was the buffer trace:

 

                                   Figure 2: Buffer Trace for SELECT/ENDSELECT

Next, I executed the following code:

Case 3:

DO 3 TIMES.

   SELECT *

          FROM DARTT

          INTO TABLE IT_DARTT

          PACKAGE SIZE 50.

   ENDSELECT.

ENDDO.

The following was the buffer trace:

 

              Figure 3: Buffer Trace for SELECT..INTO TABLE..PACKAGE SIZE/ENDSELECT.

The following are my questions:

(1) In each of the three cases, can I conclude safely that the Table Buffer is being accessed three times? (this is expected since all my select queries are inside a DO 3 TIMES/ENDDO.

(2) If you see Figure 1 (the buffer trace corresponding to Case 1), the value under "Recs" column for every FETCH operation is zero (i.e. the number of records fetched from the buffer in every FETCH operation is zero). Why is it zero? (the table DARTT is NOT empty).

On the other hand, in Figure 2 (the buffer trace corresponding to Case 2), the value under "Recs" column, for FETCH operation is 514 (which means all 514 records of the table are fetched from the buffer).

(3) In Figure 3 (the buffer trace corresponding to Case 3), the value under "Recs" column for FETCH operation is 10. I guess this is because, I have specified package size as 10. Does that mean only 10 records are fetched from the buffer? Then what about the (514-10 = 504 records)? Aren't the other 504 records fetched from the buffer?

I request you to please correct me if I am going wrong in my understanding somewhere.

I am playing around with the buffer trace because I want to know if the table buffer is availed when a SELECT...PACKAGE SIZE../ENDSELECT statement is used on a buffered table.

Thanks for your time and effort.

7 REPLIES 7

volker_borowski2
Active Contributor
0 Kudos

I'll give it a try 🙂

Your first statement actually copies the fully buffered table to an internal table.

I assume that the ABAP processor is detecting this from the statement.

So instead of processing rows, it actually copies the entire buffered table as a complete

memory structure into the memory structure of the target internal table.

This is why you get no information about the processing of rows.

The second one is actually fetching each record one by one and this is exactly what you see.

I am copmpletly clueless about the "packaged" behavior...

Volker

former_member186584
Participant
0 Kudos

A correction in my third question.

"......... I guess this is because, I have specified package size as 10......."

      should actually be -

"

"......... I guess this is because, I have specified package size as 50......."

former_member192616
Active Contributor
0 Kudos

Hi,

regarding your last question: yes, the table buffer is used for "package size" since it is recorded with blue lines in ST05.

Regarding the output i'm not sure i never compared such statements with the output in st05.

For buffered tables you usually would have a key access (part of the primary key) wouldn't you?

Kind regards,

Hermann

0 Kudos

Hi Hermann,

From a theoretical perspective, what is counter-intuitive to me is this - When I specify PACKAGE SIZE n, it means I am giving an explicit instruction to the database. Then how can the system not hit the database, and fetch the records from the buffer (thereby ignoring the explicit instruction to the database)?

Could you please give me your perspective on this? Thanks for your time and effort.

0 Kudos

Hello Muthukumar,

not exactly like this! You are giving an explicit instruction to SAP Database Interface (DBI) which is almost always between your ABAP code and DB (unless you use native SQL). And DBI is the one who is also controlling table buffering stuff.

Regards,

  Yuri

0 Kudos

Hi,

Yuri explained it already. PACKAGE SIZE is an OPEN SQL (no native or stadndard SQL) exetension for the SAP Database Interface.

Run a query with and without package size on a unbuffered table and compare the native

SQL of both in ST05 SQL trace: You will not see any difference there.

Kind regards,

Hermann

former_member194613
Active Contributor
0 Kudos

to use package size with buffered tables does not make sense!

You should not buffer twice.

And I doubt that you will find many buffered tables were the buffered area is large than 10.000! Buffered area = defined bny buffered keys, is whole table for fully buffered table and generic area for generic buffering.

regards      Siegfried