DB2 index optimization Policy Selection

Source: Internet
Author: User
Tags db2 date

DB2 index optimization can make the index more efficient and more reasonable. The following describes the DB2 index optimization policies in detail, hoping to give you a deeper understanding of DB2 index optimization.

DB2 index optimization:

An index is also a DB2 object consisting of a group of sorted keys extracted from one or more columns in the corresponding table. Generally, indexes can provide direct pointers to the requested data rows in the table. If the order of the result set is the same as that of the index, sorting can be eliminated; if the requested columns are included in the index, you can avoid having to read data rows.

Through the following DB2 index optimization principles, you can create more efficient and reasonable indexes.

1) include all the columns in the WHERE clause in the index. In this way, you can use the shielding of the index to reject unqualified rows in the result set.

2) create an index for the columns referenced in the roder by clause in SQL statements to avoid sorting.

3) Considering the management overhead, avoid using more than five columns in the index.

4) for multi-column indexes, put the column with the most referenced in the query before the definition.

5) columns with a large base are more suitable for indexing.

6) do not include columns that are frequently modified or inserted or deleted in the index. The only exception is primary and external keywords.

7) The index cannot be "null)". Any column containing null values will not be included in the index, any statement optimizer that uses is null or is not null in the WHERE clause will not use the index.
 

Implementation of DB2 date format change

Basic knowledge of DB2 Date and Time

DB2 event monitoring command

How to Implement online DB2 Import

Common db2 stored procedure statements

Related Article

Contact Us

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

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

A Free Trial That Lets You Build Big!

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

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

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