Hitachi

Hitachi Advanced Database Application Development Guide


6.1.4 Information displayed in the tree view

The tree view displays information for each query, such as the table retrieval method, table joining method, and subquery processing method, in tree format.

Organization of this subsection

(1) SQL statements executed

One of the following is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   +-TABLE SCAN(ADBUSER01.T2)
Explanation:

A SELECT statement is executed.

(2) Subquery processing methods

One of the following is displayed:

For details about how to process subqueries, see 5.6 How to process subqueries.

Output example
<<Tree View>>

     1 QUERY : 1
     2   SELECT STATEMENT
     3   +-SUBQUERY HASH -FILTER
     4     |-QUERY SCAN(QUERY 2)
     5     +-TABLE SCAN(ADBUSER01.T1)
     6 
     7 QUERY : 2
     8   SUBQUERY HASH
     9   +-TABLE SCAN(ADBUSER01.T2)
Explanation:

Hash execution is applied as the subquery processing method.

Because SUBQUERY HASH is followed by FILTER in tree row number 3, a hash filter is applied during hash execution.

(3) Specification of derived tables

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   +-DERIVED TABLE(D1)
     4     +-QUERY SCAN(QUERY 2)
     5 
     6 QUERY : 2
     7   DERIVED TABLE(D1)
     8   |-CREATE LOCAL WORK TABLE(WORK TABLE 1)
     9   | |-TABLE SCAN(ADBUSER01.T2)
    10   | |-SORTING BYTE
    11   | +-LIMIT 10
    12   |-WORK TABLE SCAN(WORK TABLE 1)
    13   +-LIMIT 10
Explanation:

A derived table is specified in the SELECT statement. The correlation name is displayed in parentheses.

(4) Specification of set operations

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 0
     2   SELECT STATEMENT
     3   +-SET OPERATION
     4     |-QUERY SCAN(QUERY 1)
     5     +-QUERY SCAN(QUERY 2)
     6 
     7 QUERY : 1
     8   QUERY
     9   +-TABLE SCAN(ADBUSER01.T1)
    10 
    11 QUERY : 2
    12   QUERY
    13   +-TABLE SCAN(ADBUSER01.T2)
Explanation:

A set operation is specified in the SELECT statement.

Note that SET OPERATION might be followed by the following item:

Output example
<<Tree View>>
 
     1 QUERY : 3
     2   SELECT STATEMENT
     3   +-DERIVED TABLE(REC)
     4     +-SET OPERATION -RECURSIVE
     5       |-QUERY SCAN(QUERY 1)
     6       +-QUERY SCAN(QUERY 2)
     7
     8 QUERY : 1
     9   QUERY
    10   |-CREATE GLOBAL WORK TABLE(WORK TABLE 1)
    11   | +-TABLE SCAN(ADBUSER01.T1)
    12   +-WORK TABLE SCAN(WORK TABLE 1)
    13
    14 QUERY : 2
    15   QUERY
    16   |-CREATE GLOBAL WORK TABLE(WORK TABLE 2)
    17   | +-WORK TABLE SCAN(WORK TABLE 2)
    18   +-WORK TABLE SCAN(WORK TABLE 2)
Explanation:

An item indicating that a recursive query will be run is included.

After SET OPERATION, the query information displayed first pertains to anchor members. The query information displayed next pertains to recursive members. In the preceding output example, QUERY 1 is the query information about anchor members, and QUERY 2 is the query information about recursive members.

(5) Set operation method specification

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 0
     2   SELECT STATEMENT
     3   +-SET OPERATION -SPECIFIC
     4     |-QUERY SCAN(QUERY 1)
     5     +-QUERY SCAN(QUERY 2)
     6
     7 QUERY : 1
     8   QUERY
     9   |-CREATE LOCAL WORK TABLE(WORK TABLE 1)
    10   | |-TABLE SCAN(ADBUSER01.T1)
    11   | +-SORTING BYTE -DISTINCT
    12   +-WORK TABLE SCAN(WORK TABLE 1)
    13
    14 QUERY : 2
    15   QUERY
    16   |-CREATE LOCAL WORK TABLE(WORK TABLE 2)
    17   | |-TABLE SCAN(ADBUSER01.T2)
    18   | +-SORTING BYTE -DISTINCT
    19   +-WORK TABLE SCAN(WORK TABLE 2)
Explanation:

The set operation method specification specified in the SELECT statement is enabled.

(6) Query types

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 0
     2   INSERT STATEMENT
     3   +-QUERY SCAN(QUERY 1)
     4 
     5 QUERY : 1
     6   QUERY
     7   +-TABLE SCAN(ADBUSER01.T2) -ORDER
Explanation:

A query expression body is specified in the INSERT statement.

(7) Work table creation information

One of the following is displayed:

A unique work table number is assigned to each work table.

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   |-SUBQUERY
     4   | +-CREATE GLOBAL WORK TABLE(WORK TABLE 1)
     5   |   |-QUERY SCAN(QUERY 2)
     6   |   +-SORTING BYTE
     7   +-INDEX SCAN(ADBUSER01.T1)
     8     +-SUBQUERY
     9       +-WORK TABLE SCAN(WORK TABLE 1)
    10 
    11 QUERY : 2
    12   SUBQUERY
    13   +-TABLE SCAN(ADBUSER01.T2)
Explanation:

A global work table is created in the subquery processing.

(8) Subquery processing method specification

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   |-SUBQUERY -SPECIFIC
     4   | +-CREATE GLOBAL WORK TABLE(WORK TABLE 1)
     5   |   +-QUERY SCAN(QUERY 2)
     6   +-TABLE SCAN(ADBUSER01.T1(A))
     7     +-SUBQUERY
     8       +-WORK TABLE SCAN(WORK TABLE 1)
     9
    10 QUERY : 2
    11   SUBQUERY
    12   +-TABLE SCAN(ADBUSER01.T2)
Explanation:

The subquery processing method specification specified in the SELECT statement is enabled.

(9) Subquery processing delegation specification

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   +-TABLE SCAN(ADBUSER01.T1(A))
     4     +-SUBQUERY LOOP -DELEGATION -USING CACHE
     5       +-QUERY SCAN(QUERY 2)
     6
     7 QUERY : 2
     8   SUBQUERY LOOP
     9   |-SUBQUERY LOOP -SPECIFIC -DELEGATION
    10   | +-QUERY SCAN(QUERY 3)
    11   +-TABLE SCAN(ADBUSER01.T1(B))
    12
    13 QUERY : 3
    14   SUBQUERY LOOP
    15   +-TABLE SCAN(ADBUSER01.T1(C))
Explanation:

The subquery processing delegation method specification specified in the SELECT statement is enabled.

(10) Subquery cache usage information

The following information is displayed:

For details about nested loops row value execution, see (2) Nested loops row value execution in 5.6.3 Methods for processing subqueries that contain an external reference column.

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   +-TABLE SCAN(ADBUSER01.T1)
     4     +-SUBQUERY LOOP -USING CACHE
     5       +-QUERY SCAN(QUERY 2)
     6 
     7 QUERY : 2
     8   SUBQUERY LOOP
     9   +-TABLE SCAN(ADBUSER01.T2)
Explanation:

Nested loops row value execution is used to process the subquery, and the results of the subquery are stored using cache.

(11) Specification of table function derived tables

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   +-TABLE FUNCTION DERIVED TABLE(T4)
     4     +-TABLE SCAN(ADBUSER01.T4)
Explanation:

A table function derived table is specified in the SELECT statement. The information in parentheses is the correlation name.

(12) Processing method for duplicate removal

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   |-KEY SCAN(ADBUSER01.T1)
     4   |-GLOBAL HASH UNIQUE
     5   +-GROUPING
Explanation:

Global hash grouping is used for the grouping method to eliminate duplicate retrieval results.

(13) Grouping methods

One of the following is displayed:

For details about grouping methods, see 5.7 Grouping methods.

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   |-TABLE SCAN(ADBUSER01.T1)
     4   +-GLOBAL HASH GROUPING
Explanation:

Global hash grouping is performed during the grouping method.

Following the grouping method information, the following item might be displayed:

(14) HAVING clause specification

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   |-TABLE SCAN(ADBUSER01.T1)
     4   |-GLOBAL HASH GROUPING
     5   +-HAVING
Explanation:

The HAVING clause is specified in the SELECT statement.

(15) Sort processing

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   |-CREATE LOCAL WORK TABLE(WORK TABLE 1)
     4   | |-TABLE SCAN(ADBUSER01.T1)
     5   | +-SORTING BYTE
     6   +-WORK TABLE SCAN(WORK TABLE 1)
Explanation:

Sort processing is performed according to the specified ORDER BY clause.

(16) Information about duplicate removal

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2 SELECT STATEMENT
     3 |-CREATE LOCAL WORK TABLE(WORK TABLE 1)
     4 | |-KEY SCAN(ADBUSER01.T1)
     5 | +-SORTING BYTE -DISTINCT
     6 +-WORK TABLE SCAN(WORK TABLE 1)
Explanation:

The item indicating that duplicate removal will be performed during sort processing is output.

Output example
<<Tree View>>
 
     1 QUERY : 1
     2 SELECT STATEMENT
     3 |-CREATE LOCAL WORK TABLE(WORK TABLE 1)
     4 | |-KEY SCAN(ADBUSER01.T1) -DISTINCT
     5 | +-SORTING BYTE -DISTINCT
     6 +-WORK TABLE SCAN(WORK TABLE 1)
Explanation:

Items indicating that duplicate removal will be performed during key scan processing and sort processing are included.

(17) SELECT deduplication method specification

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   |-CREATE LOCAL WORK TABLE(WORK TABLE 1)
     4   | |-TABLE SCAN(ADBUSER01.T1)
     5   | +-SORTING BYTE -SPECIFIC -DISTINCT
     6   +-WORK TABLE SCAN(WORK TABLE 1)
Explanation:

The SELECT deduplication method specification specified in the SELECT statement is enabled.

(18) LIMIT clause specification

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   |-CREATE LOCAL WORK TABLE(WORK TABLE 1)
     4   | |-TABLE SCAN(ADBUSER01.T1)
     5   | |-SORTING BYTE
     6   | +-LIMIT ? PARAMETER,5
     7   |-WORK TABLE SCAN(WORK TABLE 1)
     8   +-LIMIT ? PARAMETER,5
Explanation:

A LIMIT clause containing a dynamic parameter for the offset row count and 5 for the limit row count is specified.

(19) Specification of window functions

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   |-CREATE LOCAL WORK TABLE(WORK TABLE 1)
     4   | |-TABLE SCAN(ADBUSER01.T1)
     5   | +-SORTING BYTE
     6   |-WORK TABLE SCAN(WORK TABLE 1)
     7   +-WINDOW
Explanation:

A window function is executed according to its specification.

(20) Table retrieval method

One of the following is displayed:

For details about table scans, index scans, and key scans, see 5.1 How to retrieve tables.

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   +-INDEX SCAN(ADBUSER01.T1)
Explanation:

An index scan is performed in the table T1 retrieval processing.

(21) Table-data storage format

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   +-TABLE SCAN(ADBUSER01.T1) -COLUMN STORE
Explanation:

The table-data storage format of table T1 is column store format.

(22) Sequential execution

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   +-NESTED LOOP JOIN
     4     |-TABLE SCAN(ADBUSER01.T2)
     5     +-INDEX SCAN(ADBUSER01.T1) -ORDER
Explanation:

In the table T1 retrieval processing, an index scan is performed using the sequential execution method.

(23) Index specification

One of the following is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   +-INDEX SCAN(ADBUSER01.T1) -SPECIFIC
Explanation:

An index scan is performed in the table T1 retrieval processing with an index specification specified in the SELECT statement enabled.

(24) Collecting cost information

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   +-TABLE SCAN(ADBUSER01.T3) -USING COST
Explanation:

Cost information was collected for the table T3.

(25) Work table scan

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   |-SUBQUERY
     4   | +-CREATE GLOBAL WORK TABLE(WORK TABLE 1)
     5   |   |-QUERY SCAN(QUERY 2)
     6   |   +-SORTING BYTE
     7   +-INDEX SCAN(ADBUSER01.T1)
     8     +-SUBQUERY
     9       +-WORK TABLE SCAN(WORK TABLE 1)
    10 
    11 QUERY : 2
    12   SUBQUERY
    13   +-TABLE SCAN(ADBUSER01.T2)
Explanation:

A work table is scanned in the subquery processing.

Note that you might encounter circumstances in which the row IDs of a table specified in a FROM clause are stored in a work table created when executing an SQL statement that specifies an ORDER BY clause. In this case, data might be retrieved from data pages using these row IDs immediately after the work table is retrieved. For details about the purposes and columns of work tables, see 5.10 Considerations when executing an SQL statement that creates work tables.

(26) Query scan

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   +-SUBQUERY HASH
     4     |-QUERY SCAN(QUERY 2)
     5     +-TABLE SCAN(ADBUSER01.T1)
     6 
     7 QUERY : 2
     8   SUBQUERY HASH
     9   +-TABLE SCAN(ADBUSER01.T2)
Explanation:

A query scan is performed.

In this example, the query scan indicated as QUERY : 2 displayed in tree row number 7 is performed.

Example of the executed SELECT statement

SELECT * FROM "T1" WHERE "C1"=(SELECT "C2" FROM "T2" WHERE "C1"="T1"."C1")

(27) Table joining methods

One of the following is displayed:

For details about table joining methods, see 5.5 Table joining methods.

Output example (NESTED LOOP JOIN)
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   +-NESTED LOOP JOIN
     4     |-TABLE SCAN(ADBUSER01.T2)
     5     +-INDEX SCAN(ADBUSER01.T1) -ORDER
Explanation:
  • A nested loop join is performed to join tables T1 and T2.

  • If the table joining method is nested loop join, the information is displayed under NESTED LOOP JOIN in order, beginning with the outer table. In this example, the information in tree row number 4 is for the outer table and the information in tree row number 5 is for the inner table.

Output example (HASH JOIN)
<<Tree View>>

     1 QUERY : 1
     2   SELECT STATEMENT
     3   +-HASH JOIN -FILTER
     4     |-TABLE SCAN(ADBUSER01.T1)
     5     +-TABLE SCAN(ADBUSER01.T2)
Explanation:
  • A hash join is performed to join tables T1 and T2.

  • If the table joining method is hash join, information for the outer table and the inner table for hash join is displayed in this order under HASH JOIN. In this example, the information in tree row number 4 is for the outer table and the information in tree row number 5 is for the inner table.

  • Because HASH JOIN is followed by FILTER in tree row number 3, a hash filter is applied during hash join.

(28) Join method specification

Either of the following is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   +-HASH JOIN -SPECIFIC
     4     |-TABLE SCAN(ADBUSER01.T1(A))
     5     +-TABLE SCAN(ADBUSER01.T2(B))
Explanation:

The join method specification specified in the SELECT statement is enabled, and a hash join was executed in the join processing for the table.

(29) Scan information for table value constructors

The following information is displayed:

Output example
<<Tree View>>
 
     1 QUERY : 1
     2   SELECT STATEMENT
     3   +-NESTED LOOP JOIN
     4     |-TABLE SCAN(ADBUSER01.T1)
     5     +-DERIVED TABLE(DT)
     6     +-TABLE VALUE CONSTRUCTOR SCAN
Explanation:

Table value constructors are scanned.