tag:blogger.com,1999:blog-183714562024-03-18T02:39:06.636-05:00The Db2 Portal BlogNews, views, and items of interest on IBM's Db2 database management system and mainframes.Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.comBlogger615125tag:blogger.com,1999:blog-18371456.post-89493356027320695232024-03-11T08:00:00.001-05:002024-03-11T08:00:00.251-05:00Mixing Db2 Database Administration with DevOps - Part 3: Automating DevOps Toolchain<p><span style="font-family: helvetica; font-size: medium;">Understanding what is meant by DevOps and the many requisite pieces of the DevOps toolchain is just the first step in adopted DevOps.</span></p><p><span style="font-family: helvetica; font-size: large;">The key to success with automating DevOps is a well-constructed toolchain for automating all of the afore-mentioned processes in an integrated and cooperative manner. If you have been an IT professional for any length of time most of the categories we just discussed will not be new to you. What is new, however, is likely the integration of the tools hooked up together to work in concert for the purpose of delivering application software quickly and accurately.</span></p><p><span style="font-family: helvetica; font-size: medium;">Additionally, the list of activities we just reviewed is not comprehensive. A glaring omission is the lack of integration with your database management systems. The orchestration of application changes in the DevOps toolchain is fairly well established, but this is not so much the case for database changes. And this has especially been the case for the mainframe world in terms of incorporating Db2 for z/OS into the DevOps toolchain.</span></p><p><span style="font-family: helvetica; font-size: medium;">As any good DBA or performance analyst knows, there are multiple management and operational activities required to assure functionality and optimal performance when applications rely on Db2 databases for persistent storage. Perhaps the single most difficult task is managing database schema changes. </span></p>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com0tag:blogger.com,1999:blog-18371456.post-70540853826577195842024-03-07T07:00:00.001-06:002024-03-07T07:00:00.238-06:00Mixing Db2 Database Administration with DevOps - Part 2: The DevOps Toolchain<p><span style="font-family: verdana; font-size: medium;">Adopting a DevOps approach to application development is all about moving faster. Automating the multitude of processes required during software development and management is a core part of increasing speed and enabling faster development.</span></p><p><span style="font-family: verdana; font-size: medium;">As mentioned in <a href="https://db2portal.blogspot.com/2024/02/mixing-db2-database-administration-with.html" target="_blank">the first part of this series</a>, a DevOps toolchain is used to automate the development process. A toolchain is a set of software tools used to perform a complex development task... or to create a software product. The software tools that comprise a toolchain typically are executed sequentially with the output or state of one tool becoming the input for the next, but this is not a hard-and-fast requirement.</span></p><p><span style="font-family: verdana; font-size: medium;">A DevOps toolchain therefore is a set of tools that interoperate with one another to aid in the delivery, development, and management of software applications throughout the SDLC. The following components typically are involved in putting together a useful DevOps toolchain.</span></p><p><span style="font-family: verdana; font-size: medium;"><b><i>Orchestration </i></b>enables the automation of coordinating and managing the SDLC. Whereas automation refers to a single task or capability, orchestration automates a complex, multi-step process. The orchestration tool drives the entire DevOps process. Jenkins is the most popular DevOps orchestration tool.</span></p><p><span style="font-family: verdana; font-size: medium;"><b><i>Continuous Integration (CI) and Continuous Delivery (CD)</i></b> are important components of the DevOps toolchain. Typically, CI and CD are implemented into collaboration tools that provide a dashboard for integration and delivery of software. Bamboo and Jenkins offers CI and CD capabilities. </span></p><p><span style="font-family: verdana; font-size: medium;">Tools that deliver <b><i>Configuration and Resource Management</i></b> provide an automated method for maintaining your systems and software infrastructure in a consistent state. This can include servers, storage, networking, and software, with the goal of managing the environment in a known, desired state. Examples of configuration management tools include Chef, Ansible, and Puppet.</span></p><p><span style="font-family: verdana; font-size: medium;"><b><i>Source Control</i></b> software is used to manage who can change code, who is changing code, and track those changes. It enables developers to work collectively on a complex software project without impacting code changes other developers are making. GitHub is the most popular modern source control tool for DevOps projects.</span></p><p><span style="font-family: verdana; font-size: medium;"><b><i>Collaboration </i></b>tools aid in the scheduling and tracking of code sprints by delivering transparency to the process for all stakeholders. Many different types of tools can fall into this category, including communication, project management, and service management software. Tools that help developers to catalog and track issues help to speed delivery by improving the response taking corrective action. </span></p><p><span style="font-family: verdana; font-size: medium;">Whenever code is being written, it must also be tested. <b><i>Automated Software Testing </i></b>tools can improve the speed and quality of software by quickly identifying defects and validating the accuracy of code. </span></p><p><span style="font-family: verdana; font-size: medium;"><b><i>Deployment</i></b> tools automate the migration and implementation of application code throughout your environments. It facilitates rapid feedback and continuous delivery in agile development while providing the audit trails, versioning and approvals needed in production. A popular deployment tool IBM UrbanCode Deploy is an example of a popular deployment tool for DevOps.</span></p><p><span style="font-family: verdana; font-size: medium;">A <b><i>Container </i></b>is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. Using a container developers can incorporate everything required to run an application to enable it to be portable, without being impacted by differences across multiple environments. Docker is the most popular container software. Kubernetes is frequently used with Docker as a container orchestration system that automates application deployment, scaling, and management. </span></p><p><span style="font-family: verdana; font-size: medium;"><b><i>Monitoring</i></b> software that can oversee the performance and operation of applications and services is a crucial component of a DevOps pipeline. There are many types of monitoring software including IT infrastructure (operating system, network, and database); the end-user response and experience; and for the performance and functionality of the actual applications themselves. </span></p>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com0tag:blogger.com,1999:blog-18371456.post-46040907975377100082024-02-29T15:28:00.002-06:002024-02-29T15:28:27.099-06:00Mixing Db2 Database Administration with DevOps - Part 1: Intro to DevOps<p></p><div>
<!--[endif]-->
<div id="ftn1">
<div id="ftn1"><span style="color: #11171a; font-family: verdana; font-size: medium;"><span style="background-color: white;">Organizations of all types are being impacted by the transformation to the modern digital economy. This digital transformation, driven by the 24/7 expectations of users and customers to access data and apps at any time, from any device, requires the ability to rapidly change technology and software. This means that today’s businesses have to deliver and improve the services and software used by their customers faster than ever before.</span></span></div><div id="ftn1"><span style="color: #11171a; font-family: verdana; font-size: medium;"><span style="background-color: white;"><br /></span></span></div><div id="ftn1"><span style="color: #11171a; font-family: verdana; font-size: medium;"><span style="background-color: white;">To survive and thrive in the new digital economy requires that organizations adopt new and faster methods of developing, testing and delivering application software. The clear trend for modern application development is the use of agile development and DevOps techniques. Why have these techniques been adopted for software development over long-standing techniques like the waterfall approach? It all comes down to improved collaboration, resulting in faster development and therefore a quicker return on investment.</span></span></div><div id="ftn1"><span style="color: #11171a; font-family: verdana; font-size: medium;"><span style="background-color: white;"><br /></span></span></div><div id="ftn1"><span style="color: #11171a; font-family: verdana; font-size: medium;"><span style="background-color: white;">An <b><i>agile</i></b> development methodology involves the organization of the team and goals such that software development is iterative, incremental, and evolutionary. Using an agile approach, development and testing activities are undertaken concurrently, unlike the traditional Waterfall development model. Large software projects are broken into pieces such that immediate value can be delivered quickly, in smaller pieces, instead of waiting for a monolithic product to be completed. With continuous testing and integration, the smaller software pieces can be integrated into a larger, final deliverable.</span></span></div><div id="ftn1"><span style="color: #11171a; font-family: verdana; font-size: medium;"><span style="background-color: white;"><br /></span></span></div><div id="ftn1"><span style="color: #11171a; font-family: verdana; font-size: medium;"><span style="background-color: white;">Another key methodology used to speed up the delivery of software is the DevOps approach, which results in small and frequent code changes. Its name is an amalgamation of Development and Operations. As such, DevOps relies on agile development, coupled with a collaborative approach between development and operations personnel during all stages of the application development lifecycle. Such an approach can significantly reduce the lead time for changes, lower the rate of failure, and reduce the mean-time-to-recovery when errors are encountered. With such benefits that can accrue, it is no wonder that DevOps and continuous delivery are gaining in popularity.</span></span></div><div id="ftn1"><span style="color: #11171a; font-family: verdana; font-size: medium;"><span style="background-color: white;"><br /></span></span></div><div id="ftn1"><span style="color: #11171a; font-family: verdana; font-size: medium;"><span style="background-color: white;">Instead of long software development projects that may not deliver value for months, or perhaps even years (such as are common using the Waterfall development methodology), an agile DevOps approach delivers value quickly, and then incrementally over time. DevOps enables the continuous delivery of new functionality demanded by customers in the digital economy.</span></span></div><div id="ftn1"><span style="background-color: white; color: #11171a; font-family: verdana; font-size: large;"><br /></span></div><div id="ftn1"><span style="background-color: white; color: #11171a; font-family: verdana; font-size: large;">Succeeding with DevOps however, requires a cultural shift in which all groups within IT work in collaboration with one another, and where management endorses and cultivates this cultural change. Because DevOps relies upon incremental development and rapid software delivery, your IT department can only thrive if there is a culture of accountability, collaboration, and team responsibility for desired business outcomes. Creating such a culture is not easy. </span></div><div id="ftn1"><span style="color: #11171a; font-family: verdana; font-size: medium;"><span style="background-color: white;"><br /></span></span></div><div id="ftn1"><span style="color: #11171a; font-family: verdana; font-size: medium;"><span style="background-color: white;">The goal of DevOps is a constantly repeating cycle of continuous development, continuous integration and continuous deployment. To achieve such a high level of continuous delivery also requires in-depth automation of the entire development lifecycle. This is often referred to as the DevOps toolchain.</span></span></div><div id="ftn1"><span style="color: #11171a; font-family: verdana; font-size: medium;"><span style="background-color: white;"><br /></span></span></div><div id="ftn1"><span style="color: #11171a; font-family: verdana; font-size: medium;"><span style="background-color: white;"><br /></span></span></div><div id="ftn1"><br /></div>
</div>
</div>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com0tag:blogger.com,1999:blog-18371456.post-84429783365873242842023-12-18T08:00:00.002-06:002023-12-18T08:00:00.345-06:00Happy Holidays 2023<div style="text-align: left;"><span style="font-family: verdana; font-size: medium;">Did you know that there are over two dozen holidays celebrated across the world between November 1st and January 15th? </span></div><div style="text-align: left;"><span style="font-family: verdana; font-size: medium;"> </span></div><div style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitWcfdfjrgiww-CZkZIrceKy5PO6C_YzZYkFvYc76q1z9iv_lKPtDok9so5T-vhhhQEuQhL9G47IA7re_xf2r3rCcjGdaqPgQ7H8VnkFpuAPygxNIzN4Qfh9xK9kapWiClP1FrlOy2xk8dtR6hWXLzabGKuYJQyp54PQL2l7yBMB2xBXk43eEg0w/s1732/Happy-Holidays-2023.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="926" data-original-width="1732" height="214" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitWcfdfjrgiww-CZkZIrceKy5PO6C_YzZYkFvYc76q1z9iv_lKPtDok9so5T-vhhhQEuQhL9G47IA7re_xf2r3rCcjGdaqPgQ7H8VnkFpuAPygxNIzN4Qfh9xK9kapWiClP1FrlOy2xk8dtR6hWXLzabGKuYJQyp54PQL2l7yBMB2xBXk43eEg0w/w400-h214/Happy-Holidays-2023.png" width="400" /></a></div><br /> </span></div><div style="text-align: left;"><span style="font-family: verdana; font-size: medium;">So in the spirit of the season, I want to wish all of my readers everywhere a Happy Holiday season.</span></div><div style="text-align: left;"><span style="font-family: verdana; font-size: medium;"> </span></div><div style="text-align: left;"><span style="font-family: verdana; font-size: medium;">This will be the last post I make here this year. <br /></span></div><div style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><br /></span></div><div style="text-align: left;"><span style="font-family: verdana; font-size: medium;">I hope that you will take some time to celebrate whichever holidays you observe... and that you enjoy this time of year with your family and friends. </span></div><div style="text-align: left;"><span style="font-family: verdana; font-size: medium;"> </span></div><div style="text-align: left;"><span style="font-family: verdana; font-size: medium;">And let's meet back here next year to talk some more about our favorite DBMS... Db2!</span></div><div style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><br /></span></div><p><span style="font-size: medium;"><br /></span><br /></p>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com0tag:blogger.com,1999:blog-18371456.post-88430515775572142132023-12-11T07:00:00.005-06:002023-12-11T07:00:00.156-06:00Understanding Db2 Messages<p><span style="font-family: verdana; font-size: medium;">Have you ever been confronted with a Db2 message and needed help deciphering what it is trying to tell you? </span></p><p><span style="font-family: verdana; font-size: medium;">I'm sure most of us have. But let's back up a moment and define what a Db2 message actually is. In Db2 for z/OS, a message refers to a notification from the Db2 subsystem that is conveying information about the status, events, errors, or other conditions within the Db2 environment. Db2 for z/OS generates messages to report various aspects of its operation, and these messages can be critical for monitoring, diagnosing, and resolving issues in the database system.</span></p><p><span style="font-family: verdana; font-size: medium;">There is an entire manual devoted to describing Db2 Messages, titled, appropriately enough, <a href="https://www.ibm.com/docs/en/SSEPEK_13.0.0/pdf/db2z_13_msgsbook.pdf" target="_blank">Db2 for z/OS Messages</a>. Db2 messages serve several purposes:<br /></span></p><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;"><b>Informational Messages</b>: These messages provide general information about the status or activities of the Db2 subsystem. They might include details about ongoing processes, successful completion of operations, or other relevant information.</span></li><li><span style="font-family: verdana; font-size: medium;"><b>Warning Messages</b>: Warning messages indicate that an operation completed with a potential issue or that there's a condition that might require attention. While not necessarily errors, warnings prompt users to review and possibly take corrective actions.</span></li><li><span style="font-family: verdana; font-size: medium;"><b>Error Messages</b>: Error messages signify that a problem occurred during the execution of a Db2 operation. These messages provide details about the nature of the error and often include information to help identify the cause.</span></li><li><span style="font-family: verdana; font-size: medium;"><b>Diagnostic Messages</b>: Diagnostic messages provide additional details that can be useful for troubleshooting and debugging purposes. They offer insights into the internal workings of Db2 and can assist database administrators in identifying and resolving problems.</span></li></ul><p><span style="font-family: verdana; font-size: medium;">Where do you find Db2 messages? Well, the can be found in various places, including: system logs, job output, Db2 message files, and output from SQL queries or commands.</span></p><p><span style="font-family: verdana; font-size: medium;">You can recognize a Db2 message because it will start with the three-letter indicator DSN. DSN is the product identifier used internally by IBM for Db2. Db2 for z/OS messages follow a specific format that includes important
information about the message type, severity, and details about the
message. </span></p><p><span style="font-family: verdana; font-size: medium;">Db2 messages are identified by unique message numbers, which are eight to ten characters long. Db2 for z/OS message identifiers have the following format:</span></p><p><span style="font-family: courier; font-size: medium;"> <b><span style="background-color: #eeeeee;">DSNSnnnnnI</span></b></span><b><span style="font-family: courier; font-size: medium;"><span style="background-color: #eeeeee;"><br /></span></span></b></p><p><span style="font-family: verdana; font-size: medium;">The first three characters, as we have mentioned, is the three-character message identifier, which in Db2 for z/OS is DSN.</span></p><p><span style="font-family: verdana; font-size: medium;">The next single character, shown by the S above, is the subcomponent identifier. This character identifies the subcomponent of Db2 that issued the message. Each subcomponent has an associated hexadecimal identifier (hex ID), which is the hexadecimal representation of the subcomponent identifier. These identifiers (as of Db2 13 for z/OS) are as follows:</span></p><p><span style="font-family: verdana; font-size: medium;"></span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">A<span> </span>Call attachment facility and some Db2 supplied stored procedures</span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">B<span> </span>Buffer manager <span style="background-color: #eeeeee;"></span><br /><br />E<span> </span>TSO attachment facility </span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">F<span> </span>Message generator </span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">G<span> </span>Database descriptor manager </span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">H<span> </span>Precompiler, DSNH CLIST </span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">I<span> </span>Data Manager </span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">J<span> </span>Recovery log manager</span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">L<span> </span>DDF</span></p><div style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">M<span> </span>IMS Attachment Facility</span><br /></div><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">P<span><span> </span></span>Data space manager </span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">Q <span> </span>MQListener</span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">R<span> </span>Recovery manager </span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">S <span> </span>Storage manager </span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">T<span> </span>Service controller, install </span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">U<span> </span>Utilities U <br /></span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">V<span> </span>Agent services manager </span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">W<span> </span>Instrumentation facility</span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">X<span> </span>Relational data system </span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">Y<span> </span>Initialization procedures </span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">Z<span> </span>System parameter manager</span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">1<span> </span>Service facilities</span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">3<span> </span>Subsystem support subcomponent<br /></span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">5<span> </span>Db2 Accessories Suite for z/OS</span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">7<span> </span>Group manager </span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">8<span> </span>Sample applications </span></p><p style="margin-left: 40px; text-align: left;"><span style="font-family: verdana; font-size: x-small;">9<span> </span>General command processor</span></p><p><span style="font-family: verdana; font-size: medium;">The next three to five characters (beginning at the fifth character and indicated by nnnnn) is the numeric identifier of the message. This identifier is unique within each subcomponent.<br /></span></p><p><span style="font-family: verdana; font-size: medium;">The final character of the message identifier (indicated by I in the example above) is the type code. This is sometimes thought of a severity code, but most Db2 messages use I for the type code, regardless of the severity or whether an action is required. Some older Db2 messages use other type codes, but keep in mind that the type code does not necessarily reflect the severity of the message. </span></p><p><b><span style="font-family: verdana; font-size: medium;">What Does the Message Mean?</span></b></p><p><span style="font-family: verdana; font-size: medium;">To understand the meaning of a message you will need to look up the message identifier in the Db2 Messages manual. The manual is broken down into chapters, with each chapter devoted to a subcomponent. So, what if you receive a DSNJ994I Db2 message?<br /></span></p><p><span style="font-family: verdana; font-size: medium;">Well, we know that the J means this is a recovery log manager error. If we look this up in the manual (Chapter 8 for Db2 13 for z/OS), we see the following explanation:</span></p><p><span style="font-family: verdana; font-size: medium;"></span><span style="font-family: courier; font-size: small;"><span> </span><span style="background-color: #fce5cd;">VSAM OPEN failed with the indicated ACB error-code</span><br /><span> </span><span style="background-color: #fce5cd;">for the indicated dd-name.</span></span><span style="font-family: courier; font-size: small;"><span style="background-color: #fce5cd;"><br /></span></span></p><p><span style="font-size: medium;"><span style="font-family: verdana;">This is a time to co</span></span><span style="font-size: small;"><span style="font-family: verdana;">ntact your system programmer because Db2 cannot open the underyling VSAM data set.</span></span></p><span style="font-family: verdana; font-size: medium;"><b>Summing Things Up</b></span><p><span style="font-family: verdana; font-size: medium;">Understanding Db2 messages is a crucial aspect of being able to effectively program, manage, monitor, and resolve Db2 problems. Be sure to have the Db2 manuals and documentation available (either online or downloaded to your computer) to be able to retrieve detailed information about the various messages and their meanings when you need them.</span></p><span style="font-family: verdana; font-size: medium;">The </span><span style="font-family: verdana; font-size: medium;"><a href="https://www.ibm.com/docs/en/SSEPEK_13.0.0/pdf/db2z_13_msgsbook.pdf" target="_blank">Db2 for z/OS Messages</a> </span><span style="font-family: verdana; font-size: medium;">manual provides comprehensive information about Db2 messages and it is a valuable resource for troubleshooting and understanding system behavior.</span>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com0tag:blogger.com,1999:blog-18371456.post-27588415484777848612023-12-04T07:00:00.001-06:002023-12-04T07:00:00.132-06:00My Top Ten Db2 Performance Posts<p><span style="font-family: verdana; font-size: medium;">Regular readers of this blog will notice that the past few months have been consumed by my posts outlining my Top Ten Db2 Performance tips.</span></p><p><span style="font-family: verdana; font-size: medium;">So, it being December and the end of the year, I thought it would be a good idea to publish a post with links to each of the Top Ten tips... so here it is!</span></p><p><span style="font-family: verdana; font-size: medium;">Number 1 - <a href="https://db2portal.blogspot.com/2023/06/top-10-db2-performance-tips-no-1.html" target="_blank">Analyze Query Execution Plans</a></span></p><p><span style="font-family: verdana; font-size: medium;">Number 2 - <a href="https://db2portal.blogspot.com/2023/07/top-10-db2-performance-tips-no-2.html" target="_blank">Optimize Your Database Design</a></span></p><p><span style="font-family: verdana; font-size: medium;">Number 3 - <a href="https://db2portal.blogspot.com/2023/07/top-10-db2-performance-tips-no-3.html" target="_blank">Efficient Indexing Strategies</a></span></p><p><span style="font-family: verdana; font-size: medium;">Number 4 - <a href="https://db2portal.blogspot.com/2023/07/top-10-db2-performance-tips-no-4.html" target="_blank">Effective Memory Configuration</a></span></p><p><span style="font-family: verdana; font-size: medium;">Number 5 - <a href="https://db2portal.blogspot.com/2023/07/top-10-db2-performance-tips-no-5.html" target="_blank">Workload Management and Query Optimization</a></span></p><p><span style="font-family: verdana; font-size: medium;">Number 6 - <a href="https://db2portal.blogspot.com/2023/08/top-10-db2-performance-tips-no-6.html" target="_blank">Monitoring and Performance Metrics</a></span></p><p><span style="font-family: verdana; font-size: medium;">Number 7 - <a href="https://db2portal.blogspot.com/2023/08/top-ten-db2-performance-tips-no-7.html" target="_blank">Configuration Parameters and Tuning</a></span></p><p><span style="font-family: verdana; font-size: medium;">Number 8 - <a href="https://db2portal.blogspot.com/2023/10/top-ten-db2-performance-tips-no-8-io.html" target="_blank">I/O Optimization</a></span></p><div><span style="font-family: verdana; font-size: medium;">Number 9 - <a href="https://db2portal.blogspot.com/2023/11/top-ten-db2-performance-tips-no-9.html" target="_blank">Regular Maintenance and Housekeeping</a></span></div><p><span style="font-family: verdana; font-size: medium;">Number 10 - <a href="https://db2portal.blogspot.com/2023/11/top-ten-db2-performance-tips-no-10-stay.html" target="_blank">Stay Up-to-Date</a></span></p><p><span style="font-family: verdana; font-size: medium;"><br /></span></p><p><span style="font-family: verdana; font-size: medium;">Of course, a list such as this will not be comprehensive in terms of listing everything that you may encounter on your path to efficient Db2 performance... but it can serve as a good place to start that journey.</span></p><p><span style="font-family: verdana; font-size: medium;">Let me know your thoughts on anything in this list... or share your performance stories and headaches with us here on the blog!</span></p>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com1tag:blogger.com,1999:blog-18371456.post-73656923895531932522023-11-28T13:09:00.003-06:002023-11-28T16:43:49.504-06:00Top Ten Db2 Performance Tips - No. 10 Stay Up to Date<p><span style="font-family: verdana; font-size: medium;"><span>Keeping Db2 up to date is of paramount importance for ensuring the security, stability, and optimal
performance of your database environment. For Db2 for z/OS this means formulating a plan for applying PTFs (Program Temporary Fixes) and correlating your DB2 fixes with your system, ideally following <a href="https://www.ibm.com/docs/en/zos/2.1.0?topic=guide-recommended-service-upgrade-rsu" target="_blank">IBM's RSU (Recommended Service Upgrade)</a> preventive service philosophy. </span><span>For Db2 for LUW it means keeping up with fix packs.</span></span></p><p><span style="font-family: verdana; font-size: medium;">Why is it important to stay current with maintenance? And what are the benefits of doing so?</span></p><p></p><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;"><b>Security</b>: Cyber threats and vulnerabilities are
ever-evolving, and database systems are potential targets for malicious
activities. By staying up to date with the latest patches and fixes, you can
ensure that your Db2 systems are protected with the latest security
enhancements. Patching known vulnerabilities helps protect sensitive data,
prevent unauthorized access, and reduce the risk of security breaches.</span></li><li><span style="font-family: verdana; font-size: medium;"><b>Bug Fixes and Stability</b>: Software systems, including Db2,
are not immune to bugs and glitches. The release of patches and fixes addresses
identified issues, improving the overall stability and reliability of the
database system. Applying these updates helps mitigate performance issues,
software crashes, or data inconsistencies that may arise from known bugs.
Keeping your Db2 environment updated with the latest fixes contributes to a
smoother and more reliable database experience.</span></li><li><span style="font-family: verdana; font-size: medium;"><b>Performance</b>: IBM regularly releases
performance enhancements for Db2. Applying the latest patches
and fixes ensures that you benefit from these improvements, allowing your
database to operate at its optimal efficiency. The updates may include query
optimization, resource management enhancements, or other performance-related
optimizations, helping to maximize the speed and responsiveness of your Db2
systems and applications.</span></li></ul><p></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><o:p>Another important aspect of staying up to date is tracking and upgrading the version and level of your Db2 systems. </o:p><span>IBM clearly provides information on the product lifecycle for Db2 (and all of their products). I</span><a href="https://www.ibm.com/support/pages/where-can-i-find-end-support-eos-dates-all-versions-db2" target="_blank">nformation for DB2 for z/OS is provided here</a><span>. The first thing to be aware of is that you </span><span>always want to be running supported software. </span></span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><span style="background-color: white; color: #161616;">If your software is not supported and you run into issues or problems, IBM will not provide support for unsupported software. When your software versions reach their EOS date and support is no longer available through standard Software S&S, you have the option to purchase Continuing Support (typically at a higher rate). It is usually more cost-effective and less risky to migrate to the new, supported version. Furthermore, documentation for unsupported versions of </span><span style="background-color: white;">IBM software typically </span><span style="background-color: white; color: #161616;">is not available in IBM Knowledge Center.</span></span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><span style="background-color: white; color: #161616;">Therefore, it is wise to be </span><span style="background-color: white; color: #161616;">watchful of the EOM and EOS announcements made for your current version of Db2. EOM is the End of Marketing date. When this date is reached you can no longer order that version of the software. IBM Db2 12 for a/OS reached its EOM date in June 2023. More important is the EOS, or End of Service, date. After this date is reached that version of the software is out of support. For Db2 12 for z/OS EOS is scheduled for 2023-12-31 (at the time this blog is being published). At times, EOS and EOM date may be revised due to customer and/or IBM needs.</span></span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><span style="background-color: white; color: #161616;">I maintain links to the IBM product lifecycle pages on my web site at </span><span style="color: #161616;"><a href="https://www.mullinsconsulting.com/db2.htm">https://www.mullinsconsulting.com/db2.htm</a>. </span></span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><span style="color: #161616;">Furthermore, as of Db2 12 for /OS, it is also important to keep up to date with the Function Level for your subsystems. Instead of requiring new versions or releases to provide new functionality, IBM is now using a <a href="http://www.redbooks.ibm.com/Redbooks.nsf/RedbookAbstracts/redp5469.html?Open" target="_blank">continuous delivery</a> model. So, instead </span><span style="background-color: white; color: #444444;"><span>of waiting years for a new version. This means that you should also be tracking function levels, applying maintenance when needed to support them, and activating new function levels on a continuous basis. Failing to do so means that you will be behind the curve when an eventual new version is released.</span></span></span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">To access the latest patches and fixes for Db2, IBM provides
resources and support channels that you can leverage:</span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><o:p></o:p></span></p>
<p class="MsoNormal"></p><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;"><b>IBM Fix Central</b>: IBM Fix Central is a centralized portal
where you can search, download, and apply patches, fixes, and updates for
various IBM software products, including Db2. It offers an intuitive interface
to locate the required fixes based on specific product versions and platforms.</span></li><li><span style="font-family: verdana; font-size: medium;"><o:p> </o:p><b>IBM Support Portal</b>: The IBM Support Portal is a
comprehensive resource for accessing product documentation, technical articles,
and obtaining support for IBM software. It provides a wealth of information on
Db2, including links to downloads, useful articles, and official
product documentation.</span></li><li><span style="font-family: verdana; font-size: medium;"><o:p> </o:p><b>IBM Passport Advantage</b>: If you have a valid software
maintenance subscription or license agreement with IBM, you can access the
latest patches, fixes, and updates through the IBM Passport Advantage website.
This platform enables authorized users to download software updates and manage
their entitlements.</span></li></ul><p></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><o:p>You should also keep up to date by following useful online forums and user groups. <a href="http://www.idug.org" target="_blank">IDUG </a>offers a good central site for such groups, and useful DB2 information is also offered by <a href="https://www.share.org" target="_blank">SHARE</a>. Both of these organizations offer </o:p>vibrant community forums and discussion boards that can provide valuable insights into the
latest information about Db2. Furthermore, community members often share their
experiences, recommendations, and helpful tips for staying up to date with Db2
updates.</span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p><span style="font-family: verdana; font-size: medium;">Finally, I have to promote my web site <a href="http://www.mullinsconsulting.com" target="_blank">Mullins Consulting, Inc.</a> where I frequently post new information about Db2 as well as my articles and books on Db2.</span></o:p></p><p class="MsoNormal"><o:p><b><span style="font-family: verdana; font-size: medium;">Summing It All Up</span></b></o:p></p><p><span style="font-family: verdana; font-size: medium;">In conclusion, staying up to date with the latest patches
and fixes for Db2 is essential for maintaining a secure, stable, and
high-performing database environment. By applying the latest updates, you
benefit from enhanced security, bug fixes, stability improvements, and
performance optimizations. Leveraging the resources available to you (such as those discussed above), and engaging with the Db2 community
forums ensures that you have access to the most recent updates and support to keep
your Db2 environment current and reliable.</span></p><p class="MsoNormal"><o:p></o:p></p>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com1tag:blogger.com,1999:blog-18371456.post-81520871505367620572023-11-09T11:27:00.000-06:002023-11-09T11:27:04.107-06:00Top Ten Db2 Performance Tips – No. 9 Regular Maintenance and Housekeeping<p><span style="font-family: verdana; font-size: medium;">When thinking about the performance characteristics of your
Db2 databases and applications keep in mind the routine
maintenance that can help or hinder your performance. Regular maintenance and
housekeeping tasks are essential for ensuring the optimal performance and
stability of your Db2 environment. </span></p><p><span style="font-family: verdana; font-size: medium;">By performing routine maintenance
activities, database administrators can proactively address performance
degradation, optimize query execution, and maintain a healthy database
environment. In today’s post, we will highlight the importance of regular
maintenance tasks and discuss key activities that contribute to database
performance.</span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-family: verdana; font-size: medium;">Index Maintenance<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Indexes play a crucial role in query performance, as they
facilitate quick data retrieval. Over time, indexes can become fragmented,
leading to increased disk I/O and decreased query performance. Regularly
reorganizing indexes helps eliminate fragmentation and enhances query execution
efficiency. By scheduling index reorganization tasks based on the fragmentation
level and database activity, administrators can maintain optimal index
performance and minimize the impact of fragmentation on query response times.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">You should also monitor index usage and consider removing
any unused indexes. You can <a href="https://db2portal.blogspot.com/2012/02/identifying-unused-indexes.html">identify
unused indexes</a> relatively easily using the LASTUSED information in the RTS
SYSINDEXSPACESTATS table in the Db2 Catalog.<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-family: verdana; font-size: medium;">Tablespace Reorganization<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">As your database grows and data is modified or deleted,
storage space can become fragmented, leading to suboptimal performance.
Regularly reorganizing database structures helps to consolidate data, reclaim
unused space, and optimize storage allocation. Reorganizing your tablespaces can
improve I/O performance, reduce disk fragmentation, and enhance overall system
efficiency. By performing regular database reorganizations based on data growth
patterns and workload characteristics, administrators can maintain a
well-organized and performant database environment.<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-family: verdana; font-size: medium;">Up-to-Date Statistics <o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Accurate and up-to-date statistics are essential for the Db2
optimizer to make informed decisions on query execution plans. As data in the
database changes, statistics need to be updated to reflect the current
distribution of data. Regularly updating statistics (using the RUNSTATS utility) ensures that the optimizer
has the most accurate information to generate optimal execution plans. By
analyzing data distribution patterns and scheduling statistics updates
accordingly, administrators can improve query performance and avoid suboptimal
query plans caused by outdated statistics.<o:p></o:p></span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">For packages using static SQL, taking advantage of updated statistics requires rebinding. However, you may not want to rebind every time you run RUNSTATS unless application performance is suffering.</span></p>
<p class="MsoNormal"><b><span style="font-family: verdana; font-size: medium;">Routine Backups<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Regular backups are vital for data protection and disaster
recovery. Performing routine database backups not only safeguards the integrity
of the database but also contributes to performance optimization. In the event
of a failure or data loss, having a recent backup minimizes the recovery time
and ensures business continuity. DBAs should establish a backup schedule based
on the criticality of the data, recovery time objectives (RTOs), and workload
requirements. </span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">And do not forget to regularly test your recovery plans and
capabilities. </span><span style="font-family: verdana; font-size: large;">Too often DBAs focus on backups at the expense of recovery… and
backups are needed primarily to enable recovery, right?</span></p>
<p class="MsoNormal"><b><span style="font-family: verdana; font-size: medium;">Transaction Log Management<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">And let’s not forget the transaction logs! Logs play a
critical role in ensuring data consistency and recoverability. Regularly
monitoring and managing the transaction log space helps prevent log-related
performance issues and ensures uninterrupted database operations. Activities
such as transaction log backups, log file sizing, optimizing log offloading,
and log file utilization monitoring are crucial for maintaining optimal
transaction log performance and managing log space efficiently.<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-family: verdana; font-size: medium;">Buffer Pool Review<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Regularly monitoring the efficiency of your Db2 buffer pools
is important to ensure that you are achieving expected hit ratios and
performance. As new applications are added, your amount of data increases, and
access patterns change it will be necessary to adjust buffer pool sizes and
parameters to optimize performance.<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-family: verdana; font-size: medium;">System Maintenance<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Be sure to keep your Db2 subsystem updated with recent
maintenance. You can use the -DIS GROUP command, even if you are not running data
sharing, to display the current status of your Db2 software.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">This command returns the message DSN7100I which is
documented at <a href="https://www.ibm.com/docs/en/db2-for-zos/13?topic=messages-dsn7100i">https://www.ibm.com/docs/en/db2-for-zos/13?topic=messages-dsn7100i</a>.
It will show you the current version and function level, the current code
level, and also the highest possible function level you can activate for your Db2
environment.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Be sure too to follow the IBM recommended <a href="https://public.dhe.ibm.com/systems/z/servicetest/zOS_Preventive_Maintenance_Strategy.pdf">preventive
maintenance strategy</a> to apply the appropriate maintenance using the IBM
supplied RSU (Recommended Service Upgrade). <o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-family: verdana; font-size: medium;">Summary<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">By incorporating these regular maintenance tasks into your
database administration and management routine, DBAs and systems programmers can
optimize performance, prevent performance degradation, and mitigate potential
issues. Automation tools and scripts can streamline these maintenance
activities and ensure consistency and timeliness in execution.</span><o:p></o:p></p>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com0tag:blogger.com,1999:blog-18371456.post-26411112801615519462023-10-17T11:45:00.003-05:002023-10-17T11:45:51.860-05:00Top Ten Db2 Performance Tips – No. 8 I/O Optimization<p><span style="font-family: verdana; font-size: medium;">I/O operations play a critical role in the performance of an
IBM DB2 database and the applications that access it. Efficient disk I/O can
significantly impact query response times and overall system performance. Let’s
explore the importance of I/O optimization and discuss techniques for
maximizing disk I/O performance.</span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">The performance of I/O directly affects the speed at which
data is read from or written to disk. Slow or inefficient I/O can become a
performance bottleneck, leading to increased query execution times and degraded
system responsiveness. <o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-family: verdana; font-size: medium;">Data Set Placement<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">One technique for optimizing disk I/O is strategic data
placement. Placing frequently accessed data on faster storage devices, such as
solid-state drives (SSDs) or high-performance disk arrays, can significantly
improve I/O performance. Identifying hot spots, such as frequently accessed
tables or indexes, and ensuring they are stored on optimal storage
media can help minimize I/O bottlenecks and accelerate query processing.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">When it comes to the placement of Db2 data sets, the most critical
consideration is certainly the log data sets and the BSDS. Be sure to place the
active logs and BSDS data sets on the fastest disk you have at your disposal.
The log can quickly become a bottleneck because all changes (with few
exceptions) are written to the logs. Db2 writes first to log buffers and
then from the buffers to an active log data set. The log is there to ensure
recoverability. So, using the highest-speed disk for your logs can help to
minimize the potential for pain here. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">You also need to take care to make sure that your logs are efficient
and effective by running with dual logs. By doing so you ensure that if one
copy of the log is damaged, Db2 can continue operating with the other copy. If
there is no log available Db2 operations screech to a halt. To run with dual
logging, one set of log data sets should be on separate volumes than the other
set. This should remove a disk failure as the cause of an outage.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">As the active logs are filled, a process called log
offloading is invoked by Db2 to move the log information to archive log data
sets. This process prohibits the active logs from filling up during Db2
processing which would stifle processing. The archive logs are needed for
recovery situations, such as rolling back transactions and recovering table
spaces and indexes. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">It is a wise course of action to keep your archive logs on
disk, and over time migrate them to tape. Think about the trade-off in saving
tape versus recovery speed, and your decision should be obvious. Before backing
up any logs to tape, it’s a good idea to always have at least 24 hours covered
by the active log and the least 48 hours by archive logs on disk.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">And then there is the BSDS (bootstrap data set), which is a
VSAM key-sequenced data set (KSDS). The BSDS contains important information for Db2
operations. One such piece of information is the names of the logs. Db2 uses
information in the BSDS for system restarts and for any activity that requires
reading the log. So again, keeping the BSDS on high-speed disk further
boosts the operational performance of Db2. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Of course, there are other important Db2 data sets that
you will want to carefully consider placing on optimal I/O devices. For example, the Db2 Directory (DSNBD01) and Db2
Catalog (DSNBD06) data sets are frequently accessed and should be cared for to ensure
the performance of the entire Db2 subsystem. And you may have some user database
objects that are critically important or frequently accessed that you can place
on faster disk than your other user database objects. This, of course, requires
an understanding of your business and Db2 applications, as well as the
appropriate budget to accomplish.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">The overall goal of data set placement should be to balance
I/O activity between different volumes, control units, and channels. This can minimize
I/O elapsed time and I/O queuing.<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-family: verdana; font-size: medium;">RAID<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">RAID (Redundant Array of Independent Disks) configurations
also play a significant role in I/O optimization. RAID levels, such as RAID 0,
RAID 1, RAID 5, or RAID 10, offer different levels of performance, fault
tolerance, and data protection. Configuring RAID appropriately based on
workload requirements and system resources can improve I/O performance and
provide the desired level of data redundancy. RAID striping, in particular, can
distribute data across multiple disks, enabling parallel I/O operations and
enhancing throughput.<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-family: verdana; font-size: medium;">What About Extents? <o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Some folks think “With RAID/modern storage devices and the latest
Db2 and z/OS features, extents are no longer anything to worry about.” And this
is a largely true statement, but there are some things you still should think about with regard to extents.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">First, keep in mind that the latest extent management features
only work with SMS-managed data sets, so if you are still using user-managed
data sets then all of the old rules apply! For SMS-managed data set you can
have up to 123 extents on each of 59 volumes. So as of z/OS 1.7, the limit is
7,257 extents for a data set instead of the 255 we’ve been used to for some
time. Again though, to enable this requires DFSMS. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Extent consolidation also requires SMS-managed STOGROUPs. If
a new extent is adjacent to an old extent, they will be merged together
automatically. This can result in some extents being larger than the PRIQTY or
SECQTY specification(s).<i> Note that this feature was introduced in z/OS 1.5. </i><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">So, what if everything is SMS-controlled? Even then it is
possible for extents to impact performance, albeit probably only slightly. Each
extent on a disk file has different control blocks controlling access. This
means that elapsed time can increase if there is heavy insert activity. For
other types of processing (read and update) the number of extents really does
not impact on performance. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Another thing to consider is that Db2 can allocate sliding
scale secondary extents. This is enabled by setting MGEXTSZ DSNZPARM to YES.
<i>Note that the default is YES as of DB2 9 for z/OS. </i>With sliding scale extents
the extent sizes allocated gradually increase. Db2 uses a sliding scale for
secondary extent allocations of table spaces and indexes when: <o:p></o:p></span></p>
<p class="MsoNormal"></p><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;">You do not specify a value for the SECQTY option of a CREATE
TABLESPACE or CREATE INDEX statement </span></li><li><span style="font-family: verdana; font-size: medium;">You specify a value of -1 for the SECQTY option of an ALTER
TABLESPACE or ALTER INDEX statement. </span></li></ul><p></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Otherwise, Db2 uses the SECQTY value for secondary extent
allocations, if one is explicitly specified (and the SECQTY value is larger
than the value that is derived from the sliding scale algorithm). If the table
space or index space has a SECQTY greater than 0, the primary space allocation
of each subsequent data set is the larger of the SECQTY setting and the value
that is derived from a sliding scale algorithm. Without going into all of the
gory details, sliding scale extent allocation can help to reduce the number of
extents for your Db2 objects as they grow in size over time. And it can help
when you do not have a firm understanding of how your data will grow over time.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">At any rate, things are not like the olden days where you
had to regularly monitor extents and clean them up all the time by reorganizing
your table spaces and index spaces. <o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-family: verdana; font-size: medium;">Additional I/O Considerations<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Optimizing I/O parallelism settings can help to improve disk
I/O performance. Tuning I/O parallelism settings, such as the number of
concurrent I/O operations or I/O thread configuration, can also enhance I/O
performance by allowing simultaneous access to multiple disks or storage
devices.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Regular monitoring of I/O performance metrics, such as disk
read/write rates, queue lengths, and average response times, is essential for
identifying potential I/O bottlenecks and fine-tuning the I/O subsystem.
Analyzing performance data and workload patterns can help identify areas for
improvement and guide decision-making regarding data placement, file system
selection, RAID configuration, and other I/O optimization techniques.<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-family: verdana; font-size: medium;">Conclusion<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">In conclusion, optimizing disk I/O is vital for improving
the performance of Db2 databases and the applications that access them. By
strategically placing data, properly configured your logs and BSDS, configuring
RAID appropriately, tuning I/O parallelism settings, and regular monitoring,
you can enhance I/O performance, reduce latency, and accelerate query
processing. </span><o:p></o:p></p>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com2tag:blogger.com,1999:blog-18371456.post-9507073210492980622023-08-29T06:00:00.001-05:002023-08-29T06:00:00.142-05:00Top Ten Db2 Performance Tips - No. 7 Configuration Parameters and Tuning<p><span style="font-family: verdana; font-size: medium;">Configuration parameters play a crucial role in optimizing
the performance of an IBM Db2 database environment. By understanding the impact of these
parameters and tuning them appropriately, database administrators can fine-tune
the system to achieve optimal performance. In this blog post, we will explore key
configuration parameters and discuss recommended settings and tuning options.</span></p><p><span style="font-family: verdana; font-size: medium;">The first thing to understand is that the actual parameters, their specific names, and how they are implemented and modified will differ between Db2 LUW and Db2 for z/OS. This blog post will talk mostly in generalities but the ideas resonate across all Db2 database management systems (and, indeed, even across other relational DBMS platforms).</span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">The first type of parameters are used to configure <i>Database Manager </i>options. The database manager
configuration parameters govern the overall behavior of the Db2 instance.
Parameters such as database shared memory, lock list, and log buffer size have
a significant impact on performance. Adjusting the shared memory size to
accommodate the workload, appropriately sizing the lock list to handle
concurrent transactions, and setting an optimal log buffer size based on the
transaction rate are essential considerations.</span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Next we have the <i>Buffer Pool</i> parameters. Buffer pools act as a cache for frequently
accessed data pages, reducing disk I/O and improving query performance. The
size and configuration of buffer pools are critical for efficient memory
utilization. Allocating an appropriate amount of memory to buffer pools based
on workload characteristics and monitoring buffer pool hit ratios helps
optimize performance. </span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Here are some crucial considerations for configuring Db2 for z/OS buffer pools:</span></p><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;">Data Access Patterns: Understand the access patterns of your applications. Buffer pool configuration should align with the types of queries and transactions that are frequently executed. If your workload involves mostly random access, a larger buffer pool may be required. If it involves mostly sequential access, specific settings to favor sequential reads may be required.</span></li><li><span style="font-family: verdana; font-size: medium;">Buffer Pool Sizing: Determine the appropriate size for each buffer pool. Consider the amount of available memory on your system, the size of the database objects, and the anticipated workload. Larger buffer pools can improve performance, but it's essential to balance memory usage across other system components.</span></li><li><span style="font-family: verdana; font-size: medium;">Multiple Buffer Pools: Db2 for z/OS allows you to create multiple buffer pools. Consider segregating data based on access patterns or table spaces. For example, you could use separate buffer pools for frequently accessed tables and indexes versus less frequently accessed ones.</span></li><li><span style="font-family: verdana; font-size: medium;">Page Sizes: Db2 for z/OS supports various page sizes. Ensure that the buffer pool page size matches the page size of the objects being cached. Using the correct page size can reduce internal I/O operations and improve efficiency.</span></li><li><span style="font-family: verdana; font-size: medium;">Thresholds and Actions: Set appropriate thresholds for buffer pool thresholds, such as the high water mark and low water mark. Define actions to be taken when these thresholds are crossed, such as dynamically adjusting the buffer pool size or issuing alerts.</span></li><li><span style="font-family: verdana; font-size: medium;">Asynchronous I/O: Enable asynchronous I/O to allow Db2 to overlap I/O operations with processing. This can improve performance by reducing wait times caused by synchronous I/O operations.</span></li><li><span style="font-family: verdana; font-size: medium;">Monitor and Analyze: Regularly monitor buffer pool performance using Db2's monitoring tools. Analyze statistics and performance metrics to identify areas for improvement or potential issues.</span></li><li><span style="font-family: verdana; font-size: medium;">Buffer Pool Replacement Policies: Understand and configure the buffer pool replacement policies (e.g., LRU, MRU, FIFO) based on your workload characteristics. Different policies prioritize different data pages for retention in the buffer pool.</span></li><li><span style="font-family: verdana; font-size: medium;">Maintenance: Regularly review and adjust buffer pool configurations based on changing workloads, data growth, and hardware upgrades.</span></li></ul><p></p><div style="text-align: left;"><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background: 0px 0px rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #373737; margin: 0px; outline: 0px; padding: 0px 0px 1em; text-size-adjust: 100%; vertical-align: baseline;"><span style="font-family: verdana; font-size: medium;">Also, Db2 for z/OS offers the following buffer pool tuning “knobs” that can be used to configure buffer pools to the type of processing they support:</span></p><p></p><p style="text-align: left;"></p><ul style="text-align: left;"><li><span style="color: #373737; font-family: verdana; font-size: medium;">DWQT (deferred write threshold) – expressed as a percentage of the virtual buffer pool that might be occupied by unavailable pages. When this threshold is reached Db2 will start to schedule write I/Os to externalize data. The default is 30%, which may be too high for many shops.</span></li></ul><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;">VDWQT (vertical deferred write threshold) – basically the same as DWQT, but for individual data sets. The default is 10%, which once again is quite likely to be too high for many shops.</span></li></ul><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;">VPSEQT (sequential steal threshold) – expressed as a percentage of the buffer pool that can be occupied by sequentially accessed pages. Tune buffer pools for sequential access such as scans and sorting by modifying VPSEQT to a larger value. The default is 80%.</span></li></ul><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;">VPPSEQT (parallel sequential steal threshold) – the sequential steal threshold for parallel operations; the default value is 50%.</span></li></ul><p></p><p></p></div><div><span style="font-family: verdana; font-size: medium;">Additionally, adjusting parameters like page cleaning and prefetch size can further enhance buffer pool performance.</span></div><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Remember that buffer pool configuration is not a one-size-fits-all approach. It requires a deep understanding of your specific workload, database design, and hardware capabilities. Regular monitoring and tuning are essential to maintain optimal performance over time.</span></p><p style="text-align: left;"><span style="font-family: verdana; font-size: medium;">There are other <i>Memory </i>settings that are nearly as critical as buffer pools, too. One example is the Db2 for z/OS EDM pool. EDM stands for Environmental Descriptor Manager. The<span style="background-color: white;"> EDM pool is used by Db2 to control programs as they execute. It will contain </span><span style="background-color: white;">structures that house the access paths of the SQL statements for running programs. </span></span></p><p style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><span style="background-color: white;">Actually, the EDM pool is a group that encompasses several other pools, all of which can be configured separately, including skeleton pools, DBD pool, sort pool, and RID pool. </span><span style="background-color: white;">The RID pool is used by DB2 to sort RIDs (record identifiers) for List Prefetch, Multiple Index Access, and Hybrid Join access paths.</span><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white;"> </span><span style="background-color: white;">RID pool failures can cause performance degradation as alternate access paths are invoked, such as scans, and the CPU invested up to the point of the failure is wasted.</span></span></p><p style="text-align: left;"><span style="background-color: white;"><span style="font-family: verdana; font-size: medium;">Db2 for z/OS also enables a <i>Dynamic Statement Cache</i> to be configured and tuned. It permits dynamic SQL prepare information to be cached in memory to optimize dynamic SQL. </span></span></p><div><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white;"><span style="font-family: verdana; font-size: medium;"><span style="background-color: transparent;">Another consideration to keep in mind is </span><span style="background-color: transparent;"><i>Query Parallelism</i>, which refers to the ability
of Db2 to execute multiple query tasks concurrently, leveraging multiple CPU
cores. Enabling parallelism can significantly speed up query execution for
resource-intensive workloads. The degree of parallelism, controlled by parameters
like DFT_DEGREE and NUM_INIT_AGENTS, should be set based on the available
hardware resources and workload characteristics. Careful tuning of these
parameters ensures optimal parallel query execution without overloading the
system.</span></span></p></div>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Tuning Db2 <i>Sort </i>operations is also critical. During query execution sorting can
consume significant memory resources. The sort heap is responsible for
allocating memory for sort operations. Tuning the Db2 LUW SORTHEAP parameter to an
appropriate size based on the complexity of sort operations and available memory
helps avoid excessive disk I/O and improves query performance. Regular
monitoring and adjustment of SORTHEAP ensure efficient memory utilization for
sort operations.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><i>Statement Concentration</i> is another configuration parameter to consider. It controls the consolidation of multiple SQL
statements into a single unit of work. Enabling statement concentration reduces
the overhead associated with parsing and optimizing individual statements,
improving overall performance. By setting appropriate values for parameters
like STMT_CONC and STMTHEAP, administrators can optimize statement
concentration based on the workload and resource availability.</span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><i>Connection and Maximum </i>settings are also crucial to consider. For example, in Db2 for z/OS MAXDBAT sets the maximum number of database agents and Db2 LUW uses MAXAPPLS to define the maximum number of concurrent application connections. And an example of a setting that can control maximums is DSMAX (Db2 for z/OS) that can be set between 1 and <span style="background-color: white; color: #161616; letter-spacing: 0.16px;">200000; it controls the maximum number of underlying data sets that Db2 can have open at any point.</span></span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">It is important to note that tuning these configuration
parameters should be done carefully and based on workload analysis and
performance monitoring. The optimal settings may vary depending on the specific
requirements and characteristics of the database environment. Regular
monitoring of performance metrics, workload patterns, and system behavior is
crucial to identify areas for tuning and ensure continued optimization.</span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><b>Summary</b></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">In conclusion, configuration parameter tuning is a critical
aspect of optimizing the performance of an IBM Db2 database. By understanding
the impact of key parameters and adjusting them based on workload
characteristics, administrators can fine-tune the system for optimal
performance. </span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">We have only taken a high-level look at several configuration considerations and parameters in this blog post. But keep in mind that the configuration parameters and their settings contribute
to an efficient and high-performing Db2 environment. Regular monitoring and
tuning of these parameters help achieve optimal performance and responsiveness
in the database system.</span><o:p></o:p></p>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com0tag:blogger.com,1999:blog-18371456.post-79449911048572551682023-08-08T15:00:00.001-05:002023-08-08T15:01:33.905-05:00Top 10 Db2 Performance Tips - No. 6 Monitoring and Performance Metrics<p style="text-align: left;"><span style="font-family: verdana; font-size: medium;">Monitoring and measuring performance metrics are essential
practices for maintaining and optimizing the performance of an IBM Db2 environment. By regularly monitoring and analyzing performance data, DBAs can identify bottlenecks, proactively address performance issues, and make
informed decisions to improve overall system efficiency.</span></p>
<p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">It is important to monitor and measure performance
metrics in order to gain insights into the behavior of the applications and databases in use at your site. By examining their behavior and
identifying areas for improvement, you can improve the overall satisfaction of your customers and end users. </span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">Performance metrics provide valuable
information about resource utilization, query response times, disk I/O, CPU
usage, and other critical aspects of database performance. By tracking these
metrics over time, administrators can detect patterns, identify trends, and
pinpoint potential performance bottlenecks.</span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><b>A Strategy</b></span></p><p class="BodyNoIndent" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">The first part of any Db2 performance management strategy should be
to provide a comprehensive approach to the monitoring of the Db2 subsystems
operating at your site. This approach involves monitoring not only the threads
accessing Db2 and the SQL they issue, but also the Db2 address spaces. You can
accomplish this task in three ways:<o:p></o:p></span></p><p class="BL1" style="text-align: left;"></p><p style="text-align: left;"></p><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;">Batch reports run against DB2 trace records.
While DB2 is running, you can activate traces that accumulate information,
which can be used to monitor both the performance of the DB2 subsystem and the
applications being run.</span></li></ul><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;">Online
access to DB2 trace information and DB2 control blocks. This type of monitoring
also can provide information on DB2 and its subordinate applications.</span></li></ul><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;">Sampling
DB2 application programs as they run and analyzing which portions of the code
use the most resources.</span></li></ul><span style="font-size: medium;"><span style="font-family: verdana;">Using all three approaches can be a reasonable approach if you have analyzed the type of workloads in use and which types of monitoring are most effective for each. </span><span style="font-family: verdana;"><br /></span><span style="font-family: verdana;">You also need to establish a strategy for your organization's tuning goals. And your t</span><span style="font-family: verdana;">uning goals
should be set using the discipline of <a href="https://www.dbta.com/Columns/DBA-Corner/The-Importance-of-SLAs-110871.aspx" target="_blank">service level management</a> (SLM). A service
level is a measure of operational behavior. SLM ensures applications behave
accordingly by applying resources to those applications based on their
importance to the organization. Depending on the needs of the organization, SLM
can focus on availability, performance, or both. In terms of availability, the
service level can be defined as “99.95% up time, during the hours of 9:00 AM to
10:00 PM on weekdays.” Of course, a service level can be more specific, stating
“average response time for transactions will be two seconds or less for
workloads of strategic external clients.”</span></span><p></p><p style="text-align: left;"></p><div style="text-align: left;">
<p class="NO" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">For a service
level agreement (SLA) to be successful, all of the parties involved must agree
upon stated objectives for availability and performance. The end users must be
satisfied with the performance of their applications, and the DBAs and
technicians must be content with their ability to manage the system to the
objectives. Compromise is essential to reach a useful SLA.<o:p></o:p></span></p>
<p class="NO" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">Furthermore, the
objectives of the SLA must be defined and measurable. For example, in the
earlier SLA you must define what a “strategic client” is and differentiate
strategic from nonstrategic. Although doing this may be difficult, failing to
do so can result in worthless SLAs that cannot be achieved.</span></p><p class="NO" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">In the end, if
you do not identify service levels for each transaction, then you will always
be managing to an unidentified requirement. Without a predefined and agreed
upon SLA, how will the DBA and the end users know whether an application is
performing adequately? Without SLAs, business users and DBAs might have
different expectations, resulting in unsatisfied business executives and
frustrated DBAs. Not a good situation.</span></p><p class="NO" style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><b>Db2 Traces</b></span></p><p class="BodyNoIndent" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">One of the first types of performance metrics to consider is
monitoring based on reading trace information. You can think of a Db2 trace as
a window into the performance characteristics of aspects of your Db2 workload.
Db2 traces record diagnostic information describing particular events. As Db2
operates, it writes trace information that can be read and analyzed to obtain
performance information.<o:p></o:p></span></p><p class="NO" style="text-align: left;">
</p><p class="Body" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">Db2 provides six types of traces, and each describes information
about the Db2 environment:</span></p><p class="TB" style="text-align: left;"></p><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;"><span>Accounting - </span><span>Records
performance information about the execution of DB2 application programs<o:p></o:p></span></span></li><li><span style="font-size: medium;"><span style="font-family: verdana;">Audit - </span><span style="font-family: verdana;">Provides information about DB2 DDL,
security, </span><span style="font-family: verdana;"></span><span style="font-family: verdana;">utilities, and data modification</span></span></li><li><span style="font-family: verdana; font-size: medium;"><span>Global - </span><span>Provides information for the
servicing of DB2<o:p></o:p></span></span></li><li><span style="font-family: verdana; font-size: medium;"><span>Monitor - </span><span>Records data useful for online
monitoring of the DB2 subsystem and DB2 application programs<o:p></o:p></span></span></li><li><span style="font-family: verdana; font-size: medium;"><span>Performance - </span><span>Collects
detailed data about DB2 events, enabling database and performance analysts to
pinpoint the causes of performance problems</span></span></li><li><span style="font-family: verdana; font-size: medium;"><span>Statistics - </span></span><span><span style="font-family: verdana; font-size: medium;">Records
information regarding the DB2 subsystem’s use of resources</span></span></li></ul><p></p><p class="Body"><span style="font-family: verdana; font-size: medium;">You can start Db2 traces in two ways: by specifying the appropriate DSNZPARMs at Db2 startup
or by using the -START TRACE command to initiate specific traces when Db2 is already running.<o:p></o:p></span></p><p class="Body">
</p><p class="Body"><span style="font-family: verdana; font-size: medium;">Each trace is broken down further into classes, each of which
provides information about aspects of that trace. Additional informatiohn about the classes for each type of trace can be found <a href="https://db2portal.blogspot.com/2018/06/db2-for-zos-performance-traces-part-1.html" target="_blank">here</a>, <a href="https://db2portal.blogspot.com/2018/06/db2-for-zos-performance-traces-part-2.html" target="_blank">here</a>, and <a href="https://db2portal.blogspot.com/2018/06/db2-for-zos-performance-traces-part-3.html" target="_blank">here</a>.<o:p></o:p></span></p><p class="Body"><span style="font-family: verdana; font-size: medium;">You should understand what type of information is traced and the approximate overhead of each trace class before starting any of the Db2 traces. Some traces are better left off until or unless a performance problem is occurring, at which point, the trace can be started to capture details about the situation. Others are better to have turned on before problems occur. Keep in mind that you will have some trace classes (and IFCIDs) that are always started, and other that are only used in emergencies.</span></p><p class="Body"><span style="font-family: verdana; font-size: medium;"><b><i>What are IFCIDs?</i></b></span></p><p class="BodyNoIndent"><span style="font-family: verdana; font-size: medium;">Each trace class is associated with specific trace events known as
Instrumentation Facility Component Identifier (IFCIDs), pronounced “if-kid.” An
IFCID defines a record that represents a trace event. IFCIDs are the single
smallest unit of tracing that can be invoked <br />
by Db2. <o:p></o:p></span></p><p class="Body">
</p><p class="Body"><span style="font-family: verdana; font-size: medium;">In some cases, it can make sense to avoid activating trace classes
altogether and start traces specifying only the IFCIDs needed. This way, you
can reduce the overhead associated with tracing by recording only the trace
events needed. </span><span style="font-family: "1Stone Serif"; font-size: 9pt;"><o:p></o:p></span></p><p class="Body"><span style="font-family: verdana; font-size: medium;">There are several hundred different IFCIDs. Most IFCIDs contain
data fields that describe events pertinent to the event being traced. Some
IFCIDs have no data; instead they merely mark a specific time. </span><span style="font-family: verdana; font-size: medium;">Certain trace events of extended durations require a pair of
IFCIDs: one for the beginning of the event and another for the end. These pairs
enable the computation of elapsed times. Other trace events that are not as
lengthy require only a single IFCID. </span></p><p class="Body">
</p><p class="Body"><span style="font-size: medium;"><span style="font-family: verdana;">You can find the IFCIDs associated with each trace class in the <a href="https://www.ibm.com/docs/en/SSEPEK_12.0.0/pdf/db2z_12_comrefbook.pdf" target="_blank">IBM Db2Command Reference</a> manual in the section describing the -START TRACE command. But
that manual does not describe the purpose of each IFCID. A list describing each
IFCID can be found in the data set named SDSNIVPD(DSNWMSGS), which is part of the Db2 installation</span><span style="font-family: verdana;">. </span></span></p><p class="Body"><span style="font-size: medium;"><span style="font-family: verdana;"><b>Db2 Performance Monitors</b></span></span></p><p class="BodyNoIndent"><span style="font-family: verdana; font-size: medium;">Several popular performance monitoring solutions are available for
Db2 for z/OS. IBM’s Omegamon, BMC Software’s MainView, Broadcom’s Sysview,
and Rocket Software's TMON are the leading performance monitors. When
selecting a performance monitor, be sure to examine the online components as
well as the batch reporting capabilities of the monitor. <o:p></o:p></span></p><p class="Body"><span style="font-family: verdana; font-size: medium;">An online performance monitor is a tool that provides real-time
reporting on Db2 performance statistics as Db2 operates. In contrast, a batch
performance monitor reads previously generated trace records from an input data
set. Most performance monitors today can be used to serve both purposes.<o:p></o:p></span></p><p class="Body"><span style="font-family: verdana; font-size: medium;">With online DB2 performance monitors, you can perform proactive
performance management tasks. In other words, you can set up the monitor such
that when it detects a problem it alerts a DBA and possibly takes actions on
its own to resolve the problem. <o:p></o:p></span></p><p class="Body"><span style="font-family: verdana; font-size: medium;">The most common way to provide online performance monitoring
capabilities is by online access to DB2 trace information in the MONITOR trace class. </span><span style="font-family: verdana; font-size: medium;">Some online DB2 performance monitors also provide direct access to
Db2 performance data by reading the control blocks of the Db2 and application
address spaces. This type of monitoring provides a “window” to up-to-the-minute
performance statistics while Db2 runs. This information is important if a quick
reaction to performance problems is required.</span></p><p class="Body"><span style="font-family: verdana; font-size: medium;">Most online Db2 performance monitors provide a menu-driven
interface accessible from TSO or VTAM. It enables online performance monitors
to start and stop traces as needed based on the menu options chosen by the user.
Consequently, you can reduce overhead and diminish the learning curve involved
in understanding Db2 traces and their correspondence to performance reports.<o:p></o:p></span></p><p class="Body"><span style="font-family: verdana; font-size: medium;">Following are some typical uses of online performance monitors.
Many online performance monitors can establish effective exception-based
monitoring. When specified performance thresholds are reached, triggers can
offer notification and take action. For example, you could set a trigger when
the number of lock suspensions for the TXN00002 plan is reached; when the
trigger is activated, a message is sent to the console, and a batch report is
generated to provide accounting detail information for the plan. You can set
any number of triggers for many thresholds. Following are some examples of thresholds you might choose to set:<o:p></o:p></span></p><p class="BL1"></p><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;">When a buffer pool threshold is reached (PREFETCH DISABLED, DEFERRED WRITE THRESHOLD, or DM CRITICAL THRESHOLD).</span></li><li><span style="font-family: verdana; font-size: medium;">For
critical transactions, when predefined performance objectives are not met. For
example, if TXN00001 requires subsecond response time, set a trigger to notify a DBA
when the transaction receives a class 1 accounting elapsed time exceeding 1
second by more than 25%.</span></li><li><span style="font-family: verdana; font-size: medium;">Many
types of thresholds can be established. Most online monitors support this
capability. As such, you can customize the thresholds for the needs of your DB2
environment.</span></li></ul><p></p><p class="Body"><span style="font-family: verdana; font-size: medium;">Most online performance monitors can produce real-time EXPLAINs for
long-running SQL statements. If an SQL statement takes a significant amount of
time to process, an analyst can display the SQL statement as it executes and
dynamically issue an EXPLAIN for the statement. Even as the statement executes, an
understanding of why it takes so long to run can be achieved. A complete
discussion of the EXPLAIN statement is provided in the next chapter.<o:p></o:p></span></p><p class="Body"><span style="font-family: verdana; font-size: medium;">Some online performance monitors provide historical trending.
These monitors track performance statistics and store them in DB2 tables or in
VSAM files with a timestamp. They also provide the capability to query these
stores of performance data to assist in the following:</span></p><p class="BL1"></p><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;">Analyzing recent history. Most SQL statements
execute quickly, making difficult the job of capturing and displaying
information about the SQL statement as it executes. However, you might not want
to wait until the SMF data is available to run a batch report. Quick access to
recent past-performance data in these external data stores provides a type of
online monitoring that is as close to real time as is usually needed.</span></li><li><span style="font-family: verdana; font-size: medium;">Determining
performance trends, such as a transaction steadily increasing in its CPU
consumption or elapsed time.</span></li><li><span style="font-family: verdana; font-size: medium;">Performing
capacity planning based on a snapshot of the recent performance of DB2
applications.</span></li></ul><span style="font-family: verdana; font-size: medium;">Some monitors also run when Db2 is down to provide access to the
historical data accumulated by the monitor.</span><p></p><p class="Body">
<span style="font-family: verdana; font-size: medium;">A final benefit of online DB2 performance
monitors is their capability to interface with other z/OS monitors for IMS/TM,
CICS, z/OS, or VTAM. This way, an analyst gets a view of the entire spectrum of
system performance. Understanding and analyzing the data from each of these
monitors, however, requires a different skill. Quite often, one person cannot
master all these monitors</span></p></div>
<p class="MsoNormal" style="text-align: left;"><o:p><span style="font-family: verdana; font-size: medium;"><b>Conclusion</b> </span></o:p></p>
<p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">Although this blog entry was brief, and there are many additional aspects to Db2 performance monitoring, monitoring and measuring performance metrics should be viewed as a vital requirement for all organizations using Db2 databases. </span><span style="font-family: verdana; font-size: medium;">By collecting and analyzing performance data, DBAs can
detect performance bottlenecks, identify areas for improvement, and make
informed decisions to enhance overall system efficiency. </span></p><p class="MsoNormal" style="text-align: left;"><br /></p><p class="MsoNormal" style="text-align: left;"><o:p></o:p></p>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com0tag:blogger.com,1999:blog-18371456.post-74146115768083189442023-07-24T15:27:00.011-05:002023-07-24T15:40:31.064-05:00Top 10 Db2 Performance Tips - No. 5 Workload Management and Query Optimization<p style="text-align: left;"><span style="font-family: verdana; font-size: medium;">Managing workloads and optimizing queries are essential
tasks for maximizing the performance of a Db2 databases and the applications that access them. By employing
effective techniques, DBAs and performance analysts can streamline query execution,
reduce resource contention, and enhance overall system efficiency.</span></p><p style="text-align: left;"><span style="background-color: white;"><span style="font-family: verdana; font-size: medium;">The application code itself must be designed appropriately and monitored for efficiency. In fact, many experts agree that as much as 70 to 80 percent of performance problems are caused by improperly coded database applications. SQL is the primary culprit. Coding efficient SQL statements can be complicated. Developers need to be taught how to properly formulate SQL statements and SQL statements must be constantly monitored and tuned.</span></span></p><p style="text-align: left;"><span style="background-color: white;"><span style="font-family: verdana; font-size: medium;"><b>Query Rewriting</b></span></span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana;"><span style="font-size: medium;">One technique for workload management and query optimization
is query rewriting. Query rewriting involves modifying the structure or logic
of a query to achieve better performance. This can include simplifying complex
expressions, reordering join operations, or breaking down a single complex
query into multiple simpler queries. By understanding the underlying data model
and query requirements, you can rewrite queries to optimize
execution plans and improve overall performance.</span></span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana;"><span style="font-size: medium;">With that in mind, it is important to understand that Db2 itself can perform query rewrite as part of the optimization process. The <a href="https://www.ibm.com/docs/en/db2/10.1.0?topic=guidelines-query-rewrite-optimization" target="_blank">query compiler can rewrite SQL and XQuery statements</a> into different forms to improve optimization. </span></span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana;"><span style="font-size: medium;">Of course, you (as a developer or tuner) can still make changes to SQL to try to influence the optimizer to achieve different (and hopefully better) access paths. </span></span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">SQL, by its very nature, is quite flexible. It uses a free-form structure that gives the user the ability to develop SQL statements in a way best suited to each user. Each SQL request is parsed by Db2 during compilation and optimization before it is executed to check for proper syntax and to optimize the request. </span></p><p class="MsoNormal" style="text-align: left;"><span style="font-size: medium;"><span style="font-family: verdana;">Therefore, SQL statements do not need to start in any given column and can be strung together on one line or broken apart on several lines. Any SQL request could beformulated in a number of different but functionally equivalent ways. SQL’s flexibility makes it intrinsically simple, but flexibility can complicate performance management because d</span><span style="font-family: verdana;">ifferent but equivalent SQL formulations can result in variable performance. </span></span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">When you are writing your SQL statements to access Db2 data, keep in mind that you should look at various different ways to formulate the same query to see which one performs best. For example, you might change a BETWEEN predicate to two predicates using <= and >=. This is one simple example and many different things can change an access path, so be creative and test different ways of using SQL to request the same data.</span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><b>Use EXPLAIN to Examine Access Paths</b></span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><span style="background-color: white;">Programmers need to be schooled in the practice of examining SQL access paths. <a href="https://www.educba.com/db2-explain/" target="_blank">Using EXPLAIN</a> and querying the resutls allows developers to request information on how the optimizer will satisfy each query. Will an index be used? In what order will the tables be joined? Will the query be broken up into parallel tasks or not? </span></span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><span style="background-color: white;">Of course, you may want to use a Visual Explain tool to look at access paths visually instead of querying complex and sometimes arcane data in plan tables. For example, <a href="https://wdug.com/resources/Documents/zOS%20Presentations/December%202020/Advanced%20Query%20tuning%20Using%20IBM%20Data%20Studio.pdf" target="_blank">IBM Data Studio offers a Visual Explain</a> capability (as do other tools).</span></span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><span style="background-color: white;">A few guidelines to consider:</span></span></p><p class="MsoNormal" style="text-align: left;"></p><p style="text-align: left;"></p><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;"><span style="background-color: white;">Always bind every production program using EXPLAIN YES. This will ensure that the access path details are externalized if/when you need to review them should performance issues arise.</span></span></li></ul><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;"><span style="background-color: white;">Ensure that application developers understand EXPLAIN and have access to plan table data when testing new code. Catching problematic access paths in test is clearly better than waiting for the problems to surface in production.</span></span></li></ul><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;"><span style="background-color: white;">Make sure that all Db2 developers have access to tools for reviewing and examining access paths and explain information (e.g. Data Studio).</span></span></li></ul><br /><div><b style="font-family: verdana; font-size: large;">Fundamental SQL Guidelines</b></div><p></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><span style="background-color: white;">These and many other factors influence the efficiency of SQL. Not all application problems are due to improperly coded SQL. The host language application code in which the SQL has been embedded also can be inefficient, causing database application performance to suffer.</span><br style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white;" /></span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">These are, however, three simple but important rules to follow when writing your SQL statements for performance. Of course, SQL performance is a complex topic and to understand every nuance of how SQL performs can take alifetime. That said, adhering to the following simple rules puts you on the right track to achieving high-performing Db2 applications.</span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">First, always provide only the exact columns that you need to retrieve in the SELECT-list of each SQL SELECT statement. A common way of stating this is “do not use SELECT *”. The shorthand SELECT * means retrieve all columns from the table(s) being accessed. Using SELECT * may be fine for quick and dirty queries but it is a bad practice for inclusion in application programs because:</span></p><ul type="disc">
<li class="MsoNormal" style="line-height: normal;"><span style="font-family: verdana; font-size: medium;">Db2 tables may need to be changed in the future to
include additional columns. SELECT * in production programs will retrieve
those new columns, too, and your program may not be capable of handling
the additional data without requiring time-consuming changes.<o:p></o:p></span></li>
</ul><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">
</span></p><ul type="disc">
<li class="MsoNormal" style="line-height: normal;"><span style="font-family: verdana; font-size: medium;">Db2 consumes additional resources for every column
that is requested to be returned. If the program does not need the data,
it should not ask for it. Even if the program needs every column, it is
better to explicitly ask for each column by name in the SQL statement for
clarity and to avoid the previous pitfall.<o:p></o:p></span></li>
</ul><p class="MsoNormal" style="text-align: left;"></p><p style="text-align: left;"></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">Secondly, do not ask for what you already know. This may sound simplistic, but most programmers violate this rule at one time or another. For example,consider what is wrong with this simple query:</span></p><p class="MsoNormal" style="text-align: left;"><span><span><span style="font-family: courier;"> SELECT LASTNAME, FIRST_NAME, JOB_CODE, DEPTNO</span><br /></span></span></p><p class="MsoNormal" style="text-align: left;"><span><span><span style="font-family: courier;"> FROM EMP</span></span></span></p><p class="MsoNormal" style="text-align: left;"><span><span><span style="font-family: courier;"> WHERE JOB_CODE = 'A'</span></span></span></p><p class="MsoNormal" style="text-align: left;"><span><span><span style="font-family: courier;"> AND DEPTNO = 'D01';</span></span></span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">Look at the SELECT-list. There are four columns specified but only two of them are needed. We know that JOB_CODE will always be A and DEPTNO will always be D01 because we told Db2 to only return those rows using the WHERE clauses. So do not ask Db2 to return that data... you already know it!</span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">Every column that Db2 must and return to the program adds overhead. It may be a small amount of overhead, but if this statement runs many times during the day (hundreds, or even thousands, of times), that small overhead adds up to significant overhead. </span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">And thirdly, use the WHERE clause to filter data in the SQL instead of bringing it all into your program to filter. This too is a common rookie mistake. It is much better for Db2 to filter the data before returning it to your program. This is so because Db2 requires additional I/O and CPU resources to obtain each row of data. The fewer rows passed to your program, the more efficient your SQL will be.</span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><b>Query Hints and Tweaking</b></span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><span>The use of </span><i>query hints</i><span> is another approach to query
optimization. Hints provide directives to the optimizer on how to execute a
specific query, influencing the choice of access paths, join strategies, or
join orders. By carefully selecting and applying query hints, you can guide the optimizer's decisions and ensure optimal query
execution plans. There are three types of hints:</span></span></p><p></p><span style="font-size: medium;"><ol style="text-align: left;"><li><span style="font-family: verdana;"><span style="font-size: medium;">One type of hint is to modify the query in some way to encourage (or force) the optimizer to choose a different access path. This is often called <a href="https://db2portal.blogspot.com/2015/07/influencing-db2-optimizer-part-3.html" target="_blank">tweaking the SQL</a>. For example, you might choose to a</span><span style="font-size: medium;"><span>ppend </span><span class="CD1" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span>OR 0 = 1</span></span></span><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444;"> to a </span><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444;">predicate to cause Db2 to avoid using an index</span><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444;">.<br /><br /></span></span></span></li><li><span style="font-family: verdana;">A second type of hint is to give the optimizer quidance as to the number of rows that will be returned using <a href="https://db2portal.blogspot.com/2015/07/influencing-db2-optimizer-part-4.html" target="_blank">OPTIMIZE FOR n ROWS</a>. In that case, instead of using the database statistics it will use the guidance you provide.<br /><br /></span></li><li><span style="font-family: verdana; font-size: medium;"><span><span style="font-family: verdana; font-size: medium;">Another type of hint, which is much better, is to <a href="https://db2portal.blogspot.com/2015/08/influencing-db2-optimizer-part-6-using.html" target="_blank">explicitly use the hint capabilities of Db2 to force a particular query to use a specific, pre-determined access path</a>.</span></span></span></li></ol></span><p class="MsoNormal" style="text-align: left;"></p><p style="text-align: left;"></p><p class="MsoNormal" style="text-align: left;"><span style="font-size: medium;"><span style="font-family: verdana;">In any case, </span><span style="font-family: verdana;">it is important to use hints judiciously, as
excessive or unnecessary hints may hinder the optimizer's ability to adapt to
changing data or system conditions.</span></span></p><p class="MsoNormal" style="text-align: left;"><b><span style="font-family: verdana; font-size: medium;">Additional Techniques and Tools</span></b></p>
<p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;">As part of ensuring an optimal SQL environment it is important that DBAs first <i>setup an effective environment</i> that is properly implemented and administered. This includes <a href="https://db2portal.blogspot.com/2015/07/influencing-db2-optimizer-part-2.html" target="_blank">establishing standard methods</a> for appropriate indexing, regular statistics collection, and setting database configuration parameters approrpriately to optimize query performance. </span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><span>Perhaps the most important thing you can do to assure optimal performance of
your database applications is to <a href="https://db2portal.blogspot.com/2021/12/top-10-steps-to-building-right-indexes.html" target="_blank">create the correct indexes</a> for your tables. </span><span>Indexing appropriately on frequently queried columns can significantly improve query execution times. </span><a href="https://db2portal.blogspot.com/2015/08/influencing-db2-optimizer-part-5.html" target="_blank">Regularly collecting and updating statistics</a><span> </span><span>ensures that the optimizer has accurate information to make informed decisions. Optimizing database configuration parameters, such as query parallelism or memory settings, can also have a significant impact on workload management and query performance.</span></span></p><p class="MsoNormal" style="line-height: normal; margin-bottom: 0in;"><span style="font-family: verdana; font-size: medium;"><span style="background: white;">Managing the
performance of your database applications requires in-depth monitoring. Be sure
to allocate an appropriate budget to acquire <i>performance management tools</i> to
ensure the efficiency of your database systems.</span><o:p></o:p></span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><i>Query optimization tools</i><span> are valuable assets for managing workloads and improving query performance. These tools provide insights into query execution plans, access paths, and performance statistics. They allow database administrators to analyze query performance, identify potential bottlenecks, and make informed decisions for optimization. </span></span></p>
<p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><span>Moreover, <i>workload management techniques</i> such as query
prioritization, resource allocation, and concurrency control contribute to
efficient query execution. Prioritizing critical queries, allocating resources
based on workload importance, and managing concurrency effectively help ensure
that high-priority queries receive the necessary resources and are processed
efficiently.</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align: left;"><o:p><span style="font-family: verdana; font-size: medium;"><b>Summing Things Up</b></span></o:p></p>
<p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana;"><span style="font-size: medium;">In conclusion, managing workloads and optimizing queries are
crucial aspects of maximizing the performance of your Db2 database and applications. Techniques
such as applying fundamentail query development methods, query rewriting, the use of hints, and leveraging query optimization
tools can significantly enhance query performance. Additionally, employing
indexing strategies, collecting accurate statistics, and configuring database
parameters contribute to efficient workload management. By implementing these
techniques, DBAs, develoeprs, and performance analysts can streamline query execution, improve
system responsiveness, and achieve optimal performance in their Db2
environments.</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align: left;"><br /></p>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com2tag:blogger.com,1999:blog-18371456.post-40135743058113828452023-07-17T13:49:00.003-05:002023-07-17T13:50:17.143-05:00Top 10 Db2 Performance Tips - No. 4 Effective Memory Configuration<p style="text-align: left;"><span style="font-family: verdana; font-size: medium;">The memory configuration of an IBM Db2 environment plays a
critical role in determining the performance of applications accessing data, as well as the overall efficiency of the subsystem and DBMS. By
properly allocating and managing memory resources, DBAs and systems programmers can
significantly enhance the system's responsiveness and query execution speed.</span></p><p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-align: left;"><span style="font-size: medium;"><span style="font-family: verdana;">One of the primary areas of memory configuration is the
allocation of <b>buffer pools</b>, as well as other pools of memory. </span><span style="background-color: white; color: #333333; font-family: verdana;">Db2 for z/OS uses memory for buffer pools, the EDM pool, RID pool and sort pools to cache data and structures in memory. The better memory is allocated to these structures, the better Db2 and applications that access it will perform. </span></span></p><div><span style="font-family: verdana; font-size: medium;">Buffer pools act as a cache for frequently accessed
data pages, reducing disk I/O and improving query performance. Allocating an
appropriate amount of memory to buffer pools is crucial to ensure that
frequently accessed data remains in memory, readily available for query
processing. By monitoring workload patterns and adjusting the buffer pool sizes
accordingly, database administrators can optimize memory utilization and
minimize disk I/O.</span></div>
<p class="MsoNormal" style="text-align: left;"><span style="background-color: white; color: #333333; font-family: verdana; font-size: medium;">When allocating Db2 buffer pools, keep these rules of thumb in mind:</span></p><ul style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; margin-bottom: 0in;" type="disc"><li class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333; margin: 0in 0in 0.0001pt;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;"><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;">Don't allocate everything to a single buffer pool (e.g., BP0); use a multiple buffer pool strategy.</span></span></li><li class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333; margin: 0in 0in 0.0001pt;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;"><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;">Explicitly specify a buffer pool for every table space and index. Don't simply let Db2 choose a default buffer pool by failing to specify one.</span></span></li><li class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333; margin: 0in 0in 0.0001pt;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;"><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;">Isolate the Db2 Catalog in BP0 (and BP8K0 and BP16K0 ); put user and application Db2 objects into other buffer pools.</span></span></li><li class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333; margin: 0in 0in 0.0001pt;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;"><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;">Consider separating indexes from table spaces with each in their own dedicated buffer pools.</span></span></li><li class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333; margin: 0in 0in 0.0001pt;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;"><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;">Consider isolating heavily hit data into its own buffer pool to better control performance.</span></span></li><li class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333; margin: 0in 0in 0.0001pt;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;"><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;">Consider isolating sorts into a single buffer pool and tuning it for mostly sequential access (e.g. BP7).</span></span></li><li class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333; margin: 0in 0in 0.0001pt;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;"><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;">Consider separating Db2 objects into separate buffer pools that have been configured for sequential verses random access.</span></span></li></ul><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;"><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;">Forget about trying to follow a cookie-cutter approach to buffer pool management. Every shop must create and optimize a buffer pool strategy for its own data and application mix. DB2 offers several buffer pool tuning "knobs" that can be used to configure virtual buffer pools to the type of processing they support. The following parameters all can be changed using the ALTER BUFFERPOOL command:</span></span></p><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;"><strong style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;">DWQT</span></span></strong><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"> – this value is the deferred write threshold; it is expressed as a percentage of the virtual buffer pool that might be occupied by unavailable pages. When this threshold is reached Db2 will start to schedule write I/Os to externalize data. The default is 30%, which is likely to be too high for most shops.</span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;"><strong style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;">VDWQT</span></span></strong><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"> – this value is the vertical deferred write threshold; it is basically the same as DWQT, but for individual data sets. The default is 10%, which once again is quite likely to be too high for many shops.</span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;"><strong style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;">VPSEQT</span></span></strong><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"> – this value is the sequential steal threshold; it is a expressed as a percentage of the virtual buffer pool that can be occupied by sequentially accessed pages. Tune buffer pools for sequential access (such as scans and sorting) by modifying VPSEQT to a larger value. The default is 80%.</span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;"><strong style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;">VPPSEQT</span></span></strong><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"> – this value is the sequential steal threshold for parallel operations; the default value is 50% of VPSEQT.</span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;"><strong style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;">VPXPSEQT</span></span></strong><span lang="EN" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"> – this value is assisting parallel sequential threshold; it is basically the VPPSEQT for operations from another Db2 subsystem in the data sharing group.</span></span></span></p></blockquote><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; text-align: left;"><span style="font-size: medium;"><span style="color: #333333; font-family: verdana;">You can tune </span><span style="color: #333333; font-family: verdana;">these parameters, as well as the size of the buffer pools,</span><span style="color: #333333; font-family: verdana;"> to accommodate the usage patterns of your Db2 applications. </span></span></p><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background: 0px 0px rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #373737; margin: 0px; outline: 0px; padding: 0px 0px 1em; text-size-adjust: 100%; vertical-align: baseline;"><span style="font-size: medium;"><span style="font-family: verdana;">Consider modifying the deferred write threshold parameters to enable trickle write; that means lower values that will cause changed data to be written to disk more frequently, instead of waiting for a system checkpoint to occur. </span></span></p><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background: 0px 0px rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #373737; margin: 0px; outline: 0px; padding: 0px 0px 1em; text-size-adjust: 100%; vertical-align: baseline;"><span style="font-size: medium;"><span style="font-family: verdana;">Furthermore, think about modifying the sequential steal thresholds for the type of data being buffered; if that data is mostly sequentially accessed, then increase these thresholds… if the data is mostly randomly accessed, then decrease these thresholds. Of course, these are basic, high-level guidelines that you will need to study before adjusting them at your shop.</span></span></p><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background: 0px 0px rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #373737; margin: 0px; outline: 0px; padding: 0px 0px 1em; text-size-adjust: 100%; vertical-align: baseline;"><span style="font-family: verdana; font-size: medium;">The PGSTEAL parameter also can be adjusted to modify the manner in which the buffer pool steals pages when new data arrives and there is no space for it. There are three options: </span></p><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background: 0px 0px rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #373737; margin: 0px; outline: 0px; padding: 0px 0px 1em; text-size-adjust: 100%; vertical-align: baseline;"></p><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;">LRU, </span></li><li><span style="font-family: verdana; font-size: medium;">FIFO, and </span></li><li><span style="font-family: verdana; font-size: medium;">NONE. </span></li></ul><p></p><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background: 0px 0px rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #373737; margin: 0px; outline: 0px; padding: 0px 0px 1em; text-size-adjust: 100%; vertical-align: baseline;"><span style="font-family: verdana; font-size: medium;">The typical option is LRU, or least recently used. This will cause the oldest pages (in terms of when they were last accessed) to be stolen before newer pages. An alternate approach is FIFO, or first in/first out. With this approach there is no need for Db2 to monitor when the data was last accessed to determine which the least-recently pages. FIFO can reduce CPU usage (no LRU algorithm needed) and works well if the data is read once and never accessed again. The final option, NONE, is a special case to be used when a buffer pool is large enough to hold all of the data assigned to it so no page stealing is needed. When NONE is specified, Db2 will pre-load the buffer pool when the objects are opened, basically creating an in-memory area for the data. </span></p><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background: 0px 0px rgb(255, 255, 255); border: 0px; box-sizing: border-box; color: #373737; margin: 0px; outline: 0px; padding: 0px 0px 1em; text-size-adjust: 100%; vertical-align: baseline;"><span style="font-family: verdana; font-size: medium;">You can also use the PGFIX parameter to fix buffer pool pages in real storage. Doing so avoids the processing time that DB2 needs to fix and free pages for every I/O operation. This can reduce CPU for bufferpools involved in very intensive I/O applications.</span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; text-align: left;"><span style="color: #333333; font-family: verdana; font-size: medium;"><b>Other Memory Considerations</b></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; text-align: left;"><span style="font-family: verdana; font-size: medium;"><span style="color: #333333;">In addition to buffer pools, Db2 uses memory for other purposes. The first we will examine is the </span><b style="color: #333333;">EDM pool</b><span style="color: #333333;">. EDM stands for Environmental Descriptor Manager. The EDM pool is used for caching internal structures used by Db2 programs. This includes DBDs, SKCTs, CTs, SKPTs, and PTs. It also includes the authorization cache for plans and packages, as well as the cache for dynamic SQL mini-plans.</span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; text-align: left;"><span style="font-size: medium;"><span style="color: #333333; font-family: verdana;">Although it is common to refer to the EDM pool in the singular, </span><span style="color: #333333; font-family: verdana;">Db2 actually breaks the EDM pool into separate pools for DBDs, for the dynamic statement cache, and for the program elements (CTs, SKCTs, PTs, SKPTs). Tuning the size of these structures to facilitate the processing requirements of your applications is crucial to ensuring optimal performance.</span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; text-align: left;"><span style="color: #333333; font-family: verdana; font-size: medium;">As a general rule of thumb, shoot for an 80 percent hit rate with the EDM pools; this means that only one out every five times should a structure need to be loaded from disk into the EDM pool.</span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; text-align: left;"><span style="font-size: medium;"><span style="color: #333333; font-family: verdana;">Db2 also uses a pool to help with specific types of access paths called the <b>RID pool</b>. </span><span style="font-family: verdana;">The RID pool is used by Db2 to store RIDs (record identifiers) for List Prefetch, Multiple Index Access, and Hybrid Join access paths.</span><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana;"> </span><span style="font-family: verdana;">RID pool failures can cause performance degradation as alternate access paths are invoked, such as scans, and the CPU invested up to the point of the failure is wasted. Not to mention that the scan usually will not perform as well as an indexed access!</span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; text-align: left;"><span style="font-size: medium;"><span style="background-color: transparent; font-family: verdana;">Another aspect of memory configuration is sort memory. <b>Sort operations</b> are commonly performed during query execution, such as order by, group by, or distinct operations. Allocating sufficient memory for sort o</span><span style="font-family: verdana;"><span style="background-color: transparent;">perations reduces the need for temporary disk storage, which can significantly impact query performance. It is important to allocate an appropriate amount of memory for sort operations based on the workload requirements, ensuring efficient sorting and minimizing disk I/O. Failure to provide sufficient memory for sorts can cause </span>performance degradations can impact elapsed times dramatically and sort failures can terminate a statement.</span></span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">In addition to specific memory allocations, it is important to consider the overall memory availability and system-wide settings. Ensuring that Db2 has access to an adequate amount of system memory prevents excessive swapping or paging, which can severely degrade performance. Adjusting system-wide memory parameters, such as the maximum memory target, can help fine-tune the overall memory allocation for Db2.<o:p></o:p></span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Regular monitoring of memory usage and performance metrics is crucial for effective memory configuration. By analyzing memory-related statistics and performance indicators, DBAs and performance analysts can identify potential bottlenecks or areas where memory resources may be over or underutilized. Proactive monitoring allows for timely adjustments to memory configuration to optimize performance.<o:p></o:p></span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><b>Summing It Up</b></span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">By allocating memory resources efficiently, including buffer pools, EDM pools, sort memory, and so on, you can minimize disk I/O, reduce contention, and enhance query execution speed. Regular monitoring and tuning of memory settings based on workload patterns and system-wide considerations contribute to a well-optimized Db2 environment with improved responsiveness and overall performance.</span></p><p class="MsoNormal"><span style="background-color: white; color: #333333; font-family: verdana; font-size: medium;">Finally, remember that tuning the memory structures of Db2 is in-depth subject that cannot be adequately covered in-depth in a blog post such as this. So, study those IBM Db2 manuals - and learn by doing. </span></p>
<p class="MsoNormal" style="text-align: left;"><o:p><span style="font-family: verdana; font-size: medium;"> </span></o:p></p>
<p class="MsoNormal" style="text-align: left;"><span style="font-family: verdana; font-size: medium;"><br /></span></p>
<br />Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com3tag:blogger.com,1999:blog-18371456.post-13885094590875041482023-07-13T09:42:00.004-05:002023-07-13T09:42:53.342-05:00Top 10 Db2 Performance Tips - No. 3 Efficient Indexing Strategies<p><span style="font-family: verdana; font-size: medium;">Indexes play a crucial role in improving query performance when accessing data in a Db2 database. By creating indexes on specific columns, the Db2 optimizer can more quickly locate the desired data, reducing the need for full
table scans and enabling faster query execution. Understanding and implementing
efficient indexing strategies can greatly enhance the overall performance of a
database and the applications that access it.</span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">One of the first things you need to do is to understand the type of indexes used by Db2, which are <a href="https://builtin.com/data-science/b-tree-index" target="_blank">B-tree indexes</a>. B-tree indexes are
commonly used and efficient for many situations. The general idea behind <span style="background-color: #f9faff; color: #3a3b41;">B-tree indexing is to improve the process of accessing data by making it easier to search through data faster. A B-tree stores data such that each node contains keys in ascending order. Each of these keys has two references to another two child nodes. The left side child node keys are less than the current keys, and the right side child node keys are more than the current keys. </span></span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">The first important factor in efficient indexing is carefully
selecting the columns to be indexed. Not all columns require an index, and
indexing too many columns can lead to unnecessary overhead. It is essential to
identify the columns frequently used in WHERE clauses, JOIN conditions, or
ORDER BY and create indexes on those columns. This targeted approach ensures
that the indexes are focused on the most critical areas and deliver optimal
query performance.</span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Regular index maintenance is vital for sustaining
performance gains. Over time, indexes can become fragmented or outdated due to
data modifications. Fragmented indexes can hinder query performance, so it is
important to periodically monitor and address index fragmentation. DB2 provides
utilities to reorganize or rebuild indexes, reducing fragmentation and
improving query response times.</span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Considerations for index fragmentation include setting
appropriate free space, which is the
percentage of space used on each index page when data is loaded. It is important to strike a balance between
minimizing space consumption and reducing index maintenance. </span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Furthermore, it is crucial to monitor the impact of index
usage on overall system performance. Query plans and performance monitoring
tools provide insights into index usage and can identify situations where
indexes are not effectively utilized. Identifying unused or underutilized
indexes allows for their removal or modification, reducing storage overhead and
improving overall database performance.</span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">The following list of 10 steps can be used to ensure that you are using an effective indexing strategy for your Db2 databases and applications:</span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;"><b style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1pt none windowtext; color: #333333; padding: 0in;">1. Index by workload, not by object</span></b><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0.25in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;">Many people make the mistake of just guessing at some indexes to create when they are creating other database objects (like tables and table spaces). But without an idea of how the tables are going to be accessed these guesses are usually wrong – at least some of them.<o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0.25in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;">Indexes should be built to optimize the access of your SQL queries. To properly create an optimal set of indexes requires a list of the SQL to be used, an estimate of the frequency that each SQL statement will be executed, and the importance of each query. Only then can the delicate balancing act of creating the right indexes to optimize the right queries most of the time be made.<o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0.25in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;">If you are doing it any other way, you are doing it wrong.<o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;"><b style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1pt none windowtext; color: #333333; padding: 0in;">2. Build indexes based on predicates</span></b><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;"><b style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1pt none windowtext; color: #333333; padding: 0in;">3. Index most-heavily used queries</span></b><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0.25in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;">Numbers 2 and 3 can be thought of as corollaries to Number 1… that is, these are the aspects of application workload that need to be examined to produce appropriate and effective indexes. <o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0.25in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;">Look at the predicates of the queries in the workload and work to create a set of indexes that match up to most (if not all) of them. When it is not practical to build all of the indexes you have identified, then it makes sense to look at the queries that will be used most often and optimize them first.</span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;"><b style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1pt none windowtext; color: #333333; padding: 0in;">4. Index "important" queries</span></b><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0.25in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;">The more important the query, the more you might want to tune by index creation. If you are coding a query that the CIO will run every day, you want to make sure it delivers optimal performance. So building indexes for that particular query is important. On the other hand, a query for a clerk might not necessarily be weighted as high, so that query might have to make do with the indexes that already exist. </span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0.25in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;">Of course, the decision should depend on the application’s importance to the business - not just on the user’s importance. For example, if that clerk runs a query hundreds of times a day that impacts revenue, but the CIO runs his query infrequently, then perhaps the clerk's query is more important.<o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;"><b style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1pt none windowtext; color: #333333; padding: 0in;">5. Index to avoid sorting (GROUP BY, ORDER BY)</span></b><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0.25in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;">In addition to building indexes to optimize data access, indexes can be used to avoid sorting. The GROUP BY and ORDER BY clauses tend to invoke sorts, which can cause performance slowdowns. By indexing on the columns specified in these clauses, the optimizer can use an index to avoid a sort, and thereby potentially improve performance.<o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;"><b style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1pt none windowtext; color: #333333; padding: 0in;">6. Create indexes for uniqueness (PK, U)</span></b><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0.25in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;">Some indexes are required to make the database schema valid. For example, Db2 requires that unique indexes be created when unique and primary key constraints exist. These indexes are not optional.<o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;"><b style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1pt none windowtext; color: #333333; padding: 0in;">7. Create indexes for foreign keys</span></b><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0.25in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;">Even if not required, creating indexes for each foreign key can optimize the performance when accessing and enforcing referential constraints (RI – referential integrity).<o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;"><b style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1pt none windowtext; color: #333333; padding: 0in;">8. Consider adding columns for index-only access</span></b><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0.25in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;">Sometimes it can be advantageous to include additional columns in an index to increase the chances of index-only access. With index-only access, all of the data needed to satisfy the query can be found in the index alone — without having to read data from the tablespace.<o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0.25in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;">For example, suppose that there is an index on the DEPTNO column of the DEPT table. The following query may use this index:<o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; border-collapse: collapse; border: none; color: #444444;"><tbody style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><tr style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><td style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: none; padding: 4.5pt 0.25in;" valign="bottom"><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background: rgb(247, 247, 247); line-height: 15.75pt; margin-bottom: 0.25in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: courier; font-size: medium;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #222222;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"> </span></span><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #222222;"> SELECT DEPTNAME<br style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;" /></span><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #222222;"> FROM DEPT<br style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;" /></span><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #222222;"> WHERE DEPTNO > 'D00';</span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background: rgb(247, 247, 247); line-height: 15.75pt; margin-bottom: 0.25in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #222222;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: courier; font-size: medium;"><o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p></td></tr></tbody></table><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #333333;">The index could be used to access only those columns with a DEPTNO greater than D00, but then Db2 would need to access the data in the table space to return the DEPTNAME. If you added DEPTNAME to the index, that is, create the index on (DEPTNO, DEPTNAME) then all of the data needed for this query exists in the index and additional I/O to the table space would not be needed. This technique is sometimes referred to as </span><i style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #333333;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1pt none windowtext; padding: 0in;">index overloading</span></i><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #333333;">.</span><span style="background-color: white; color: #444444;"></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="font-family: verdana; font-size: medium;">Of course, this is not <i>always </i>a good idea. You have to take into account whether other queries use the index and how it might negatively impact their performance.</span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="font-family: verdana; font-size: medium;">It is also worth mentioning index include columns, which allows you to define additional (included) columns that are not part of the actual key but are available in the index. So we can create an index like this:</span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333; font-family: trebuchet; font-size: small;"><br style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;" /></span></p><pre style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: #fcfcfc; background-repeat: no-repeat; border-left: 9px solid rgb(235, 243, 252); color: #4b4b4b; line-height: normal; margin-bottom: 18px; margin-top: 0px; overflow-wrap: normal; padding: 7px 0px 7px 9px;"><code style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-repeat: no-repeat; line-height: normal; overflow-wrap: normal;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: courier; font-size: medium;"> CREATE INDEX IXNAME
ON DEPT ( DEPTNO )
<b style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-repeat: no-repeat;">INCLUDE ( DEPTNAME )</b></span></span></code></pre><div style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1pt none windowtext; color: #333333; padding: 0in;">The index key is only on the DEPTNO column, but the </span></span><b style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-repeat: no-repeat; color: #4b4b4b;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333; font-weight: 400;">DEPTNAME is also included in the index, so the earlier query can be satisfied using index-only access with this index.</span></b></span></span></div><div style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444;"><b style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-repeat: no-repeat; color: #4b4b4b;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333; font-weight: 400;"><span style="font-family: verdana; font-size: medium;"><br style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;" /></span></span></b></div><div style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444;"><b style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1pt none windowtext; color: #333333; padding: 0in;"><span style="font-family: verdana; font-size: medium;">9. Don’t arbitrarily limit the number of indexes</span></span></b></div><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1pt none windowtext; color: #333333; padding: 0in;">An example of a <i style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;">bad practice </i>would be to place an artificial limit on indexing. <b style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;">There should be no <i style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;">arbitrary limit </i>on the number of indexes that you can create for any database table. </b>Indexes are undoubtedly one of the most important factors in creating efficient queries. Relational optimizers rely on indexes to build fast access paths to data. Without indexes data must be scanned – and that can be a long, inefficient means by which to retrieve your data. When a rule such as this exists, it usually is stated something like this...</span><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;">“Each table can have at most five indexes created for it” — or — “Do not create more than three indexes for any single table in the database.” <b style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><i style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1pt none windowtext; padding: 0in;">These are bad standards. </span></i></b></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="font-family: verdana; font-size: medium;">If you already have three indexes, or five indexes, or even a dozen indexes -- and another index will improve performance -- why would you arbitrarily want to avoid creating that index? Item 10 below discusses one reason, but otherwise, the downside is only that you will need to manage the index.<o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="font-family: verdana; font-size: medium;">Anyway, a good indexing standard, if you choose to have one, should read something like this: “Create indexes as necessary to support your database queries. Limitations on creating new indexes should only be entertained when they begin significantly to impede the efficiency of data modification.” </span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="font-family: verdana; font-size: medium;">Which brings us to…</span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;"><b style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1pt none windowtext; color: #333333; padding: 0in;">10. Be aware of I/U/D implications</span></b><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1pt none windowtext; color: #333333; padding: 0in;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;">Db2 must automatically maintain every index you create. This means every INSERT and every DELETE to an indexed table will insert and delete not just from the table, but also from its indexes.<o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="font-family: verdana; font-size: medium;">Additionally, when you UPDATE the value of a column that has been defined in an index, the DBMS must also update the index. So, indexes speed the process of retrieval but slow down modification.</span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><span style="font-family: verdana; font-size: medium;">So the general rule of thumb should be "Index until it hurts... and then back off the least effective index to make it no longer hurt." Sure, that is easier said than done, but it is a valid philosophy to follow.</span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0in; vertical-align: baseline;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="font-family: verdana; font-size: medium;"><b style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 1pt none windowtext; color: #333333; padding: 0in;">Summary</span></b><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; color: #333333;"><o:p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"></o:p></span></span></span></p><p class="MsoNormal" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; line-height: 18pt; margin-bottom: 0.25in; vertical-align: baseline;"><span style="background-color: transparent;"><span style="font-family: verdana; font-size: medium;">In conclusion, efficient indexing strategies are vital for
enhancing query performance in IBM Db2. By understanding the role of indexes in
query execution and following best practices such as selecting appropriate
index types, carefully choosing indexed columns, addressing index
fragmentation, and monitoring index usage, database administrators can optimize
the database's performance. Effective indexing improves query response times,
reduces resource consumption, and contributes to a DB2
environment with high performance!</span></span></p><p class="MsoNormal"><o:p></o:p></p>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com0tag:blogger.com,1999:blog-18371456.post-65484605138716362172023-07-06T07:00:00.001-05:002023-07-06T07:00:00.145-05:00Top 10 Db2 Performance Tips - No. 2: Optimize Database Design<p><span style="font-family: verdana; font-size: medium;">A well-designed database schema forms the foundation of a
high-performing and efficient IBM Db2 database... and therefore, also serves as the basic starting point for efficient Db2 applications. The importance of optimizing
the database design cannot be overstated, as it directly impacts query
performance, data integrity, and overall system efficiency.</span></p><p><b><span style="font-family: verdana; font-size: medium;">The Logical Data Model</span></b></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">The first step toward a proper database design is the creation of a logical data model. <span style="letter-spacing: -0.2pt;">Before implementing databases
of any sort, it is imperative to first develop a sound model of the data to be used.
Novice database developers frequently begin with the quick-and-dirty approach
to database implementation. They approach database design from a programming
perspective. Because novices often lack experience with databases and data
requirements gathering, they attempt to design databases like the flat files
they are accustomed to using. This is a major mistake. Indeed, most developers
using this approach quickly discover problems after the databases and
applications become operational in a production environment. At a minimum,
performance will suffer and data may not be as readily available as required.
At worst, data integrity problems and/or performance problems</span><span style="letter-spacing: -0.2pt;"> may arise, rendering the entire application
unusable.</span></span></p><p class="MsoNormal"><span style="background-color: white; color: #373737;"><span style="font-family: verdana; font-size: medium;">The goal of a data model is to record the data requirements of a business process. The scope of the data model for each line of business must be comprehensive. A data model serves as lexicon for the data needs of the business... and as a blueprint for the physical implementation of the structures of the database.</span></span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">A key component of building a proper data model is to ensure proper normalization. </span></p><p class="MsoNormal"><b><span style="font-family: verdana; font-size: medium;">Normalization</span></b></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><span style="background-color: white; color: #555555;">Normalization reduces data redundancy and inconsistencies by ensuring that the data </span><span style="background-color: white; color: #555555;">elements are designed appropriately. A series of normalization rules are applied to the entities and data elements, each of which is called a “normal form.” If the data conforms to the first </span><span style="background-color: white; color: #555555;">rule, the data model is said to be in “first normal form,” and so on.</span></span></p><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; border: 0px; box-sizing: border-box; color: #555555; margin: 0px 0px 24px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="font-family: verdana; font-size: medium;">A database design in First Normal Form (1NF) will have no repeating groups and each instance of an entity can be identified by a primary key. For Second Normal Form (2NF), instances of an entity must not depend on anything other than the primary key for that entity. Third Normal Form (3NF) removes data elements that do not depend on the primary key. If the contents of a group of data elements can apply to more than a single entity instance, those data elements belong in a separate entity.</span></p><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; border: 0px; box-sizing: border-box; color: #555555; margin: 0px 0px 24px; outline: 0px; padding: 0px; vertical-align: baseline;"><span style="font-family: verdana; font-size: medium;">This is a quick and dirty introduction to normalization, and there are further levels of normalization not discussed here in order to keep the discussion moving along. For an introductory discussion of normalization visit <a data-feathr-click-track="true" data-feathr-link-aids="["5d2f2cc55666df315532798c"]" href="http://wdvl.com/Authoring/DB/Normalization" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px; box-shadow: none; box-sizing: border-box; color: #1565c0; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; text-decoration-line: none; transition: all 0.2s ease 0s; vertical-align: baseline;">http://wdvl.com/Authoring/DB/Normalization</a>.</span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">The bottom line is that normalization reduces data
redundancy and improves data integrity by organizing data into logical entities
and minimizing data duplication. By carefully analyzing the business
requirements and applying normalization principles, database designers can
create tables that are lean, efficient, and accurately represent the data
model.</span></p><p class="MsoNormal"><b><span style="font-family: verdana; font-size: medium;">Relationships</span></b></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Optimizing relationships between tables is another critical
aspect of database design. Relationships, such as primary key-foreign key
associations, define the logical connections between tables. This too, should be evident in the logical data model, which is frequently depicted as an entity/relationship diagram. </span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Choosing
appropriate indexing strategies, enforcing referential integrity, and carefully
considering the cardinality and selectivity of relationships are crucial steps
to ensure efficient query processing and join operations.</span></p><p class="MsoNormal"><b><span style="font-family: verdana; font-size: medium;">From Logical to Physical</span></b></p><p class="Body" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white;"><span style="font-family: verdana; font-size: medium;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;">Assuming you have a well-designed logical data model, the first step in moving to a physical database design is the process of transforming that logical data model into an actual physical database. </span>The first step is to create an initial physical data model by transforming the logical data model into a physical implementation based on an understanding of the DBMS being used for deployment. To successfully create a physical database design you will need to have a good working knowledge of the features of the DBMS including:</span></p><ul style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white;"><li style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><p class="BL" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; margin-left: 0.5in;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;">In-depth knowledge of the database objects supported by the DBMS and the physical structures and files required to support those objects.</span></p></li><li style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><p class="BL" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; margin-left: 0.5in;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;">Details regarding the manner in which the DBMS supports indexing, referential integrity, constraints, data types, and other features that augment the functionality of database objects.</span></p></li><li style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><p class="BL" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; margin-left: 0.5in;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;">Detailed knowledge of new and obsolete features for particular versions or releases of the DBMS to be used.</span></p></li><li style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><p class="BL" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; margin-left: 0.5in;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;">Knowledge of the DBMS configuration parameters that are in place.</span></p></li><li style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><p class="BX" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; margin-left: 0.5in;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;">Data definition language (DDL) skills to translate the physical design into actual database objects.</span></p></li></ul><p class="Body" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;">Armed with the correct information, you can create an effective and efficient database from a logical data model. The first step in transforming a logical data model into a physical model is to perform a simple translation from logical terms to physical objects. Of course, this simple transformation will not result in a complete and correct physical database design – it is simply the first step. The transformation consists of the following:</span></p><ul style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white;"><li style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><p class="BL" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; margin-left: 0.5in;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;">Transforming entities into tables</span></p></li><li style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><p class="BL" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; margin-left: 0.5in;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;">Transforming attributes into columns</span></p></li><li style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0;"><p class="BL" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; margin-left: 0.5in;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;">Transforming domains into data types and constraints</span></p></li></ul><p class="Body" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;"><b>Data Types</b></span></p><p class="Body" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;">To support the mapping of attributes to table columns you will need to map each logical domain of the attribute to a physical data type and perhaps additional constraints. In a physical database, each column must be assigned a data type. </span></p><p class="Body" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white;"><span style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-family: verdana; font-size: medium;">Selecting appropriate data types is vital for optimizing database design. Choosing the right data types can have a significant impact on storage requirements, query performance, and overall system efficiency. By selecting data types that accurately represent the data and minimize storage overhead, such as using integer types instead of character types for numeric values, assuring that date and time data use appropriate data/time data types, and choosing wisely between the various text and character data types for each column helps to improve data integrity, optimize storage utilization, and improve query execution speed.</span></p><p class="Body" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white;"><span style="font-family: verdana; font-size: medium;"><b>Constraints</b></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Furthermore, you will need to implement appropriate constraints,
such as primary keys, unique constraints, and foreign keys. This enhances data
integrity and query performance. Furthermore, additional constraints such as check constraints and nullability enable the DBMS to better enforce data integrity, instead of leaving it to application code written at a later time. Constraints enforce data consistency rules,
ensure referential integrity, and provide the optimizer with valuable
information for query optimization.</span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><b>An Iterative Process</b></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">It is worth mentioning that database design optimization is
an iterative process that should consider not only the current requirements but
also the future growth and scalability of the system. Regularly reviewing and
revisiting the database design as the application evolves can help identify
areas for improvement and ensure that the database remains optimized over time.</span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><b>Finally...</b></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">In conclusion, a well-designed database schema is
fundamental to achieving optimal performance for your database applications. By focusing on
strategies such as normalization, relationship optimization, appropriate data
types, and constraints, database designers can create a robust and efficient
database environment. Optimizing the database design not only enhances query
performance and data integrity but also lays the groundwork for scalability and
adaptability as the system evolves.</span><o:p></o:p></p>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com0tag:blogger.com,1999:blog-18371456.post-66110294123125248912023-06-26T11:27:00.001-05:002023-06-26T11:27:23.039-05:00Top 10 Db2 Performance Tips - No. 1: Analyze Query Execution Plans<p><span style="font-family: verdana; font-size: medium;">Query execution plans play a crucial role in identifying
performance bottlenecks within an IBM Db2 database. When a query is executed,
the database optimizer determines the most efficient way to retrieve the
requested data by generating a query execution plan. It does this by parsing SQL </span><span style="background-color: white; color: #666666;"><span style="font-family: verdana; font-size: medium;">requests and turning them into actionable commands for accessing and modifying data. </span></span></p><p><span style="font-family: verdana; font-size: medium;">So the query execution plan outlines the
steps and operations involved in executing the query, including accessing
tables, applying filters, joining data, and performing sorting or aggregations.</span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Understanding query execution plans is important because they reveal the inner workings of how Db2 will process the query. And they also highlight areas
where performance can be improved if you understand the various ways that data can be processed by Db2. By analyzing query execution plans, you can identify potential inefficiencies and take
proactive steps to optimize queries for better performance.</span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">For example, one high-level performance tuning step that you can identify using a query execution plan is to find table (space) scans that would be better off using an index instead.</span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><b>Plan Tables</b></span></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">But how can you review and analyze query execution plans? Perhaps the first method used by most folks is to examine the Plan Tables. A lot of information is contained in the PLAN_TABLE. The PLAN_TABLE is simply a specific table used by the EXPLAIN command to populate information about the choices made by the Db2 Optimizer when it formulates a query execution plan. The information in the PLAN_TABLE provides detailed information about the access paths chosen, join strategies employed, and other relevant details that impact query performance. </span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">As long as EXPLAIN YES is specified when you bind your program, or you explicitly issue an EXPLAIN PLAN statement, information about the query execution plan will be placed in the PLAN_TABLE.</span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">So, after the optimizer creates the access paths and populates the PLAN_TABLE with data representing those access paths, you will need to examine the results to determine if everything is satisfactory. Many questions can be answered by analyzing the results of EXPLAIN – questions like:</span></p><p class="MsoNormal"></p><ul style="text-align: left;"><li><span style="font-family: verdana; font-size: medium;">if we are joining what type of join is used (NLJ, MS, Hybrid),</span></li><li><span style="font-family: verdana; font-size: medium;">was an index used, and if so how many columns matched,</span></li><li><span style="font-family: verdana; font-size: medium;">are we doing a scan, and if so what type of scan (full or page range)</span></li><li><span style="font-family: verdana; font-size: medium;">is prefetch being used, and if so what type (sequential, list)</span></li><li><span style="font-family: verdana; font-size: medium;">was a hint used</span></li><li><span style="font-family: verdana; font-size: medium;">was parallelism used, and if so what degree and type </span></li><li><span style="font-family: verdana; font-size: medium;">was a sort required, and if so why (Join, Unique, Group By, Order By)</span></li><li><span style="font-family: verdana; font-size: medium;">what type of locking is required</span></li></ul><p></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">And that just covers the main PLAN_TABLE. There are actually many other explain tables available that, if created, will be populated by EXPLAIN. But that is beyond the scope of this high-level tip, which is already becoming rather lengthy.</span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;"><b>Other Tools</b></span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">There are also several additional tools and techniques that can be used to analyze Db2 query execution plans. One commonly used tool is Visual Explain, which provides a graphical representation of the query execution plan. Many tuners prefer a visual approach to revieing and tuning access paths. Visual Explain allows users to visualize the flow of data, understand the order
in which operations are performed, and identify potential performance
bottlenecks.<o:p></o:p></span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Visual Explain is a feature of the free <a href="https://www.ibm.com/support/pages/download-and-install-ibm-data-studio-41x">IBM Data</a><a href="https://www.ibm.com/support/pages/download-and-install-ibm-data-studio-41x"> Studio</a> tool, as well as the new </span><span style="background-color: white; color: #323232;"><span style="font-family: verdana; font-size: medium;"><a href="https://community.ibm.com/community/user/ibmz-and-linuxone/events/event-description?CalendarEventKey=906a4cde-f55b-40cb-b573-c59e7c7a2e12" target="_blank">Db2 Administration Foundation</a> offering. There are other tools, from other vendors, that also provide a visual Explain capability.</span></span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Speaking of which, another technique to analyze query execution plans is to use database monitoring tools. Such tools capture real-time performance
data, including query execution plans, and provide useful performance metrics that can be reviewed and acted upon as needed. </span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">By monitoring the execution plans of frequently executed queries, it is possible to detect patterns, identify resource-intensive
operations, and make informed decisions about query optimization.</span></p><p class="MsoNormal"><b><span style="font-family: verdana; font-size: medium;">A Bit of Guidance</span></b></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">It is wise to <i>always</i> Bind your production programs (that use static SQL) specifying EXPLAIN YES so that you can see the access paths chosen by Db2. This way, you can either check to make sure that no access paths have changed before proceeding to implement changes in production, or at least you have the information available should problems arise after you move code into production.</span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">It can be difficult to determine if any access paths have changed, because you will need the old execution plans to compare to the new ones. For this reason, it is a good idea to keep several versions of access path information for each program. </span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Additionally, sometimes the program has changed between running EXPLAIN, which can make it challenging to find the exact SQL statements to compare. But you are still better off with older versions than without any historical data.</span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">To optimize query execution plans for better performance, it
is essential to focus on areas such as index usage, join strategies, and
predicate selection. By strategically creating and maintaining appropriate
indexes, rewriting complex queries, and refining predicate conditions, it is
possible to influence the optimizer's decisions and improve query performance.</span></p>
<p class="MsoNormal"><o:p><span style="font-family: verdana; font-size: medium;"><b>In Conclusion</b> </span></o:p></p>
<p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Analyzing query execution plans is a vital
step in optimizing the performance of IBM Db2 applications. By using tools
like EXPLAIN and Visual Explain, PLAN_TABLE data, and monitoring tools, it is possible to gain valuable insights into query execution, identify
potential bottlenecks, and enhance overall
performance. </span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">By proactively analyzing and optimizing query execution plans,
organizations can achieve faster response times, improved scalability, and a
more efficient database environment.<o:p></o:p></span></p><p class="MsoNormal"><span style="font-family: verdana; font-size: medium;">Be sure to check back here next week when we will address database design as a performance issue.</span></p>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com0tag:blogger.com,1999:blog-18371456.post-55859263951309260222023-06-21T12:56:00.007-05:002023-06-29T11:09:47.077-05:00Top 10 Performance Tuning Tips for IBM Db2<p><span style="font-family: verdana; font-size: medium;">Performance is a critical aspect of any database management system, and IBM Db2 is no exception. As organizations deal with ever-increasing data volumes and complex workloads, it is crucial that Db2 environments are fine-tuned to ensure optimal performance, responsiveness, and scalability. In this multi-part blog post, I will examine the top ten performance tuning tips for assuring optimal IBM Db2 applications and systems.</span></p><p><span style="font-size: medium;"><span style="font-family: verdana;">Whether you are an experienced database administrator or just starting your journey with Db2, these performance tuning tips will provide some practical strategies and techniques </span><span style="font-family: verdana;">to enhance the efficiency and speed of your Db2 deployments. This series of posts will </span><span style="font-family: verdana;">cover a range of topics, including query optimization, database design, indexing strategies, memory configuration, I/O optimization, and more. </span></span></p><p><span style="font-family: verdana; font-size: medium;">By following these Db2 performance tips, you can significantly improve query response times, optimize resource utilization, and ensure the smooth operation of your Db2 environment. Whether you are dealing with transactional workloads, analytical queries, or a combination of both, the tips presented here will equip you with the knowledge and techniques to tackle performance bottlenecks and fine-tune Db2 to meet your specific needs.</span></p><p><span style="font-family: verdana; font-size: medium;">Whether you are looking to optimize existing Db2 deployments or planning for a new implementation, this blog post will serve as a valuable resource to guide your performance tuning efforts. So, let's dive into the top ten performance tuning tips for IBM Db2 and discover how you can unlock the full potential of your database system.</span></p><p><span style="font-family: verdana; font-size: medium;">Here's an outline for the upcoming posts in this series on "Top 10 Performance Tuning Tips for IBM Db2":</span></p><p><span style="font-family: verdana; font-size: medium;"> Tip 1: <a href="https://db2portal.blogspot.com/2023/06/top-10-db2-performance-tips-no-1.html" target="_blank">Analyze Query Execution Plans</a></span></p><p><span style="font-family: verdana; font-size: medium;"> Tip 2: Optimize Database Design</span></p><p><span style="font-family: verdana; font-size: medium;"> Tip 3: Efficient Indexing Strategies</span></p><p><span style="font-family: verdana; font-size: medium;"> Tip 4: Effective Memory Configuration</span></p><p><span style="font-family: verdana; font-size: medium;"> Tip 5: Workload Management and Query Optimization</span></p><p><span style="font-family: verdana; font-size: medium;"> Tip 6: Monitoring and Performance Metrics</span></p><p><span style="font-family: verdana; font-size: medium;"> Tip 7: Configuration Parameters and Tuning</span></p><p><span style="font-family: verdana; font-size: medium;"> Tip 8: I/O Optimization</span></p><p><span style="font-family: verdana; font-size: medium;"> Tip 9: Regular Maintenance and Housekeeping</span></p><p><span style="font-family: verdana; font-size: medium;"> Tip 10: Stay Up to Date </span></p><p><span style="font-family: verdana; font-size: medium;">So be sure to keep tuning in to the <a href="https://db2portal.blogspot.com/" target="_blank">Db2 Portal blog</a> as we publish these Top 10 Performance Tips over the course of the next few weeks.</span></p><p><span style="font-family: verdana; font-size: medium;">And be sure to share your own performance and tuning thoughts here... or on any of the subsequent posts in this series.</span></p><p><span style="font-family: verdana; font-size: medium;"><br /></span></p>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com2tag:blogger.com,1999:blog-18371456.post-38475514120315415672023-06-01T10:43:00.001-05:002023-06-22T09:58:27.416-05:00Manage Your Test Data Before It Becomes a Bottleneck<p><span style="font-family: verdana; font-size: medium;">Test data management is an important aspect of application development. <span style="background-color: white; color: #333333; white-space: pre-wrap;">Anybody who has ever been involved in software development knows that creating applications requires test data. Without the data to test your programs against, there is really no way to ensure that the programs are doing what you want them to do. </span></span></p><p><span style="font-family: trebuchet; font-size: medium;"></span></p><div class="separator" style="clear: both; text-align: center;"><span style="font-family: trebuchet; font-size: medium;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm5WNv4J_-Tw8g6irBo6n-RoK04IFvZyhqORh-1pxHiOeo1wYX--nhXicI_hZmWhqG88SAOpI4WccyR7WPY2r-u9gJXUiteU-hD0YZ5pmQ-blnGEFgFZrKysn1l61Ozipj-XuxUHChFhpw9PBhBshLINN-1WPh7cwXKyKQEb_4HWw1fTJsK3U/s6720/programming-background-with-person-working-with-codes-computer.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="4480" data-original-width="6720" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm5WNv4J_-Tw8g6irBo6n-RoK04IFvZyhqORh-1pxHiOeo1wYX--nhXicI_hZmWhqG88SAOpI4WccyR7WPY2r-u9gJXUiteU-hD0YZ5pmQ-blnGEFgFZrKysn1l61Ozipj-XuxUHChFhpw9PBhBshLINN-1WPh7cwXKyKQEb_4HWw1fTJsK3U/s320/programming-background-with-person-working-with-codes-computer.jpg" width="320" /></a></span></div><p></p><div style="text-align: center;"><span style="background-color: white; white-space: pre-wrap;"><span style="color: #333333; font-family: trebuchet; font-size: xx-small;">Image by <a href="https://www.freepik.com/free-photo/programming-background-with-person-working-with-codes-computer_38669443.htm#query=testing&position=4&from_view=keyword&track=sph" target="_blank">Freepik</a></span></span></div><p><span style="background-color: white; color: #333333; white-space: pre-wrap;"><span style="font-family: verdana; font-size: medium;">But test data management can quickly consume a lot of time and effort. Supporting multiple programmers, multiple database environments, and making sure you have sufficient test cases is easier said than done. And we are not just talking about developing new applications, but also modifying existing ones!<br /></span></span></p><p><span style="background-color: white; color: #333333; white-space: pre-wrap;"><span style="font-family: verdana; font-size: medium;">So, what can be done? Well, I'm going to point you to a couple of resources. First, I am delivering a webinar on this topic on June 8, 2023 titled <a href="https://register.gotowebinar.com/register/3343165590400252506?source=CraigMullins" target="_blank">Manage Your Test Data Before it Becomes a Bottleneck</a> -- the same title as this blog post!</span></span></p><p><span style="font-family: verdana; font-size: medium;"><span style="background-color: white; color: #333333; white-space: pre-wrap;"><span>In this webinar, I discuss test data management and the trends impacting application development and testing. Some of the issues I examine include automation, shift-left testing, agile development, and DevOps. And I'll uncover the impact of these trends and how they drive up the speed and complexity of creating and testing applications. I will also define the components and requirements of test data management and examine the pitfalls that can </span></span><span style="background-color: white; color: #333333; white-space: pre-wrap;">lead test data management to become a bottleneck, slowing down your developers. </span></span></p><p><span style="color: #333333; font-size: medium;"><span style="background-color: white; font-family: verdana; white-space: pre-wrap;">Another resource you can take a look at is the article I wrote for ELNION, titled <a href="https://elnion.com/2023/04/07/the-test-data-management-struggles-of-modern-app-development/" target="_blank">The Test Data Management Struggles of Modern App Development</a>. </span></span></p><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; border: 0px; box-sizing: border-box; color: #333333; font-feature-settings: inherit; font-kerning: inherit; font-optical-sizing: inherit; font-stretch: inherit; font-variant-alternates: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; font-variation-settings: inherit; line-height: inherit; margin: 0px 0px 1.25em; padding: 0px; text-rendering: optimizelegibility; vertical-align: baseline;"><span style="font-family: verdana; font-size: medium;">In this article, I explore the issues impacting application developers regarding test data management, and look at how they can overcome these challenges to ensure a successful testing process.</span></p><div><span style="font-family: verdana; font-size: medium;">So if test data management is a challenge for you and your organization, I urge you to take advantage of these resources by <a href="https://register.gotowebinar.com/register/3343165590400252506?source=CraigMullins" target="_blank">registering for and attending the webinar</a>, and also reading <a href="https://elnion.com/2023/04/07/the-test-data-management-struggles-of-modern-app-development/" target="_blank">the article.</a></span></div>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com0tag:blogger.com,1999:blog-18371456.post-69508947730366512952023-05-12T13:12:00.004-05:002023-05-12T15:43:34.511-05:00Will I See You In Philadelphia for IDUG NA 2023?<p><span face="Tahoma, sans-serif" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; font-size: 12pt;"></span></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXw59FamsyKBeIRcgOfscv49gmeqzligoriqxsKhZPHrpgqyRC2K-TT4gE0aqnQXf7Y8hea8bswUf-uIDEQKjI7Sarp37mQFoKYP-j0Ce9xEBW4Qp217w79Gra2rBYW2ued03SXGIkHbDLoYk4GT0okcMdwz9RnmCNHkiMVYFjPRSMoUSZtjU/s1448/IDUG_NA23_logo_NEW.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="364" data-original-width="1448" height="100" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXw59FamsyKBeIRcgOfscv49gmeqzligoriqxsKhZPHrpgqyRC2K-TT4gE0aqnQXf7Y8hea8bswUf-uIDEQKjI7Sarp37mQFoKYP-j0Ce9xEBW4Qp217w79Gra2rBYW2ued03SXGIkHbDLoYk4GT0okcMdwz9RnmCNHkiMVYFjPRSMoUSZtjU/w400-h100/IDUG_NA23_logo_NEW.jpg" width="400" /></a></div><p style="text-align: left;"><span style="font-family: helvetica; font-size: medium;"><br />Mother's Day is right around the corner and if you are a Db2 professional you now that can only mean one thing: the North American IDUG Db2 Tech Conference is nigh! It seems like every year our favorite conference competes with our Mom's for our attention. But this year the folks at IDUG have helped us out by starting the conference on Tuesday instead of the Monday after Mother's Day. So go ahead, take Mom out to dinner and stay out as late as you want. You will still have a day to recover for your trip to Philadelphia.</span></p><p style="text-align: left;"></p><p style="text-align: left;"><span style="font-family: helvetica; font-size: medium;"><span face="Tahoma, sans-serif" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444;">Yes, <a href="https://www.idug.org/2023idugnadb2techconference/home" target="_blank">IDUG is back in Philadelphia this year (2023)</a>. And I am looking forward to an exciting week of learning more about my favorite DBMS and mingling with others who think likewise. There is always </span><span face="Tahoma, sans-serif" style="background-color: white; color: #444444;">a world of phenomenal educational opportunities delivered at IDUG each year by IBMer, vendor experts, users, and consultants from all over the world. There will be numerous informative technical sessions on all the latest and greatest Db2 technologies, features, and related products. </span></span></p><p style="text-align: left;"><span face="Tahoma, sans-serif" style="background-color: white; color: #444444; font-family: helvetica; font-size: medium;">If you’ve ever attended an IDUG conference in the past then you know why I’m excited. If you haven't attended before, I'm sure you'll find a lot to occupy your interest!</span></p><p style="text-align: left;"><span face="Tahoma, sans-serif" style="background-color: white; color: #444444; font-family: helvetica; font-size: medium;">And be sure to seek me out and say hello. I'll be delivering three presentations this year!</span></p><p style="text-align: left;"><span face="Tahoma, sans-serif" style="background-color: white; color: #444444; font-family: helvetica; font-size: medium;">First up, on Tuesday at 2:00 pm I'll be taking a look at the trends impacting data and database systems in my session titled <b>Database Trends 2023: Things Are Changing and You Better Keep Up</b>!</span></p><p style="text-align: left;"><span face="Tahoma, sans-serif" style="background-color: white; color: #444444; font-family: helvetica; font-size: medium;">Then on Wednesday I will be co-presenting a vendor-sponsored presentation for the fine folks at InfoTel on <b>Intelligent Automation of Db2 Administration </b>at 10:15 AM. I will also be spending a bit of time in the InfoTel booth so you can always stop by there to say hello or ask me a question!</span></p><p style="text-align: left;"><span face="Tahoma, sans-serif" style="background-color: white; color: #444444; font-family: helvetica; font-size: medium;">And finally, on Thursday, I will be delivering a session titled <b>Code Your Db2 Applications for Performance From the Start</b>! This one starts at 2:00 PM and is targeted at application developers but it can be useful for DBAs and performance analysts, too! The presentation is based on my latest book, <a href="https://store.bookbaby.com//bookshop/book/index.aspx?bookURL=A-Guide-to-Db2-Performance-for-Application-Developers&b=p_bu-ba-or" target="_blank">A Guide to Db2 Performance for Application Developers</a>.</span></p><p style="text-align: left;"><span face="Tahoma, sans-serif" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; font-size: medium;"><span style="font-family: helvetica;">So I hope to see you in Philadelphia for a great week of education and camaraderie at this year's premier event for Db2 professionals, the <a href="https://www.idug.org/2023idugnadb2techconference/home" target="_blank">IDUG Db2 Tech Conference</a>.</span> </span></p><p><span style="font-size: medium;"><br /></span></p><div class="post-body entry-content" id="post-body-8236218764669365558" itemprop="description articleBody" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 1.4; position: relative; width: 586px;"><div><span face="Tahoma, sans-serif" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; font-size: 12pt;"><br /></span></div><div style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; clear: both; font-size: 13px;"></div></div><div class="post-footer" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgb(59 130 246 / 0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 #0000; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 #0000; --tw-shadow: 0 0 #0000; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; background-color: white; color: #444444; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 1.5em 0px 0px;"></div>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com0tag:blogger.com,1999:blog-18371456.post-75270631066942649342023-03-20T07:00:00.045-05:002023-03-20T07:00:00.214-05:00Harnessing the Power of zIIP Processors for Improved Db2 Performance and Lower Cost<p style="text-align: left;"><span style="font-family: verdana;"><span>As a Db2 DBA, you're constantly looking for ways to improve performance and efficiency while minimizing costs. One technology that can help achieve these goals is the</span><span> </span><a href="https://cloudframe.com/understanding-mainframe-specialty-processors-ziips-and-more/" target="_blank">zIIP </a><span>(IBM System z Integrated Information Processor) processor. By offloading eligible Db2 workloads to zIIP processors, you can free up capacity on general-purpose processors and reduce costs, while improving performance.</span></span></p><div style="text-align: left;"><p><span style="font-family: verdana;"><span>So, what <a href="http://cloudframe.com/types-of-processing-that-can-utilize-ziips-why-you-want-to-use-ziips/" target="_blank">workloads are eligible for offloading to zIIP</a> processors? XML processing, and portions of the Db2 LOAD, REORG, RUNSTATS and REBUILD utilities are among the most common. If you have third-party utilities (BMC, Broadcom, InfoTel) it is likely that they, too, will be zIIP-eligible, at least for some of their functionality.</span></span></p><p><span style="font-family: verdana;"><span>Shifting workload to distributed/DDF is another good way to exploit zIIPs because SQL statements executed through DDF are zIIP-eligible. But most of the time DBAs have little influence on moving workload to distributed processing. This choice is typically driven by application development plans instead of DBA tuning tactics.</span><span face=""Open Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"" style="background-color: white; color: #222222; font-size: 16px;"> </span></span></p><p><span style="font-family: verdana;"><span>Nevertheless, by understanding what type of workload is <a href="https://cloudframe.com/digging-into-the-ziip-what-does-ziip-eligible-mean/" target="_blank">zIIP-eligible</a> and encouraging such usage, you can offload workload to zIIP processors. Moving workload from general-purpose processors to zIIPs can possibly improve system performance and reduce costs.</span></span></p><p><span style="font-family: verdana;"><span>You might also want to take a look at converting some of your COBOL workload to Java, if at all possible because <a href="https://cloudframe.com/java-and-the-ziip-the-5-major-benefits/" target="_blank">Java programs are zIIP-eligible</a>. Of course, this requires application developers to get involved, as well as (possibly) a conversion tool.</span></span></p><p><span style="font-family: verdana;"><span>To fully harness the power of zIIP processors, it's important to identify <a href="http://cloudframe.com/digging-into-the-ziip-what-does-ziip-eligible-mean/" target="_blank">eligible workloads</a> and configure the system accordingly. Here are some tips to help you get started:</span><span><br /></span></span></p><ul><li><span style="font-family: verdana;">Analyze workload usage: Use Db2 performance monitoring tools to identify workloads that are good candidates for offloading to zIIP processors. This can help you prioritize workload optimization efforts and maximize the benefits of zIIP processors. Be careful, as what is zIIP-eligible can change from version to version of Db2. <a href="https://www.ibm.com/docs/en/db2-for-zos/13?topic=db2-authorized-ziip-uses-processing" target="_blank">As of Db2 13 for z/OS, here is the IBM documented list of zIIP-eligible Db2 "stuff."</a></span></li></ul><p></p><div><ul><li><span style="font-family: verdana;">Configure Db2 for zIIP offload: </span><a href="https://www.ibm.com/docs/en/db2-for-zos/12?topic=db2-configuring-ziip-capacity-workloads" style="font-family: verdana;" target="_blank">Configure Db2</a><span style="font-family: verdana;"> to take advantage of zIIP processors by setting the appropriate parameters and options. Consult the IBM Db2 documentation for specific guidance on configuring zIIP offload.<br /><br /></span></li><li><span style="font-family: verdana;">Monitor and analyze performance: Use Db2 performance monitoring tools to track the performance of zIIP offloaded workloads and identify areas for further optimization. This can help you continually improve performance and efficiency over time.</span></li></ul></div><div><span style="font-family: verdana;">By effectively utilizing zIIP processors for Db2 workloads, you can achieve significant cost savings and performance improvements on IBM Z mainframe systems. Don't let this powerful technology go to waste – start exploring the </span><a href="https://www.mullinsconsulting.com/index_htm_files/A%20to%20zIIP%20V07.pdf" style="font-family: verdana;" target="_blank">benefits of zIIP processors</a><span style="font-family: verdana;"> today!</span></div></div><div style="text-align: left;"><br /></div>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com0tag:blogger.com,1999:blog-18371456.post-11648168544912050442023-03-07T06:30:00.012-06:002023-03-07T06:30:00.225-06:00A Db2 for z/OS DBA Poem<p><span style="font-family: verdana; font-size: medium;">I'm a hip-hopping monster of the CRT,</span></p><p><span style="font-family: verdana; font-size: medium;">All the programmers here, they be envying me,</span></p><p><span style="font-family: verdana; font-size: medium;">I'm a DBA, a master of data,</span></p><p><span style="font-family: verdana; font-size: medium;">Work with Db2 and I diss all the haters!</span></p><p><span style="font-family: verdana; font-size: medium;"><br /></span></p><p><span style="font-family: verdana; font-size: medium;">I strive every day to give smooth operation,</span></p><p><span style="font-family: verdana; font-size: medium;">And to keep the data in perfect formation.</span></p><p><span style="font-family: verdana; font-size: medium;">My eyes are trained to spot any trouble,</span></p><p><span style="font-family: verdana; font-size: medium;">To fix it before the data turns to rubble.</span></p><p><span style="font-family: verdana; font-size: medium;"><br /></span></p><p><span style="font-family: verdana; font-size: medium;">My hands deftly skip over the keyboard, </span></p><p><span style="font-family: verdana; font-size: medium;">Tuning and tweaking all the inefficient code.</span></p><p><span style="font-family: verdana; font-size: medium;">I know all the ins and outs of Db2,</span></p><p><span style="font-family: verdana; font-size: medium;">Every command, every option, every ZPARM, I do.</span></p><p><span style="font-family: verdana; font-size: medium;"><br /></span></p><p><span style="font-family: verdana; font-size: medium;">My skills are honed by years of practice,</span></p><p><span style="font-family: verdana; font-size: medium;">Through all the challenges, I've gained my status.</span></p><p><span style="font-family: verdana; font-size: medium;">My expertise and skills are sought by many,</span></p><p><span style="font-family: verdana; font-size: medium;">But few can match all my skills, or any.</span></p><p><span style="font-family: verdana; font-size: medium;"><br /></span></p><p><span style="font-family: verdana; font-size: medium;">I'm a Db2 DBA, indeed I am...</span></p><p><span style="font-family: verdana; font-size: medium;">A guardian of data, and a z/OS fan!</span></p>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com1tag:blogger.com,1999:blog-18371456.post-40383765526244065112023-03-01T07:00:00.006-06:002023-03-01T07:00:00.210-06:00Consider Application-Level Lock Control in Db2 13 for z/OS<p><span style="font-family: verdana;">It has been close to a year since Db2 13 for z/OS has been generally available. It was announced in April 2022 and delivered for GA on May 31, 2022.</span></p><p><span style="font-family: verdana;">As you think about migrating from Db2 12 to Db2 13, it is inevitable that you will consider the new functionality and capabilities that comes with the new version. I've discussed the AI functionality of <a href="https://elnion.com/2022/08/25/ibm-db2-13-for-z-os-sql-data-insights/" target="_blank">SQL Data Insights</a> delivered in Db2 13, but haven't really dug into some of the other interested new features.</span></p><p><span style="font-family: verdana;"><br /></span></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6Byl_E1I_yBtHm6hIRB3bbCZkL-bwRuxVf8tav5c9PyfOZxRM9ue9xyY-sQrk5Iu0d_UfVGsVe77fNDe80igzymV1Dit7ASkgd_hIqxOgGNxcCTyY7VcBD0A4f2wLDMaC6PDRj3Xf1bQAEpD7u_fcvT4eVJskTknzPqe1hqWLvv-YJmfpxUA/s474/3locks.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="316" data-original-width="474" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6Byl_E1I_yBtHm6hIRB3bbCZkL-bwRuxVf8tav5c9PyfOZxRM9ue9xyY-sQrk5Iu0d_UfVGsVe77fNDe80igzymV1Dit7ASkgd_hIqxOgGNxcCTyY7VcBD0A4f2wLDMaC6PDRj3Xf1bQAEpD7u_fcvT4eVJskTknzPqe1hqWLvv-YJmfpxUA/s320/3locks.jpg" width="320" /></a></div><p></p><p><span style="font-family: verdana;">Today, I want to briefly discuss <b><i>application-level lock control</i></b>. This new feature enables applications to </span><span style="font-family: verdana;">take more control over Db2 locking. If you have applications that could benefit from different lock parameters than the system-wide settings used by Db2, then this new capability could be useful for at least some of your applications and tasks.</span></p><p><span style="font-family: verdana;">The first thing to note is that you must be at Function Level 500 before you can use application-level lock control. </span><span style="font-family: verdana;">Using application-level lock control then requires setting a special register using the SET CURRENT LOCK TIMEOUT statement. This statement can be included in application programs to control the lock wait duration in seconds. </span><span style="font-family: verdana;">The data type is INTEGER</span><span style="font-family: verdana;"> with a range of acceptable values from -1 to 32,767. </span><span style="font-family: verdana;">Setting the CURRENT LOCK TIMEOUT to -1 indicates an indefinite wait, setting it to 0 indicates no waiting. </span></p><p><span style="font-family: verdana;">Most DBAs reading that last sentence will shudder at the possible implications of waiting forever! Fortunately, there is another new DSNZPARM called <a href="https://www.ibm.com/docs/en/db2-for-zos/13?topic=dip1-lock-timeout-max-spreg-lock-timeout-max-subsystem-parameter" target="_blank">SPREG_LOCKTIMEOUT_MAX</a> that can limit the upper bound that an application can use for CURRENT LOCK TIMEOUT.</span></p><p><span style="font-family: verdana;">Nevertheless, in order to implement application-level lock control you will need to modify your application code. So, if you want to wait for locks for up to 50 seconds, you would issue</span></p><p><span style="background-color: white; color: #323232; font-family: "courier new", courier;"><span> SET CURRENT LOCK TIMEOUT = 50</span></span></p><p><span style="font-family: verdana;">Before the SQL that should wait for that duration. </span></p><p><span style="font-family: verdana;">Of course, any applications using application-level lock control should be monitored for lock contention. This can be done using Db2 monitoring tools, such as Omegamon or Mainview. <span style="background-color: white; color: #323232;">The trace record IFCID 437 can also be monitored to discover the specific applications and authorization IDs that use this special register.</span></span></p><div><span style="font-family: verdana;"><b>Deadlock Resolution Control</b></span></div><div><span style="font-family: verdana;"><br /></span></div><div><div><span style="font-family: verdana;">Similar to controlling the lock timeout duration, Db2 13 also introduced the ability to manage deadlock resolution control at the application level. This is accomplished using a new system built-in global variable. </span><span style="font-family: verdana;">Instead of just relying on the system setting to control deadlock detection, applications can choose to </span><span style="font-family: verdana;">set the new global variable: <a href="https://www.ibm.com/docs/en/db2-for-zos/13?topic=variables-deadlock-resolution-priority" target="_blank">SYSIBMADM.DEADLOCK_RESOLUTION_PRIORITY</a> </span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">Valid values range from 0 and 255. The higher the value, the less likely that locks requested by the application will deadlock when the application is involved in a deadlock situation. Applications and users require the WRITE privilege on this global variable in order to be able to issue it successfully.</span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">So, if you want to set this to the max, you would issue</span></div><div><span style="font-family: verdana;"><br /></span></div><div><div><span style="font-family: courier;"> SET SYSIBMADM.DEADLOCK_RESOLUTION_PRIORITY = 200</span></div></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">And then issue the statement(s) you are concerned about deadlocking. </span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">Of course, using this global variable does not guarantee that the application won't experience a deadlock because there are other considerations involved that Db2 still must negotiate and consider. </span></div><div><span style="font-family: verdana;"><br /></span></div><div><span style="font-family: verdana;">One final note, you can use <a href="https://www.ibm.com/docs/en/db2-for-zos/13?topic=tables-profile" target="_blank">Profile tables</a> to set CURRENT LOCK TIMEOUT and SYSIBM.DEADLOCK_RESOLUTION_PRIORITY as this support has been added in Db2 13.</span></div></div><div class="w-full border-b border-black/10 dark:border-gray-900/50 text-gray-800 dark:text-gray-100 group bg-gray-50 dark:bg-[#444654]" style="--tw-bg-opacity: 1; --tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-text-opacity: 1; --tw-translate-x: 0; --tw-translate-y: 0; border-color: rgba(32, 33, 35, 0.5); border-image: initial; border-style: solid; border-width: 0px 0px 1px; box-sizing: border-box; color: rgba(236,236,241,var(--tw-text-opacity)); text-align: left; width: 2292px;"><div class="text-base gap-4 md:gap-6 m-auto md:max-w-2xl lg:max-w-2xl xl:max-w-3xl p-4 md:py-6 flex lg:px-0" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: flex; gap: 1.5rem; line-height: 1.5rem; margin: auto; max-width: 48rem; padding: 1.5rem 0px;"><div class="relative flex w-[calc(100%-50px)] flex-col gap-1 md:gap-3 lg:w-[calc(100%-115px)]" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: flex; flex-direction: column; gap: 0.75rem; position: relative; width: calc(100% - 115px);"><div class="flex flex-grow flex-col gap-3" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: flex; flex-direction: column; flex-grow: 1; gap: 0.75rem;"><div class="min-h-[20px] flex flex-col items-start gap-4 whitespace-pre-wrap" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; align-items: flex-start; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: flex; flex-direction: column; gap: 1rem; min-height: 20px; white-space: pre-wrap;"><div class="markdown prose w-full break-words dark:prose-invert light" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-prose-body: var(--tw-prose-invert-body); --tw-prose-bold: var(--tw-prose-invert-bold); --tw-prose-bullets: var(--tw-prose-invert-bullets); --tw-prose-captions: var(--tw-prose-invert-captions); --tw-prose-code: var(--tw-prose-invert-code); --tw-prose-counters: var(--tw-prose-invert-counters); --tw-prose-headings: var(--tw-prose-invert-headings); --tw-prose-hr: var(--tw-prose-invert-hr); --tw-prose-invert-body: #d1d5db; --tw-prose-invert-bold: #fff; --tw-prose-invert-bullets: #4b5563; --tw-prose-invert-captions: #9ca3af; --tw-prose-invert-code: #fff; --tw-prose-invert-counters: #9ca3af; --tw-prose-invert-headings: #fff; --tw-prose-invert-hr: #374151; --tw-prose-invert-lead: #9ca3af; --tw-prose-invert-links: #fff; --tw-prose-invert-pre-bg: rgba(0,0,0,0.5); --tw-prose-invert-pre-code: #d1d5db; --tw-prose-invert-quote-borders: #374151; --tw-prose-invert-quotes: #f3f4f6; --tw-prose-invert-td-borders: #374151; --tw-prose-invert-th-borders: #4b5563; --tw-prose-lead: var(--tw-prose-invert-lead); --tw-prose-links: var(--tw-prose-invert-links); --tw-prose-pre-bg: var(--tw-prose-invert-pre-bg); --tw-prose-pre-code: var(--tw-prose-invert-pre-code); --tw-prose-quote-borders: var(--tw-prose-invert-quote-borders); --tw-prose-quotes: var(--tw-prose-invert-quotes); --tw-prose-td-borders: var(--tw-prose-invert-td-borders); --tw-prose-th-borders: var(--tw-prose-invert-th-borders); --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: var(--tw-prose-body); line-height: 1.75; max-width: none; overflow-wrap: break-word; width: 653px;"><ol style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; counter-reset: item 0; display: flex; flex-direction: column; list-style-image: initial; list-style-position: initial; margin: 1.25em 0px; padding: 0px 0px 0px 1rem; text-align: left;"><li style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px; padding-left: 0.375em;"><p style="background-color: white; border: 0px; box-sizing: border-box; color: #323232; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: initial; margin: 0px 0px 10px; padding: 0px; vertical-align: baseline; white-space: normal;"></p><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px;"><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px;"><br /></blockquote></blockquote><p></p></li></ol></div></div></div></div></div></div><div class="w-full border-b border-black/10 dark:border-gray-900/50 text-gray-800 dark:text-gray-100 group bg-gray-50 dark:bg-[#444654]" style="--tw-bg-opacity: 1; --tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-text-opacity: 1; --tw-translate-x: 0; --tw-translate-y: 0; border-color: rgba(32, 33, 35, 0.5); border-image: initial; border-style: solid; border-width: 0px 0px 1px; box-sizing: border-box; color: rgba(236,236,241,var(--tw-text-opacity)); width: 2292px;"><div class="text-base gap-4 md:gap-6 m-auto md:max-w-2xl lg:max-w-2xl xl:max-w-3xl p-4 md:py-6 flex lg:px-0" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: flex; gap: 1.5rem; line-height: 1.5rem; margin: auto; max-width: 48rem; padding: 1.5rem 0px;"><div class="relative flex w-[calc(100%-50px)] flex-col gap-1 md:gap-3 lg:w-[calc(100%-115px)]" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: flex; flex-direction: column; gap: 0.75rem; position: relative; width: calc(100% - 115px);"><div class="flex justify-between" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; display: flex; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; justify-content: space-between;"><div class="text-gray-400 flex self-end lg:self-center justify-center mt-2 gap-3 md:gap-4 lg:gap-1 lg:absolute lg:top-0 lg:translate-x-full lg:right-0 lg:mt-0 lg:pl-2 visible" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-text-opacity: 1; --tw-translate-x: 100%; --tw-translate-y: 0; align-self: center; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: rgba(172,172,190,var(--tw-text-opacity)); display: flex; gap: 0.25rem; justify-content: center; margin-top: 0px; padding-left: 0.5rem; position: absolute; right: 0px; top: 0px; transform: translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); visibility: visible;"><button class="p-1 rounded-md hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-200 disabled:dark:hover:text-gray-400" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-text-opacity: 1; --tw-translate-x: 0; --tw-translate-y: 0; appearance: button; background-image: none; border-color: rgb(217, 217, 227); border-radius: 0.375rem; border-style: solid; border-width: 0px; cursor: pointer; font-family: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0.25rem;"><svg class="h-4 w-4" fill="none" height="1em" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke="currentColor" viewbox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path></svg></button><button class="p-1 rounded-md hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-200 disabled:dark:hover:text-gray-400" style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-text-opacity: 1; --tw-translate-x: 0; --tw-translate-y: 0; appearance: button; background-image: none; border-color: rgb(217, 217, 227); border-radius: 0.375rem; border-style: solid; border-width: 0px; cursor: pointer; font-family: inherit; font-size: 16px; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0.25rem;"><svg class="h-4 w-4" fill="none" height="1em" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" stroke="currentColor" viewbox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"></path></svg></button></div></div></div></div></div>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com0tag:blogger.com,1999:blog-18371456.post-67544974168292820222023-02-23T08:00:00.001-06:002023-02-23T08:00:00.203-06:00Asking ChatGPT About the Advantages of Db2 for z/OS over Oracle<p><span style="font-family: verdana; font-size: medium;">If you read my blog post from yesterday, you know that I have been playing around with ChatGPT, the latest AI technology that is sweeping the headlines.</span></p><p><span style="font-family: verdana; font-size: medium;">Yesterday I was asking it about the mainframe, but today I thought I'd ask ChatGPT about Db2 and Oracle, specifically:</span></p><p style="text-align: center;"><span style="font-family: verdana; font-size: medium;">In what ways is IBM Db2 for z/OS better than Oracle?</span></p><p><span style="font-family: verdana; font-size: medium;">Yes, I know that is a loaded question and that the results would likely be different if I swapped the order of Db2 for z/OS and Oracle. Nevertheless, I liked the results that ChatGPT generated, so I figured I'd share them with everybody here!</span></p><p><span style="font-family: verdana; font-size: medium;">So here is ChatGPT's reply:</span></p><blockquote><span style="font-family: verdana; font-size: medium;">"Both IBM Db2 for z/OS and Oracle are mature and widely used relational database management systems, and each has its strengths and weaknesses. However, here are some ways that IBM Db2 for z/OS might be considered better than Oracle:</span></blockquote><blockquote><span style="font-family: verdana; font-size: medium;"><blockquote>Transaction Processing: Db2 for z/OS is known for its high performance and ability to handle large transaction processing workloads. It is optimized for OLTP (Online Transaction Processing) applications and can handle high concurrency and high throughput.</blockquote><blockquote>Security: IBM has a long-standing reputation for security, and Db2 for z/OS is no exception. It has a robust set of security features, including encryption, role-based access control, and auditing capabilities that help ensure that sensitive data is protected.</blockquote><blockquote>Cost: Db2 for z/OS can be less expensive to operate than Oracle for some use cases. It is designed to run on IBM mainframes, which are known for their scalability and efficiency, allowing organizations to reduce hardware and software costs. Additionally, because IBM mainframes are known for their reliability, uptime, and availability, they can help reduce costs associated with system downtime or data loss.</blockquote><blockquote>Integration: Db2 for z/OS can integrate with other IBM products and services, such as CICS (Customer Information Control System) and IMS (Information Management System). This can be particularly beneficial for organizations that already have an IBM infrastructure in place.</blockquote><blockquote>Built-in Analytics: Db2 for z/OS includes built-in analytics features, such as IBM Db2 Analytics Accelerator, which can help organizations to run complex analytics queries on large datasets. This can be particularly useful for organizations that need to process large amounts of data quickly and efficiently. </blockquote></span></blockquote><blockquote><span style="font-family: verdana; font-size: medium;"><blockquote>It is worth noting that Oracle also has its own strengths and advantages, such as its support for a wide range of platforms and its focus on database consolidation. Ultimately, the choice between Db2 for z/OS and Oracle will depend on the specific needs and requirements of an organization."</blockquote><div><br /></div></span></blockquote><p><span style="font-family: verdana; font-size: large;">Again, a quite reasonable response! I think the thing that jumped out at me the most here is the "Cost" section. As a grizzeled, old mainframer I am always ready to fight back against unfounded claims that the mainframe option is always the more espensive one. But ChatGPT didn't make that mistake! Maybe because Oracle has a reputation of being expensive, too?</span></p><p><span style="font-family: verdana; font-size: large;">At any rate, I look forward to asking ChatGPT for help in my future endeavors. </span></p><div><br /></div>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com6tag:blogger.com,1999:blog-18371456.post-6323488926912853522023-02-22T13:56:00.005-06:002023-02-22T13:56:49.787-06:00AI and ChatGPT Tell You Why You Should Use a Mainframe<p><span style="font-family: verdana;"><a href="https://openai.com/blog/chatgpt/" target="_blank">ChatGPT </a>has been getting a lot of attention for its ability to formulate reasonable responses to questions and inquiries. There have even been examples of ChatGPT being able to pass college exams and write up readable articles.</span></p><p><span style="background-color: white;"><span style="font-family: verdana;">ChatGPT is a chatbot developed by OpenAI. It was launched in November pf 2022. It is built on top of OpenAI's <a href="https://openai.com/blog/gpt-3-apps/" target="_blank">GPT-3 </a>family of large language models and it has been fine-tuned using both supervised and reinforcement learning techniques. </span></span></p><p><span style="background-color: white;"><span style="font-family: verdana;">So it is a somewhat practical example of AI being applied to a common proglem... communication.</span></span></p><p><span style="background-color: white;"><span style="font-family: verdana;">Being the mainframe zealot that I am, I decided to ask ChatGPT why I should use a mainframe. I wasn't sure what to expect, but I am delighted with the response that I got. </span></span></p><p><span style="background-color: black; color: white; font-family: verdana;">Me: Why should I still use a mainframe?</span></p><p><span style="background-color: black; color: white; font-family: verdana;">ChatGPT: <span style="white-space: pre-wrap;">There are</span><span style="white-space: pre-wrap;"> several reasons why you might still want to use a mainframe for certain applications:</span></span></p><ol style="text-align: left;"><li><span style="background-color: black; white-space: pre-wrap;"><span style="color: white; font-family: verdana;">High Reliability: Mainframes are designed to handle massive workloads and to provide high levels of reliability and availability. They are built with redundant components and features that allow them to recover quickly from failures, making them ideal for mission-critical applications.
</span></span></li><li><span style="background-color: black;"><span style="color: white; font-family: verdana;"><span style="white-space: pre-wrap;">Security: Mainframes are known for their robust security features. They have been used </span><span style="white-space: pre-wrap;">in industries such as finance, healthcare, and government for decades because they offer features such as hardware encryption, advanced access controls, and secure connectivity options.
</span></span></span></li><li><span style="background-color: black; white-space: pre-wrap;"><span style="color: white; font-family: verdana;">Scalability: Mainframes can scale vertically to handle large amounts of data and processing power. They can also scale horizontally by adding more processors or servers to a mainframe cluster, making them a good fit for organizations with rapidly growing or fluctuating workloads.
</span></span></li><li><span style="background-color: black; white-space: pre-wrap;"><span style="color: white; font-family: verdana;">Cost-Effective: While mainframes are expensive to purchase, they can provide a cost-effective solution for certain applications. Mainframes are designed to handle large workloads with high efficiency, and they can consolidate multiple applications onto a single platform, reducing the need for additional hardware and software.
</span></span></li><li><span style="background-color: black; white-space: pre-wrap;"><span style="color: white; font-family: verdana;">Legacy Systems: Many organizations have critical legacy applications that were designed to run on mainframes. Replacing these systems can be expensive and time-consuming, and in some cases, it may not be feasible to migrate these applications to modern platforms.
</span></span></li><li><span style="background-color: black; color: white; font-family: verdana;">Integration with Modern Technologies: Many mainframe systems now offer modern connectivity options, such as APIs and web services, which make it easier to integrate them with newer technologies and applications.</span></li></ol><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 0px; text-align: left; white-space: pre-wrap;"></p><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; margin: 1.25em 0px 0px; white-space: pre-wrap;"><span style="background-color: black; color: white; font-family: verdana;">In summary, while mainframes are no longer the primary platform for many organizations, they still offer unique benefits and advantages for certain applications. Mainframes provide high levels of reliability, security, scalability, and cost-effectiveness, making them an attractive option for organizations with specific needs and requirements.</span></p><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #d1d5db; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: 16px; margin: 1.25em 0px 0px; white-space: pre-wrap;"><span style="background-color: white; color: black; font-family: verdana; font-size: medium; white-space: normal;">This seems like a reasonable response to me. What do you think? With technology this good, I can only imagine how much better it will get as the models are honed over time.</span></p><p style="--tw-border-spacing-x: 0; --tw-border-spacing-y: 0; --tw-ring-color: rgba(59,130,246,0.5); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 transparent; --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 transparent; --tw-rotate: 0; --tw-scale-x: 1; --tw-scale-y: 1; --tw-scroll-snap-strictness: proximity; --tw-shadow-colored: 0 0 transparent; --tw-shadow: 0 0 transparent; --tw-skew-x: 0; --tw-skew-y: 0; --tw-translate-x: 0; --tw-translate-y: 0; border: 0px solid rgb(217, 217, 227); box-sizing: border-box; color: #d1d5db; font-family: Söhne, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: 16px; margin: 1.25em 0px 0px; white-space: pre-wrap;"><br /></p>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com2tag:blogger.com,1999:blog-18371456.post-35769239108983627992023-01-23T10:44:00.004-06:002023-01-23T10:44:39.714-06:00Escaping Single Quotes in Db2 SQL Statements<p><span style="font-family: helvetica;">Every now and then I write about some things that may seem to be basic to old-timers, but can be very confusing to developers the first time they encounter them. Today's post is an example.</span></p><p><span style="font-family: helvetica;">How do you handle a text string with a single quote in it? For example, something like this:</span></p><p><span style="font-family: courier;"> Today is Craig's birthday (not really)</span></p><p><span style="font-family: helvetica;">Well, the first thing to corroborate is that text in Db2 SQL is delimited by single quotes. So the first attempt people tend to make is something like this:</span></p><p><span style="font-family: courier;"> 'Today is Craig's birthday (not really)'</span></p><p><span style="font-family: helvetica;">But they also quickly discover that this does not work. There are three single quotes here: one at the beginning, one between the "g" and the "s", and one at the end. So Db2 will choke on it and you will get an error.</span></p><p><span style="font-family: helvetica;">The trick is knowing the escape character. An "escape" character is used to tell Db2 that the next character is actually part of the text string, not a delimiter. For Db2, the escape is to double up the single quote (note that other DBMSes may use a different technique). So, if we want to use our sample text phrase in Db2 SQL, we'd code it with the escape character, as follows:</span></p><p><span style="font-family: courier;"> 'Today is Craig''s birthday (not really)'</span></p><p><span style="font-family: helvetica;">The single quote denoting the possessive for Craig's is doubled. This tells Db2 to treat the single quote as part of the text. So we could write SQL like this:</span></p><p><span style="font-family: courier;"> SELECT </span><span style="font-family: courier;">'</span><span style="font-family: courier;">Today is Craig''s birthday (not really)'<br /></span><span style="font-family: courier;"> </span><span style="font-family: courier;">FROM SYSIBM.SYSDUMMY1;</span></p><p><span style="font-family: helvetica;">This will return the text that we want:</span></p><p><span style="font-family: courier;"> </span><span style="font-family: courier;">Today is Craig's birthday (not really)</span></p><p><span style="font-family: helvetica;">This works even if there are multiple single quotes within the text. For example, consider if we want to use the following text in SQL:</span></p><p><span style="font-family: courier;"> </span><span style="font-family: courier;">Today is not Craig's birthday but it is Beth's</span></p><p><span style="font-family: helvetica;">We could write the SQL like this:</span></p><p><span style="font-family: courier;"> SELECT </span><span style="font-family: courier;">'</span><span style="font-family: courier;">Today is not Craig''s birthday but it is Beth''s'<br /></span><span style="font-family: courier;"> </span><span style="font-family: courier;">FROM SYSIBM.SYSDUMMY1;</span></p><p><span style="font-family: helvetica;">And it also works even at the end of the text string, even though it starts to look somewhat confusing. For example, what is we want to use the following text in SQL?</span></p><p><span style="font-family: courier;"> I like the book 'A Confederacy of Dunces'</span></p><p><span style="font-family: helvetica;">In that case, we still double up the single quotes, like so:</span></p><p><span style="font-family: courier;"> SELECT </span><span style="font-family: courier;">'</span><span style="font-family: courier;">I like ths book ''A Confederacy of Dunces'''<br /></span><span style="font-family: courier;"> </span><span style="font-family: courier;">FROM SYSIBM.SYSDUMMY1;</span></p><p><span style="font-family: helvetica;">And that will return our desired text.</span></p><p><span style="font-family: helvetica;">I hope this short treatise on how to use the escape for single quotes in Db2 SQL has been helpful!</span></p>Craig S. Mullinshttp://www.blogger.com/profile/17077237739217901780noreply@blogger.com2