Chapter 3 Building Physical Diagrams


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.

You can rebuild indexes for one or more tables in a physical diagram. You can also choose to rebuild indexes from the model, or from a package.

Rebuilding index options

You can indicate the following parameters to rebuild indexes:

Parameters 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

PK index name variables

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

FK index name variables

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

 


Copyright (C) 2005. Sybase Inc. All rights reserved.