02 - Implementation Methods S2
02 - Implementation Methods S2
Implementation Methods
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Query Graphs
Query 2
Query 1
Query 3
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Choice of Access Methods
• The optimizer tries to read and process only the data that is
actually required for the query result set
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Table and Index Access Methods
• There are only two “real” database objects that can be accessed
by the query engine(s):
– Tables
– Indexes
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Permanent Object Access Methods
Table
Radix Index
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Table Scan Access Method
Read the table from beginning to end while applying any selection
criteria from the query.
• Advantages:
– More efficient I/O because of asynchronous prefetch, read ahead,
and large blocking factors.
• Disadvantages:
– All rows in the table are touched and tested even if they're not
needed for the query results.
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Table Scan Access Method
NOTE
• Also known as "sequential access"
• A simple INSERT with VALUES plan uses "sequential access“
but the table is not being scanned
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Table Scan Example
EMPLOYEE Table
Scan WORKDEPT
SELECT *
FROM employee B01
WHERE workdept = 'A01' B01
OR workdept = 'B01' G01
A01
G01
E01
A01
Need to access every *deleted*
row, and test to see if B01
it matches the
A01
selection
F01
*deleted*
B01
C01
A01
F01
A01
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Table Scan Example - Graph
SELECT *
FROM employee
WHERE workdept = 'A01'
OR workdept = 'B01'
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Table Probe Access Method
Reads a row from the table based upon a specific relative record
number (RRN) value derived from some other method. This results in
a random I/O operation against the table.
• Advantages:
– Smaller disk I/O operations can be used
• Potential disadvantages:
– May not be optimal if a large number of rows are selected resulting in
random disk I/O
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Table Probe Example
Employee Table
SELECT * RRN WORKDEPT
FROM employee 001 B01
WHERE workdept = 'A01' 002 B01
003 G01
Perform a random 004 A01
probe into the table 005 G01
using the RRN 006 E01
value 007 A01
008 C01
009 D01
010 A01
011 C01
Produce a 012 F01
Relative Row 013 B01
Number (RRN) 014 C01
015 D01
for ‘A01’
016 F01
017 A01
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Table Probe Example - Graph
SELECT *
FROM employee
WHERE workdept = 'A01'
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Indexing Technology
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Radix Index
• Maintenance
– Index data is automatically spread across all available disk units
– Tree is automatically "rebalanced" to maintain an efficient structure
– No manual "index reorganization" required
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Radix Index
DB Table
ROOT
ARKANSAS
MISSISSIPPI Test
MISSOURI
IOWA Node
ARIZONA MISS
...
AR
Key
compression
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Encoded Vector Index (EVI)
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Encoded Vector Index (EVI)
• Object type is File, subtype is LF
• EVI is composed of two parts...
VECTOR:
Row
Key Value Code Count 1 1
SYMBOL Alabama 1 1000 17 2
TABLE: Alaska 2 450 5 3
Arizona 3 5000 9 4
Only
California 4 10000 2 5
Codes 6
Colorado 5 6500 7
... ... ... 49 7
49 8
Wisconsin 49 340
5 9
Wyoming 50 2760
... ...
• Rather than a bit array for each distinct key value, the index has
one array of codes (i.e. the Vector)
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Creating Indexes
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Using Indexes Db2 for i
black 3 1 yellow
black 17 2 red
blue 7 3 black
blue 10 4 brown
blue 12 5 red
Depending on the object brown 4 6 red
red 2 10 blue
red 5 11 violet
red 6 12 blue
red 14 13 white
violet 11 14 red
white 13 15 white
white 15 16 green
yellow 1 17 black
yellow 18 18 yellow
… … … …
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Using Indexes - Probe versus Scan
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Using Indexes - Probe versus Scan
Index Key Columns (CUSTOMER, ORDER, ITEM)
Scan Here
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index Scan Access Method
Reads all key values from beginning to end while applying the selection
criteria to the data within the index.
• Advantages:
– Rows from the table are returned in the key order of the index
– Can be used in conjunction with an index probe
• Potential disadvantages:
– May result in random disk I/O against the table and/or the index
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index Scan Example
Given an index like this: EMPLOYEE Index
CREATE INDEX empix ON Scan
LASTNAME WORKDEPT
employee (lastname, workdept)
Adamson B01
SELECT * FROM employee Anderson B01
WHERE workdept = ‘B01‘ Anderson G01
ORDER BY lastname Cain A01
Caine G01
Doe E01
Jones B01
Think of scanning the entire index, Jones C01
testing WORKDEPT for B01 Jones D01
Milligan A01
Keys and rows are accessed in
Peterson B01
LASTNAME order
Peterson F01
Smith B01
Smith C01
Smith D01
Smith F01
Wulf B01
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index Scan Example - Graph
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index Probe Access Method
Positions into a set of keys and reads them from the index.
• Also known as “key row positioning” in some high level languages
• Advantages:
– Return the rows back in the same order as the keys in the index
– Can be used in conjunction with index scan
• Potential disadvantages:
– May result in random disk I/O against the table and/or the index
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index Probe Example
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index Probe Example - Graph
SELECT *
FROM employee
WHERE workdept = ‘B01'
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index Probe + Scan Example
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index Probe + Scan Example - Graph
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index Scan (EVI) Example
SELECT *
FROM employee
WHERE workdept = 'B01'
Vector Return RRN list
Symbol Table 1
17
Key Code
Scan 5
Binary A00 1 vector
search 9
A01 2 for
symbol code(s)
2
A04 3
table 7
B00 4
for 49
B01 5
key(s) 49
B02 6
and 5
B05 7
code(s) .
C00 8
.
... ... .
.
.
.
.
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index Scan (EVI) Example - Graph
SELECT *
FROM employee
WHERE workdept = 'B01'
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index Only Access
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index Only Access Example - Graph
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index Only Access with EVIs
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index Only Access with EVIs
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index Only Access with EVIs
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
LAB
Accessing Tables and Indexes
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Temporary Data Structures
• The query engine can create, populate, and use a variety of temporary
structures.
• A temporary data structure may be used within the query for...
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Temporary Data Structures
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Temporary Data Structures
Data
How the data is populated into Flow
the data structure is completely Final
independent of how the data is Result
consumed.
*Query
Temp
"Populate" Data "Consume"
Structure
*Query
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Advantages and Disadvantages
• Disadvantages
– Many have to be completely populated before they can be consumed
– Because they tend to be memory resident, they generally need more
memory resources
– Most of them are not maintained and thus can contain “stale” copies of
table and index data
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Implementation Consequences
– Because many of them have a higher startup cost, they are more
likely to be used when the optimization goal is *ALLIO
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Temporary Data Structure Access Methods
Hash Table
Sorted List
RRN List
Cache N/A
Buffer N/A
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Temporary Index Creation
– Advantages:
The optimizer can create the most optimal index possible
The temporary index may be smaller because local selection can be
applied before it is created (sparse index)
– Potential disadvantages:
It must be populated in its entirety before it can be consumed
The index is maintained during inserts, updates and deletes
Temporary indexes have limited life spans
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Temporary Index Example
SELECT DeptName
FROM Department D
WHERE DeptNbr = ‘F01’
Temp Index
Department Table
DeptNbr
DeptNbr DeptName ... ... ...
A01
B01 BBBB
B01
G01 GGGG
C01
Scan A01 AAAA
and D01
E01 EEEE
select E01
key C01 CCCC
F01
column
H01 HHHH
G01
F01 FFFF
H01
... ...
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Temporary Index Example - Graph
SELECT DeptName
FROM Department D
WHERE DeptNbr = ‘F01’
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Hash Table Creation
– Advantages:
The hash table may be smaller because local selection can be
applied before it is created
– Potential disadvantages:
It must be populated in its entirety before it can be consumed
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Hashing Algorithm
• A well-defined method to map a larger value to a smaller
value, usually an integer which can be used as an index
into an array
– If more than one input value maps to the same output value, this
collision is detected and the values are still managed separately.
– An ideal hash algorithm minimizes the number of entries in the list of
output values and minimizes the number of collisions.
Hashing Algorithm
Input values Hash values
1
Australia
2
China 3
4
Austria
5
Greece 6
7
Denmark …
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Temporary Hash Table
Orders Table
Temporary Hash Table
CUSTKEY ORDERKEY AMOUNT …
Key Orderkey Amount
000056 110010 500 …
110010 500
000056 110050 1000 …
Populate 000056 110050 1000
110240 650
000056 110240 650 …
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Temporary Hash Table
Necessary Orders columns…
Temporary Hash Table
Customers Table
Key Orderkey Amount
CUSTKEY CUSTOMER …
110010 500
000056 Cain and Co. … JOIN 000056 110050 1000
110240 650
000057 Parkinson’s Mfg …
… … …
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Temporary Hash Table (Hash Index)
Orders Table
Temporary Hash Table
CUSTKEY ORDERKEY AMOUNT …
Key RRN
000056 110010 500 …
1
000056 110050 1000 …
Populate 000056 2
3
000056 110240 650 …
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Temporary Distinct Hash Table
Aggregated data…
Orders Table Temporary Distinct Hash Table
CUSTKEY ORDERKEY AMOUNT …
Key Aggregate
000056 110010 500 …
000056 2150
000056 110050 1000 …
000057 3010
000056 110240 650 …
000101 2150
000101 110005 1400 …
… …
000101 110036 750 …
… … … …
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Hash Table Creation
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Distinct Hash Table Example
A01 Mike
Mark
C01 Amy
F01 Bob
Tom
B01 Jane
C01 Michael
Janice
D01 Sally
F01 ...
A01
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Hash Table Example - Graph
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Hash Table Probe - Example
Hash
Table
Oranges Purples Reds Greens Blues Yellows
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Hash Table Probe - Graph
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Hash Table Scan - Example
Scan
Hash
Table
Oranges Purples Reds Greens Blues Yellows
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Hash Table Scan - Graph
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
“Skinny” Hash Table
Used when fair share is too small to contain entire hash table
and there is no permanent index available for access
Hash table
contains minimum
number of
columns
Index used to
minimize memory
footprint during
I/O
Adequate fair share Inadequate fair share
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Sorted List Creation
– Advantages:
The sorted list can be populated with just the subset of rows required
to satisfy the query
– Potential disadvantages:
The data is processed twice, first to populate the list and then to sort
the values
It has to be populated in its entirety before it can be consumed
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Sorted List Example
SELECT *
Index X1 FROM EMPLOYEE
LASTNAME WORKDEPT Scan WHERE WORKDEPT BETWEEN 'A01' AND 'E01'
Adamson B01 ORDER BY FirstName
Anderson B01
Anderson G01
Cain A01
Caine G01 Sort
Doe E01 Routine
Jones A01
Jones C01 Sorted List Data Structure
Jones D01 ... FIRSTNAME ... ... ...
Milligan A01 Amy
Peterson C01 Bob
Peterson F01 Jane
Janice
Smith B01 Kent
Smith C01 Mark
Smith D01 Michael
Smith F01 Mike
Sally
Wulf A01 Tom
...
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Sorted List Example - Graph
SELECT *
FROM EMPLOYEE
WHERE WORKDEPT BETWEEN 'A01' AND 'E01'
ORDER BY FirstName
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Sorted List Scan Example
SELECT *
FROM EMPLOYEE
WHERE WorkDept IN ('A01', 'C01', 'E01')
ORDER BY FirstName
Sort
Scan
Routine
Sorted List Data Structure
... FIRSTNAME ... ... ...
Amy
Bob
Jane
Janice
Kent
Mark
Michael
Mike
Sally
Tom
...
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Sorted List Scan Example - Graph
SELECT *
FROM EMPLOYEE
WHERE WorkDept IN ('A01', 'C01', 'E01')
ORDER BY FirstName
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Sorted List Probe Example
SELECT * FROM
EMPLOYEE E INNER JOIN DATE_MASTER D
ON E.HIRE_DATE >= D.DATEKEY
Sort
Routine Sorted List Data Structure
... HIRE_DATE ... ... ...
2003/12/30
2003/12/31
2004/01/05
2004/01/05
2004/01/08
2004/01/10
2004/01/12
Probe
2004/01/12
2004/01/14
2004/01/15
...
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Sorted List Example - Graph
SELECT * FROM
EMPLOYEE E INNER JOIN DATE_MASTER D
ON E.HIRE_DATE >= D.DATEKEY
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Unsorted List Creation
– Advantages:
The most efficient operation(s) can be used for selecting the data
The unsorted list contains a subset of the data
– Potential disadvantages:
No order or key associated with the data
Must be populated in its entirety before it can be consumed.
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Unsorted List Example
Unsorted List
DeptName WorkDept Days
BBBB B01 5
BBBB B01 22
Select GGGG G01 7
AAAA A01 0
required rows
GGGG G01 4
EEEE E01 7
AAAA A01 14
CCCC C01 19
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Unsorted List Example - Graph
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Unsorted List Scan Example
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Unsorted List Scan Example - Graph
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
RRN List Creation
– Advantages:
The most efficient index(es) can be used for selecting the rows
Multiple RRN lists can be ANDed / ORed together, further reducing the need
to probe the table
No I/Os to the table during generation of the RRN list
The order of the RRNs is based on the physical order of the rows in the table
– Potential disadvantages:
It must be populated in its entirety before it can be consumed
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
RRN List Example
Binary
search
ROOT
index
for Return RRN list
key(s) Test
and Node MISS
row
no(s)
AR
ISSIPPI OURI
002 003
IOWA
004
IZONA KANSAS
005 001
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
RRN List Example
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
RRN List Example - Graph
SELECT *
FROM EMPLOYEE
WHERE WORKDEPT IN ( 'B01', C01, 'E01')
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index ANDing / ORing Example 1
State Workdept SELECT *
EVI FROM EMPLOYEE
Radix WHERE STATE = ‘IOWA'
OR WORKDEPT IN ( 'B01', C01, 'E01')
2
4
4 2 8
Represents
1001 8 1001 all the local
1005 OR 1004 1004 selection
3051 (Merge) 4105 1005
3051
4105
State Workdept
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index ANDing / ORing Example 2
3 3
5 7
10 10
3
15 27 Represents
10 all the local
1000 AND 1000
1000 selection
1005 1010
(Merge) 3001
1007 2035
3001 3001
3050 4100
Country Workdept Result
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index ANDing / ORing Example - Graph
SELECT *
FROM EMPLOYEE
WHERE STATE = 'Iowa'
OR WORKDEPT IN ( 'B01', 'C01', 'E01')
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Index ANDing / ORing Example - Graph
SELECT *
FROM EMPLOYEE
WHERE STATE = 'Iowa'
OR WORKDEPT IN ( 'B01', 'C01', 'E01')
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
RRN List Scan Example
Final
Salary BETWEEN 50000 AND 100000
RRN List
Position = 'Mgr'
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
RRN List Scan Example - Graph
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Cache Creation
– Advantages:
The most efficient operation(s) can be used for selecting the data
The cache contains a subset of the data
Allows subsequent methods to access the cache instead of the
database object
– Potential disadvantages:
Only effective in caching repetitive values that don't change often
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Cache Example
Populate cache
as rows are
selected
Cache
WorkDept
B01
A01
Select D01
required rows E01
C01
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Cache Example - Graph
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Cache Probe Example
Probe cache as
rows are
selected Cache
WorkDept
A01 Probe
B01
C01
D01
E01
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Cache Example - Graph
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Buffer Creation
– Advantages:
The most efficient operation(s) can be used for selecting the data
The buffer contains a subset of the data
Allows subsequent methods to run in parallel
– Potential disadvantages:
No order or key associated with the data
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Buffer Example
Build buffer
before parallel join
Buffer
WorkDept
A01
A01
Select
A01
required B01
rows B01
C01
C01
C01
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Buffer Example - Graph
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Buffer Scan Example
Build buffer
before parallel join
Buffer Scan
WorkDept
B01
B01
Select A01
required A01
rows B01
E01
A01
C01
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Buffer Scan Example - Graph
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Temporary Data Structure - Delays
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Nested Loop Join - Graph
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Aggregation - Graph
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Union and Union All - Graph
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Fetch N Rows, Lock Row - Graph
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Logic – Early Exit
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Logic – Before and After i 7.2
• Starting with IBM i 7.2, logic nodes are shown in line with the corresponding
part of the Visual Explain. They have initial processing which is implemented
from the top down and which still avoids unnecessary processing.
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
User Defined Table Functions
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Complicated
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Values List
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Rank
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Temporary Distinct Sorted List
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
Enqueue / Dequeue
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation
Db2 for i
LAB
Accessing Temporary Data Structures
IBM Systems Lab Services – January 2019 Copyright 2019 IBM Corporation