The Power of Zoning (translation)

Source: Internet
Author: User

The power of Zoning

Dwaine R. Snow and Paul C. Zikopoulos

Laughter Boil paste Translation



Original source: "DB2 Magazine" Quarter 2, 2003 · Vol. 8, Issue 2

English original (because the article translation is not authorized, please retain the original link in the reprint)





There are a lot of misconceptions about zoning. Experts at the Toronto Lab have a good name for this useful function.



There are many misunderstandings in DB2 database partitioning. Changes made to the DB2 UDB version 8.1 on Linux, UNIX, and Windows platforms help simplify DB2 partitions. We will explain these changes, clarify some of the myths of partitioning, and explain the timing and reasons why you should consider zoning.



DB2 UDB 8.1 for Linux \unix\windows integrates products from the DB2 product family, formerly known as DB2 UDB Enterprise and Enterprise extensions, into a separate product. This new DB2 Enterprise Server Edition (ESE) contains the functionality of the database partition (formerly as a separate offering), and as a billing project, it is now called the database partitioning function (Note: Literal translation--database partitioning feature DPF). When DB2 users find themselves needing to start partitioning, they can start right away without needing some extra code-they just need DPF's license agreement.


The truth of DPF
Myths about database partitioning are ubiquitous in DB2 (see table 1). A quick overview of the partitioning base will help you differentiate between authenticity and make appropriate zoning decisions.

Table 1: Myths and facts surrounding DB2 data partitioning




Parallel query processing is supported regardless of whether there are dpf,db2. Figure 1 shows the installation on a 4-channel SMP (symmetric multi-processing) server DB2 ESE. In this hypothesis. A separate query can automatically use all of the CPU and physical disks on this server. A child agent that relies on a subset of data needs to provide a parallel mechanism within the partition. DB2 uses I/O pre-access to feed data sent from disk to these sub proxies. This parallel mechanism is transparent to users, applications, and DBAs.



Figure 1: Parallel mechanism of DB2 ESE without DPF





The DPF option increases the ability to partition a database in a group of machines or logically in an SMP server. Depending on DPF, a database image can span multiple machines (storage), and it is still a full database image for users and applications.



Consider the case of a four-way SMP server group. (In this article, we'll use the term database partitioning group rather than the cluster, because clustering usually refers to a highly reliable failover configuration or a partitioning group for measuring systems.) Using DPF, the parallel operations discussed in Figure 1 can be extended across multiple SMP machines (see Figure 2). The advantage of this is that there is a double parallel operation. You can balance these parallel operations across multiple machines or logical database partitions. Such a process is called a parallel mechanism between partitions.



Figure 2: A parallel mechanism using DPF across multiple machines




The parallel mechanism between partitions is typically performed on multiple servers, but more and more users are now doing this in some large SMP boxes (see Figure 3).



Figure 3: DB2 ESE with DPF in a separate SMP server.



When (why) you need to partition
So, are you supposed to do zoning? You should consider partitioning in the following situations:

· Your server has a large amount of available memory. Even though the DB2 V8 has 64-bit support, multiple partitions have been shown to provide more efficient use of memory and more linear scalability than individual SMP parallel mechanisms.

· The system will include multiple servers, or more than 6 to 12 CPUs.

· The speed at which database tools operate is the key to your business operations.

· The number of batch Windows provided for loading data or extraction, conversion, and load handling operations is limited.

· The need for scrolling window data updates in the Data Warehouse makes parallel SQL processing and other log spaces fundamental.

Partitioning is particularly meaningful in these cases. But some of the other benefits offered by partitioning make it more appealing. These benefits are:

Query extensibility One of the most obvious reasons for using DPF is that it can increase query workload and the performance of INSERT, update, and delete operations. Partition a single large database into a number of smaller databases to speed up these operations because each database partition has its own set of data.



For example, you want to scan a table that contains million rows of data. For a separate database partition, this scan will require a separate database manager to search all million records. If you partition your database system to use 50 database partition servers and distribute this million record evenly between them, the database manager on each database partition needs to scan only 2 million rows. If each scan is performed at the same time and at the same speed, the scan completes approximately 2% of the time.

DPF provides similar linear scalability and the use of tools to complete infrastructure construction. This allows it to increase capacity as needed without the need for new technology or stand-alone installation



The DB2 optimizer is based on a parallel mechanism. In other words, it retains information on how to partition the underlying data in the system. Using this information, the optimizer considers different query execution strategies and a low cost choice. When comparing different execution strategies, it takes into account the inherent parallelism of different operations and the overhead of passing messages between database partitions.



DB2 can provide similar linear scalability when large amounts of data or processors and partitions increase. However, the opportunity for a partition to provide the greatest benefit depends on the amount of work it is related to, the size of the maximum capacity table, and other factors. In general, we recommend that the amount of raw data (only the size of the table) on each CPU should be based on the power of the CPU on the server being used. For example Pseries P690-class CPU, we recommend each processor 150-200GB. For Xseries-class CPUs using Linux or Windows (or any Intel or AMD machines), we recommend each processor 75-150GB. Remember, these are only recommended in general, and there will be some differences in practice.



Architectural limitations DPF has broken through some of the DB2 architectural limitations. For example, the maximum capacity of a table in DB2 is 64GB with a 4KB page size (although the 32KB page size can be supported to 512GB). The table and table space size limits in DB2 are based on each partition. Therefore, partitioning a database in multiple partitions allows you to increase the maximum capacity of the table by the number of partitions in your system environment. For example, partitioning a database into a four-node system can support a 2408 GB table with the largest (32KB page size).



Memory can also become a bottleneck in an environment without partitions. The 32-bit version of DB2 ESE limits the shared memory for each DB2 server. (This restriction will vary depending on the operating system running DB2, while some vendors also provide extensions to some basic memory modules.) Shared memory supports memory-intensive database resources such as buffer pools, high-speed buffers, and heaps. In a DPF environment, each database partition manages and owns its own resources, so you can overcome these limitations by partitioning your database. You can even run a logical database partition in the large SMP box central to take advantage of the large memory resources in a single SMP server.



Data is loaded in the DB2 ESE v8.1, and if the target table is partitioned, the Mount tool automatically detaches and loads the data in parallel. It uses smart defaults to detach and load data, and it can be optimized for some environments.



In a partitioned database, you can use the Mount tool to load data to the appropriate database partitions at the same time. Figure 4 shows that the Mount tool separates and loads data into a table (in parallel state) using a dedicated media reader. The Mount tool provides linear scalability for load times.

Fig. 4 Loading using DPF accelerator table




The DB2 V8 Mount tool is faster and more available than the previous version of the Mount tool. If you perform a mount operation in DB2 V8, DB2 no longer locks all tables in the table space where the loaded table resides (as in the case of DB2 V7). Now there is even an online load, which allows the table to be read when it is loaded. Consider for previous DB2 versions, still support Autoloader scripts.



Is it possible to load time important but the performance of the query is not important? These two issues are not mutually exclusive; however, loading time in many business processes is an important factor. In fact, this is sometimes a determining factor. If that is the case, it is useful to use DPF. For example, the fraud detection unit of the telecommunications company (telco) loads a large amount of data at a specified time interval in order to quickly and accurately monitor anomalies in call patterns that may be potential fraud signals. The database must quickly detect these anomalies, so data needs to be quickly and frequently entered into the Data warehouse. At the telecoms company, the process is repeated every hour or even in the larger company every 15 minutes. These requirements require an extensible and efficient infrastructure to run similar queries.



Maintaining a database partition can significantly accelerate maintenance. Spreading the database across multiple database partition servers accelerates the maintenance of the database, because each operation is run on a subset of the data subsets managed by the partition.



Although index creation is parallel in DB2, you can further reduce the total time by partitioning the database. Using a small dataset to create an index in parallel on all partitions allows parallelism. Remember, DB2 is an abstraction of the surface phenomenon, and multiple tables can be represented as a form of a table.



Runstats tools can also benefit from partitioning. This tool updates the physical properties of a table and its associated index statistics. The optimizer uses these statistics when determining the data access path. The runstats is CPU intensive, requiring data sorting and aggregation. You can use the DPF option to reduce the time that the tool takes. Use Dpf,runstats to check the data on a single database partition rather than the entire table. In DB2 V8, the runstats sampling option can further reduce the execution time of the tool (whether or not DPF is available).



Similarly, spreading data across multiple partitions helps table reassembly (REORG), which is I/O intensive and requires random fetching (especially offline). Each database partition can reorganize the data it owns and allocate more drivers for each processor to reorganize the data. These operations can also be done in parallel to shorten the overall time required. In DB2 V8, you can perform reorg on various partitions or subsets of the database partition. You can also stop, pause, check status, and restore.



These examples are only maintenance operations that can benefit from DPF.



Parallel inserts/deletes only SQL statements in the database partition are parallel operations. If the database environment uses SQL for BULK INSERT and delete processing, a multiple database partition can increase the throughput of the transaction through the parallel processing of INSERT and DELETE statements on the database partition. This benefit can also be applied to the technique of selecting data from one table and inserting another table.



scrolling window requirements when the query window must remain open, partitions are usually used to meet the requirements of the scrolling window (insert and delete rows daily). Defining a database partition for each processor increases the throughput in the new data Insert table. It makes sense to execute the INSERT or delete data stream concurrently in a database partition (for example, using a critical range). Multiple database partitions make it possible to allocate sufficient memory for the locklist of a database that stores a large number of insert and delete operations.

Database partitions also allow for index maintenance operations across database partitions (when inserted and deleted)



Backing up and restoring a partitioned database between multiple database servers can significantly reduce the total backup time used to back up the database. Depending on your environment, this may be an important determinant in deciding whether to partition a database.

DB2 the parallel backup and recovery by assigning a separate process or thread to each table space. In a backup of a partition, each partition is backed up separately. Performing these backup operations in parallel will shorten the time spent backing up the entire database.



A partitioned database environment can also accelerate roll forward and restart (crash) recovery. With DPF, some logs that must be rolled forward are specific to each database partition; a balanced separation and conquest strategy for database partition servers (Divide-and-conquer strategy) accelerates the process. At the same time, if a particular database partition does not need to roll forward, it will be ignored in crash recovery.



Record some things to consider in a highly active system, the performance of database logs is likely to constrain the ability of the system. In a partitioned database environment, each partition has its own set of logs. Multiple database partitions can improve performance when the system needs to perform high intensity inserts, updates, or deletions, because the logs are written in parallel to each partition and have fewer log entries per partition.
Make a choice
partition or no partition? Fundamentally speaking, DB2 is DB2. Whether you don't partition your database has no effect on the interface, features, tools, and skills you use. This is in fact dependent on your application and the environment. Using our suggested criteria, you can find the answer to the question.




About the author
Dwaine R. Snow is the product manager of DB2 UDB partitioned database, a DB2UDB consultant for IBM, Canada, for many years, providing database and application planning and design, project planning and implementation, complex online transaction processing and decision support system design, Onsite guidance for performance tuning and system integration. You can contact him through the mrdb2@yahoo.com.



Paul C. Zikopoulos has over seven years of DB2 work experience in the IBM Data management software group and has written many articles. He was involved in writing several books, including Db2:the Complete Reference (Osborne Mcgraw-hill, 2002), and DB2 Fundamentals for Certification dummies (Wiley, 20 02). Paul is DB2 certified Senior Technical expert (DRDA and CLUSTER/EEE) and DB2 Certification solutions Specialist (Business Intelligence and database management). You can contact him through the paulz_ibm@msn.com.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.