Hitachi

Hitachi Advanced Database Application Development Guide


6.1.5 Information displayed in the details view

The following information is displayed in the details view:

Note that the details view is displayed only when there is detailed information for the query that is being displayed in the query tree.

Organization of this subsection

(1) Information related to table retrieval methods and indexes

The following shows an example of the output format for information related to table retrieval methods and indexes.

Output example

[Figure]

(a) Information related to table retrieval methods

One of the following is displayed as the information related to table retrieval methods:

  • TABLE SCAN

    A table scan is performed in the table retrieval processing.

  • INDEX SCAN(schema-name.table-identifier(query-name-or-correlation-name))

    An index scan is performed in the table retrieval processing. If there is a query name or a correlation name, it is displayed.

  • KEY SCAN

    A key scan is performed in the table retrieval processing.

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

Output example
<<Detail   >>
 
QUERY : 1
     3 INDEX SCAN(ADBUSER01.T1)
       INDEX NAME        : IDX_C1C2
        INDEX TYPE       : B-TREE
        INDEX COLUMN     : C1 ASC (IN)
        INDEX COLUMN     : C2 ASC (>)
       INDEX NAME        : RIDX_C2
        INDEX TYPE       : RANGE
        SKIP COND        : CHUNK (HASH)
        INDEX COLUMN     : C2
Explanation:

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

(b) Information related to indexes

The following shows an output format for the information related to indexes.

Output format (B-tree index)
INDEX NAME        : B-tree-index-name (uniqueness-constraint-information)
 INDEX TYPE       : index-type
 INDEX COLUMN     : indexed-column-name key-value-sort-order (range-search-condition)
  • uniqueness-constraint-information

    If this B-tree index is a unique index, uniqueness constraint information is displayed. One of the following is displayed:

    UNIQUE: This unique index does not violate the uniqueness constraint.

    UNIQUE INVALID: This unique index violates the uniqueness constraint.

  • index-type

    For a B-tree index, B-TREE is displayed as the index type.

  • key-value-sort-order

    Displays the sort order for the key values of the B-tree index that was specified when the B-tree index was defined. One of the following is displayed:

    ASC: The key values are sorted in ascending order.

    DESC: The key values are sorted in descending order.

  • range-search-condition

    Displays one of the following as the range search condition:

    =, <, <=, >, >=, =ANY, BETWEEN({<,<|<,<=|<=,<|<=,<=}), IN, LIKE, IS NULL

Rules for search condition output
  • If no range search condition is specified for an indexed column, none is displayed.

  • If IN table-subquery or quantified-predicate=SOME is specified as the range search condition, =ANY is displayed.

  • If the left side of the comparison predicate is not a single column specification, the HADB server performs equivalent exchange of the search condition. The comparison operator of the comparison predicate after equivalent exchange is output as the search condition.

    Example:

    Search condition specified in WHERE clause of SELECT statement

    WHERE 10 < C1

    Search condition after equivalent exchange by HADB server

    WHERE C1 > 10

    Information output as search condition in access path information

    INDEX COLUMN: C1 ASC (>)

Output format (text index)
INDEX NAME        : text-index-name
 INDEX TYPE       : index-type
 INDEX COLUMN     : indexed-column-name
  • index-type

    For a text index, TEXT is displayed as the index type.

Output format (range index)
INDEX NAME        : range-index-name
 INDEX TYPE       : index-type
 SKIP COND        : range-index-condition-type
 INDEX COLUMN     : indexed-column-name
Output example
<<Detail   >>
 
QUERY : 1
     3 INDEX SCAN(ADBUSER01.T1)
       INDEX NAME        : IDX_C1C2        ...1
        INDEX TYPE       : B-TREE          ...2
        INDEX COLUMN     : C1 ASC (IN)     ...3
        INDEX COLUMN     : C2 ASC (>)      ...3
       INDEX NAME        : RIDX_C2         ...4
        INDEX TYPE       : RANGE           ...5
        SKIP COND        : CHUNK (HASH)    ...6
        INDEX COLUMN     : C2              ...7
Explanation:
  1. Name of the index to be used

  2. Type of the index displayed by INDEX NAME in 1 In this example, IDX_C1C2 is a B-tree index because B-TREE is displayed.

    The information displayed in 1 and 2 indicates that an index scan is performed using B-tree index IDX_C1C2.

  3. Information about B-tree index IDX_C1C2:

    C1, C2: Indexed column

    ASC: Key value sort order

    (IN), (>): Range search condition specification

  4. Name of the index to be used

  5. Type of the index displayed by INDEX NAME in 4 In this example, RIDX_C2 is a range index because RANGE is displayed.

  6. Type of range index condition to be used

    CHUNK: Indicates that range index RIDX_C2 is used for a chunk skip condition.

    (HASH): When a hash join is performed, (HASH) indicates that the range index RIDX_C2 that is defined for a column that is to be matched with a hash table is used. When hash execution is performed as the processing method for a subquery, (HASH) indicates that the range index RIDX_C2 that is defined for a column that is to be matched with a hash table is used.

  7. Indexed column of range index RIDX_C2

Note
  • Information about the B-tree index is displayed when an index scan or a key scan is performed for table retrieval.

    If there are multiple indexed columns, information is displayed for each indexed column. In such a case, the information is displayed in the order the indexed columns were defined in the CREATE INDEX statement.

  • Information about a text index is displayed when an index scan is implemented as the table retrieval method.

  • Information about a range index is displayed whenever there is a range index condition.

(2) Information related to table joining methods

The following shows an example of the output format for information related to table joining methods.

Example of the output format

<<Detail   >>
 
QUERY : 1
     3 HASH JOIN                             ← Table joining method
       JOIN TYPE         : INNER JOIN        ← Join type
       BUILD COLUMN      : ADBUSER01.T1.C3             ← Hash retrieval information
       PROBE COLUMN      : ADBUSER01.T2.C3             ← Hash retrieval information

(a) Table joining method

One of the following is displayed as the table joining method:

  • NESTED LOOP JOIN

    A nested loop join is performed in the table join processing.

  • HASH JOIN

    A hash join is performed in the table join processing.

    If there is an = condition that compares columns in two tables, a hash join might be performed. If there are rows that cannot be processed in the hash table area, work tables might be created.

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

Output example
<<Detail   >>
 
QUERY : 1
     3 HASH JOIN
       JOIN TYPE         : INNER JOIN
       BUILD COLUMN      : ADBUSER01.T1.C3
       PROBE COLUMN      : ADBUSER01.T2.C3
Explanation:

A hash join is applied as the table joining method.

(b) Join type (JOIN TYPE)

One of the following is displayed as JOIN TYPE:

  • CROSS JOIN

    A cross join is specified.

  • INNER JOIN

    An inner join is specified.

  • LEFT OUTER JOIN

    An outer join performed by a LEFT OUTER JOIN is specified.

  • RIGHT OUTER JOIN

    An outer join performed by a RIGHT OUTER JOIN is specified.

  • FULL OUTER JOIN(LEFT)

    An outer join performed by a FULL OUTER JOIN is specified.

  • FULL OUTER JOIN(RIGHT)

    An outer join performed by a FULL OUTER JOIN is specified.

For details about each join method, see the topic Specification format and rules for joined tables in the manual HADB SQL Reference.

Output example
<<Detail   >>
 
QUERY : 1
     3 HASH JOIN
       JOIN TYPE         : INNER JOIN
       BUILD COLUMN      : ADBUSER01.T1.C3
       PROBE COLUMN      : ADBUSER01.T2.C3
Explanation:

An inner join is performed.

Important

INNER JOIN or CROSS JOIN might be converted to a comma join during execution of an SQL statement. In this case, the join type (JOIN TYPE) is not displayed. For details about a comma join, see Explanation of specification format in Specification format and rules for FROM clauses in the manual HADB SQL Reference.

The output rules are as follows:

  • For an SQL statement that creates an internal derived table, the results of expanding the internal derived table are output as the table name and correlation name of the outer table columns and inner table columns for the hash join. For details about internal derived tables and the internal derived table expansion rules, see Internal derived tables in the manual HADB SQL Reference.

(c) Hash retrieval information (BUILD COLUMN and PROBE COLUMN)

When hash join is performed, the following information is displayed as hash retrieval information:

  • BUILD COLUMN

    Information about the joined columns in the outer table

  • PROBE COLUMN

    Information about the joined columns in the inner table

Output example
<<Detail   >>

QUERY : 1
     3 HASH JOIN
       BUILD COLUMN      : ADBUSER01.T1.C1(CREATE FILTER 1)    ...1
       PROBE COLUMN      : ADBUSER01.T2.C1(USE FILTER 1)       ...2
Explanation:
  1. Column name ADBUSER01.T1.C1 of the joined column in the outer table during hash join is displayed.

  2. Column name ADBUSER01.T2.C1 of the joined column in the inner table during hash join is displayed.

If a hash filter is applied during hash join, hash filter information is displayed in the underlined portion.

The output rules are as follows:

  • For BUILD COLUMN or PROBE COLUMN, the column name is displayed in one of the following formats. Output of a correlation name has the highest priority among those column names. If a column name cannot be displayed, three asterisks (***) are displayed.

    • table-name.column-name

    • query-name.column-name

    • correlation-name.column-name

  • If a hash filter is applied during hash join, (CREATE FILTER XXXXX) is displayed for BUILD COLUMN. XXXXX is the number of the hash filter created based on the column value for the displayed column name.

    (USE FILTER XXXXX) is displayed for PROBE COLUMN. XXXXX is the number of the hash filter to be used.

  • For an SQL statement that creates an internal derived table, the results of expanding the internal derived table are output as the table name and correlation name of the outer table columns and inner table columns for the hash join. For details about internal derived tables and the internal derived table expansion rules, see Internal derived tables in the manual HADB SQL Reference.

(3) Information related to set operations

In information related to set operations, the type of set operation is output in the following format:

SET OPERATION TYPE:set-operation-type

One of the following is output as the set operation type:

The following is an example of the output format of information related to set operations:

Output example
<<Detail   >>
 
QUERY : 0
     3 SET OPERATION
       SET OPERATION TYPE : UNION ALL
Explanation:

The set operation UNION ALL is specified.

Notes
  • When a set operation that specifies ALL and one that specifies DISTINCT are specified consecutively in an SQL statement, access path information might be output that interprets the ALL set operation as a DISTINCT set operation. In this case, the set operations that are consecutively specified will appear combined in the output shown in (4) Specification of set operations in 6.1.4 Information displayed in the tree view. The corresponding information related to the set operations will also be combined.

  • If both of the following conditions are met, access path information might be output that interprets the UNION DISTINCT set operation as a UNION ALL set operation.

    • Set operations that are specified consecutively in an SQL statement contain set operations with UNION, UNION ALL, and UNION DISTINCT specified.

    • Hash execution is applied as the method for processing the set operation.

    In this case, the set operations that are consecutively specified will appear combined in the output shown in (4) Specification of set operations in 6.1.4 Information displayed in the tree view. The corresponding information related to the set operations will also be combined.

(4) Information about table function derived tables

In the information about table function derived tables, the names of system-defined functions to be executed are output in the following format:

FUNCTION NAME : schema-name.system-defined-function-name

Either of the following is output as the system-defined function:

The following is an example of the output format of the information about table function derived tables:

Output example
<<Detail   >>

QUERY : 1
     3 TABLE FUNCTION DERIVED TABLE(T5)
       FUNCTION NAME : MASTER.ADB_AUDITREAD
Explanation:

The ADB_AUDITREAD function is specified.

(5) Information about subqueries

If hash execution is applied during subquery processing, hash retrieval information is output in information about subqueries. The following information is output as hash retrieval information:

Output example
<<Detail   >>

QUERY : 1
     3 SUBQUERY HASH
       BUILD COLUMN      : ADBUSER01.T2.C1(CREATE FILTER 1)    ...1
       PROBE COLUMN      : ADBUSER01.T1.C1(USE FILTER 1)       ...2
Explanation:

In the preceding example, hash execution is applied as the method for processing subqueries that do not contain external reference columns.

  1. Column name ADBUSER01.T2.C1 of the column resulting from the subquery is output.

  2. Column name ADBUSER01.T1.C1 of the column to be compared with the result of the subquery specified in the search condition is output.

If a hash filter is applied during hash execution, hash filter information is output in the underlined portion.

The output rules are as follows:

(6) Information about the grouping

When the grouping processing is performed multiple times, information about the grouping (grouping set information) is output in the following format:

GROUPING SET : {table-name|query-name|correlation-name}.grouping-column-name-1-for-grouping-process-1
               {table-name|query-name|correlation-name}.grouping-column-name-2-for-grouping-process-1
                            :
GROUPING SET : {table-name|query-name|correlation-name}.grouping-column-name-1-for-grouping-process-2
               {table-name|query-name|correlation-name}.grouping-column-name-2-for-grouping-process-2
                            :
GROUPING SET : {table-name|query-name|correlation-name}.grouping-column-name-1-for-grouping-process-N
               {table-name|query-name|correlation-name}.grouping-column-name-2-for-grouping-process-N
                            :

The following shows an example of the output format of the information about the grouping.

Example of the output format
<<Detail   >>
QUERY : 1
     5 GLOBAL HASH GROUPING
       GROUPING SET : ADBUSER01.T1.C1
                      ADBUSER01.T1.C2
                      ADBUSER01.T1.C3
       GROUPING SET : ADBUSER01.T2.C1
                      ADBUSER01.T2.C2
       GROUPING SET : ADBUSER01.T3.C1
                      ADBUSER01.T3.C3
Explanation:

A grouping column name is output for each grouping.

If no grouping column name can be output, three asterisks (***) are output.

The output rules are as follows: