1 DB2 OBJECTS & PERFORMANCE Buffer Pool: Allocated memory for DB2; the main memory allocated to DB Manager to cahce table and index data pages as they are read from disk or modified. DB Manage decides when to bring data from disk into buffer pool. When old data is not being used, it can be written back out to disk. Table Space: Logical layer between physical tables w/data and the database; maps logical database design to physical storage. Two types of table spaces: • (SMS) System Managed Space: OS file system allocates and manages the space where the table is stored • (DMS) Database Managed Space: db manager controls storage space; special purpose file system. Container: Allocates storage for the table space; It is the physical storage. It can be directory name, device or a file name. All database and table data is assigned to table spaces. A single table space can span multiple containers, but each container can ONLY belong to one table space. Extent: Is a unit of space within a container of a table space. DB Objects are stored in pages within DB2 which are grouped into allocation units. Container_0 Table Space Extent Pages
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
DB2 OBJECTS & PERFORMANCE
Buffer Pool:
Allocated memory for DB2; the main memory allocated to DB Manager to cahce table and index data
pages as they are read from disk or modified. DB Manage decides when to bring data from disk into
buffer pool. When old data is not being used, it can be written back out to disk.
Table Space:
Logical layer between physical tables w/data and the database; maps logical database design to physical
storage. Two types of table spaces:
• (SMS) System Managed Space: OS file system allocates and manages the space where the table
is stored
• (DMS) Database Managed Space: db manager controls storage space; special purpose file
system.
Container:
Allocates storage for the table space; It is the physical storage. It can be directory name, device or a file
name. All database and table data is assigned to table spaces. A single table space can span multiple
containers, but each container can ONLY belong to one table space.
Extent:
Is a unit of space within a container of a table space. DB Objects are stored in pages within DB2 which
are grouped into allocation units.
Container_0
Table Space Extent Pages
2
Page sizes:
Rows of table data are organized in page blocks. Four sizes exist (4K, 8K, 16K, 32K)
In a page of table data , ~ 75 bytes are reserved for DB2, the remaining is used for user data.
As you increase the page size, the following items also increase:
• Columns in the table
• Maximum row length
• Maximum table size
Big Block Reads:
If several pages (extent) are retrieved in a single request, then big-block read occurs. If the rows in the
pages are in the extent retrieved, then no physical I/O required.
Sequential Pre-fetching:
Ability of DB Manager to read pages in advance pages being referenced by a query. Use I/O Servers to
perform page reading.
Page Cleaning:
As pages are read and modified, they accumulate. Page cleaner tasks write out modified pages to
guarantee availability of buffer pool pages for use by read requests.
Table Descriptor:
The table descriptor provides information about the table, particularly the data definition from the
CREATE TABLE statement that created the object.
Catalog Table Space:
Catalog is where DB2 keeps all its metadata about database objects.
Temporary Table Spaces:
Space for intermediate tables as it waits to determine the final result set
Catalog Cache:
Table descriptors for tables, views, and aliases; a descriptor stores information about a table, view, or
alias in a condensed internal format. When an SQL statement references a table, it causes an insert of a
table descriptor into the cache, so that subsequent SQL statements referencing that same table can use
that descriptor and avoid reading from disk.
3
Package Cache: (see Package)
The package cache hit ratio tells you whether or not the package cache is being used effectively. If the
hit ratio is high (more than 0.8), the cache is performing well. A smaller ratio may indicate that the
package cache should be increased.
The package and section information required for the execution of dynamic and static SQL statements
are placed in the package cache as required. This information is required whenever a dynamic or static
statement is being executed.
The package cache exists at a database level. This means that agents with similar environments can
share the benefits of another agent's work. For static SQL statements, this can mean avoiding catalog
access.
Hash Join:
In a hash join, one table (selected by the optimizer) is scanned and rows are copied into memory buffers
drawn from the sort heap allocation. The memory buffers are divided into partitions based on a hash
code computed from the columns of the join predicates. Rows of the other table involved in the join are
matched to rows from the first table by comparing the hash code. If the hash codes match, the actual
join predicate columns are compared.
Consideration of the performance implications of coding your predicates in different ways
Join Predicate:
A join predicate is applied to identify the records that shall be joined. If the predicate evaluates to True,
then the combined record occurs in the joined table; otherwise, it does not. The join predicate can be
any predicate supported by SQL, for example in WHERE and ON clauses.
A join is a relation composition. That is the fundamental operation in relational algebra
DPCs (Deferred Procedures Call):
Interrupts that run at a lower priority than standard interrupts.
User Mode:
User mode is a restricted processing mode designed for applications, environment subsystems, and
integral subsystems.
Privileged Mode:
Privileged is designed or O/S components and allows access to hardware & memory
4
Split I/O:
May result from requesting data in a size that is too large to fit into a single I/O
Logical & Physical:
• Logical Reads is the number of Logical I/O requests made by DB2 for the physical file (or table).
• Physical Reads is the actual number of Physical I/O operations performed to satisfy the Logical I/O
requests.
The values of physical disk counters are sums of the values of the logical disks (or partitions) into which
they are divided.
MDL (Memory Descriptor List) Read Hits:
Read requests to the file system cache that hit the cache; so it does not require disk accesses in order to
provide memory access to the page.
Data Map Hits:
The percentage of data maps in the file system cache that could be resolved without having to retrieve a
page from the disk, because the page was already in physical memory.
Heap:
A logical grouping of memory that fulfills the needs of a particular component. For example, the utility
heap memory is used by DB2 utilities such as backup, restore, and load.
Indexes:
Indexes provide quick access to data and can enforce uniqueness on the rows in the table.
Threshold Trigger:
An event that occurs when the value of a performance variable exceeds or falls below a user-defined
threshold value. The action that occurs as a result of a threshold trigger can be:
� Logging information in an alert log file.
� Displaying information in an alert log window.
� Generating an audio alarm.
� Issuing a message window.
� Invoking a predefined command or program.
5
A database must have at least one buffer pool, and can have a number of buffer pools depending on the