Rebuilding Indexes

You can rebuild indexes at any time to reflect any changes that you have made to primary keys, foreign keys, or alternate keys in your model.

  1. Select Tools > Rebuild Objects > Rebuild Indexes, and enter the appropriate options:

    Option

    Description

    Primary key

    Rebuilds primary key indexes. The field displays the naming convention for primary key indexes, which is by default %TABLE%_PK. You can use the following variables:
    • %TABLE% - Generated code of the table. The generated code of a variable is the code defined in the object property sheet, but may be truncated if it contains characters not supported by the DBMS.
    • %TNAME%, %TCODE%, %TLABL% - Table name, code, and comment.

    Other keys

    Rebuilds alternate key indexes. The field displays the naming convention for alternate key indexes, which is by default %AKEY%_AK.

    Foreign key indexes

    Rebuilds foreign key indexes. The field displays the naming convention for foreign key indexes, which is by default %REFR%_FK. You can use the following variables:
    • %REFR%, %PARENT%, %CHILD% - Generated code of the reference, parent, and child table.
    • %PNAME%, %PCODE%, %PQUALIFIER% - Parent table name, code, and qualifier.
    • %CNAME%, %CCODE%, %CQUALIFIER% - Child table name or code, and qualifier.
    • %REFRNAME%, %REFRCODE% - Reference name or code.

    Foreign key threshold

    Specifies the minimum number of estimated records in a table (specified in the Number field in the table property sheet) that are necessary before a foreign key index can be created. If the Number field is empty, foreign key indexes are generated.

    Mode

    Specifies the type of rebuild. You can select:
    • Delete and Rebuild – Delete and rebuild all indexes attached to primary, alternate, and foreign keys.
    • Add missing indexes – Preserve existing key indexes and add any missing key indexes.
  2. [optional] Click the Selection tab to specify which tables you want to rebuild indexes for.
  3. 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 indexes.