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