Rebuilding Indexes

Rebuilding indexes in a physical diagram automatically updates any changes that you have made to primary keys, foreign keys, or alternate keys in your model.

The following options are available when rebuilding indexes:

Option

Description

Primary key

Rebuilds primary key indexes. The text box shows the naming convention for primary keys. By default this is %TABLE%_PK

Other keys

Rebuilds alternate key indexes. The text box shows the naming convention for alternate keys. By default this is %AKEY%_AK

Foreign key indexes

Rebuilds foreign key indexes. The text box shows the naming convention for foreign keys. By default this is %REFR%_FK

Foreign key threshold

Specifies the minimum number of estimated records in a table that are necessary before a foreign key index can be created. The estimated number of records is defined in the Number box in the table property sheet. If the table has no specified number of occurrences, the foreign key indexes are generated by default

Mode

Specifies the extent of the rebuild. You can select:

  • Delete and Rebuild – deletes and rebuilds all indexes presently attached to primary, alternate, and foreign keys

  • Add missing indexes – preserves all indexes presently attached to primary, alternate, and foreign keys and adds any that are missing

You can use the following variables in the PK index names fields:

Variable

Value

%TABLE%

Generated code of the table. This is the table code generated in the database. It may be truncated if the code contains characters not supported by the DBMS

%TNAME%

Table name

%TCODE%

Table code

%TLABL%

Table comment

You can use the following variables in the FK index name field. The generated code of a variable is the code defined in the object property sheet, it may be truncated when generated if the code contains characters not supported by the DBMS:

Variable

Value

%REFR%

Generated code of the reference

%PARENT%

Generated code of the parent table

%PNAME%

Parent table name

%PCODE%

Parent table code

%CHILD%

Generated code of the child

%CNAME%

Child table name

%CCODE%

Child table code

%PQUALIFIER%

Parent table qualifier

%CQUALIFIER%

Child table qualifier

%REFRNAME%

Reference name

%REFRCODE%

Reference code

  1. Select Tools > Rebuild Objects > Rebuild Indexesto open the Rebuild Indexes dialog box.


  2. Set the appropriate options.
  3. [optional] Click the Selection tab to specify which tables you want to rebuild indexes for.
  4. Click OK. If you selected the Delete and Rebuild mode, a confirmation box asks you to confirm your choice. Click Yes to confirm the deletion and rebuild of the selected references.