Chapter 3 Building Physical Diagrams
You can create the following types of index:
Use the following naming conventions for indexes:
Index | Naming convention |
---|---|
Primary key | Table code followed by PK; for example EMPLOYEE _PK |
Foreign key | Table code followed by FK; for example PROJECT _ FK |
Alternate key | Table code followed by AK; for example EMPLOYEE _ AK |
A table contains a compound primary key. This is a primary key designated to more than one column in a table. You create an index and link it to the primary key. If one of the primary key columns is deleted, the corresponding index associated with the column is also deleted.
To create an index:
An index column with an expression has a LONG data type that cannot be concatenated in a string statement during reverse engineering. The only way to bypass this limitation and concatenate this value is to use variables in the query executed to retrieve the adequate information.
In the Oracle 8i and Oracle 8i2 DBMS, the query SqlListQuery
defined in the Index category contains the following variable used to recover the index expression in a column with the LONG data type.
'%SqlExpression.Xpr'||i.table_name||i.index_name||c.column_position||'%'
For more information on the use of variables in reverse engineering queries, see section Extension mechanism for live database reverse engineering queries, in the DBMS Reference Guide chapter of the Advanced User Documentation .
Function-based indexes defined on UPPER(column_name) or LOWER(column_name) can facilitate case-insensitive searches.
You want to define an index that will put all names in lowercase on the table EMPLOYEE in order to ease search. You can define the following index (syntax for Oracle 8i):
CREATE INDEX low_name_idx ON EMPLOYEE (LOWER(EMPLNAM))
Then the DBMS can use it when processing queries such as:
SELECT * FROM EMPLOYEE WHERE LOWER(EMPLNAM)="brown"
For general information about creating objects, see the chapter "Getting Started with PowerDesigner" in the General Features Guide .
Copyright (C) 2007. Sybase Inc. All rights reserved. |
![]() |