An Introduction to DB2 Indexing

Monday Mar 22nd 2004 by Staff

This article is adapted from the upcoming edition of Craig's book, DB2 Developer's Guide, 5th edition. This new edition, which will be available in May 2004, updates the book to include coverage of DB2 Version 7 and Version 8.


You can create indexes on DB2 table columns to speed up query processing. An index uses pointers to actual data to more efficiently access specific pieces of data. Once created, DB2 automatically maintains each index as data is added, modified, and deleted from the table. As data is selected from the table DB2 can choose to use the index to access the data more efficiently. It is important to remember that index modification and usage is automatic - that is, you do not need to tell DB2 to modify indexes as data changes nor can you tell DB2 to use a particular index to access data. This automation and separation makes it easy to deploy DB2 indexes.

To illustrate how an index works think about the index in a book. If you are trying to find a reference to a particular term in this large book, you can look up the word in the index, which is arranged alphabetically. When you find the word in the index, one or more page numbers will be listed after the word. These numbers point to the actual pages in the book where information on the term can be found.

The article continues at

Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved