Entering content frame

Background documentation EXPLAIN Statement for Joins Locate the document in its SAP Library structure

You can also use the EXPLAIN statement for joins.

Result of the EXPLAIN Statement

·        Display of the order in which the tables are processed when the SELECT statement is executed

·        Display of whether the join column values of the old temporary results table can be accessed directly or through an inversion to the rows of a new table

·        Display of the strategy used to search in the new table, if the rows of this table cannot be accessed directly or using an inversion

Example

EXEC SQL EXPLAIN SELECT one .key ten1 .keyft1, ten2 .keyft2
FROM one, ten1, ten2
WHERE ten1.keyft1 < 100
  AND ten1.ft1    = one.keyf
  AND one.
indf     = ten2.keyft2
  AND ten2.keyft2 < 100;

This EXPLAIN statement produces the following output:

TABLE NAME

COLUMN_
OR_INDEX

STRATEGY

PAGE COUNT

TEN1

ONE

TEN2

 

KEF

KEYFT2

RANGE CONDITION FOR KEY COLUMN

JOIN VIA KEY COLUMN

JOIN VIA KEY COLUMN

RESULT IS COPIED, COSTVALUE IS

1250

125

1463

97

 

 

 

Leaving content frame