Online Documentation for SQL Manager for DB2

Indexes


An Index is a schema object that contains an entry for each value that appears in the indexed column(s) of the table, provides quick access to data and can enforce uniqueness on the rows in the table.

 

 

Creating Indexes

 

To create a new index:

Hint: To create a new index, you can also right-click the Indexes node of the DB Explorer tree and select the New Index... context menu item.

 

To create a new index with the same properties as one of existing indices has:

Alternatively, you can right-click an index in the DB Explorer tree and select the Duplicate Index <index_name>... context menu item.

 

Duplicate Object Wizard allows you to select the database to create a new index in, and to edit the result SQL statement for creating the index.

 

 

Editing Indexes

 

To edit an existing index:

  • select the index for editing in the DB Explorer tree (type the first letters of the index name for quick search);
  • right-click the object and select the Edit Index <index_name>... context menu item, or simply double-click the index;
  • edit index definition using the appropriate tabs of Index Editor.

 

Dropping Indexes

 

To drop an index:

  • select the index to drop in the DB Explorer tree;
  • right-click the object and select the Drop Index <index_name>... context menu item;
  • confirm dropping in the dialog window.

 

Note: If more convenient, you can also use the following shortcuts:

Ctrl+N to create a new index;

Ctrl+O to edit the selected index;

Shift+Del to drop the object from the database.