Table management | Tablespace management


Index management

If there is no index defined in a table, a table scan must be performed for each each table referenced in a database query. When the database system is running for a long time, such as table orders in the Commerce database, it will become larger and larger. The result is that the larger the table, the longer a table scan takes since a table scan requires each table row to be accessed sequentially. In most cases, for a SQL query that might return only some rows, an index scan is much faster than a table scan, which will give the DB2 database system more capacity to handle other transactions' requests at a consolidated duration.

Commerce already has many indexes defined. Therefore, users should not need to create them everywhere, but carefully consider the implications that are listed below.

Although indexes can reduce access time significantly, they can also have adverse effects on performance. Before you create indexes, consider the effects of multiple indexes on disk space and processing time:

Choose indexes carefully to address the needs of the application program. Some general index planning tips are:

xxxx